mirror of
https://github.com/XFox111/PasswordGeneratorExtension.git
synced 2026-04-22 08:08:01 +03:00
Minor 1.2 (#5)
- Added option "Do not repeat characters" - Updated GitHub release template - Updated CI config
This commit is contained in:
@@ -1,6 +1,15 @@
|
|||||||
## What's new
|
## What's new
|
||||||
|
-
|
||||||
|
|
||||||
## How to install
|
## Installation
|
||||||
|
### From extension webstore (recommended)
|
||||||
|
- [Google Chrome Webstore](https://chrome.google.com/webstore/detail/jnjobgjobffgmgfnkpkjfjkkfhfikmfl)
|
||||||
|
- [Microsoft Edge Add-ons Webstore](https://microsoftedge.microsoft.com/addons/detail/manimdhobjbkfpeeehlhhneookiokpbj)
|
||||||
|
- [Firefox Add-ons](https://addons.mozilla.org/en-US/firefox/addon/easy-password-generator/)
|
||||||
|
- [GitHub Releases](https://github.com/xfox111/PasswordGeneratorExtension/releases/latest)
|
||||||
|
|
||||||
|
Note that version published on these webstores can differ from this release
|
||||||
|
### Sideloading (for testing purposes only)
|
||||||
1. Download attached archive and unpack it
|
1. Download attached archive and unpack it
|
||||||
2. Enable Developers mode on your browser extensions page
|
2. Enable Developers mode on your browser extensions page
|
||||||
3. Click "Load unpacked" button and navigate to the extension root folder (contains `manifest.json`)
|
3. Click "Load unpacked" button and navigate to the extension root folder (contains `manifest.json`)
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
release:
|
||||||
push:
|
types: [published]
|
||||||
branches: [ master ]
|
|
||||||
paths:
|
|
||||||
# Trigger deploy on manifest change
|
|
||||||
- 'manifest.json'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Firefox:
|
Firefox:
|
||||||
@@ -35,7 +31,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: 'Firefox Artefacts'
|
name: 'Firefox Artefacts'
|
||||||
path: ${{ steps.web-ext-sign.outputs.target }}
|
path: ${{ steps.web-ext-build.outputs.target }}
|
||||||
|
|
||||||
Chrome:
|
Chrome:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -58,6 +54,15 @@ jobs:
|
|||||||
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
|
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
|
||||||
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
|
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: xresloader/upload-to-github-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
file: ./PasswordGenerator.zip
|
||||||
|
tags: true
|
||||||
|
draft: true
|
||||||
|
|
||||||
- name: Drop artifacts
|
- name: Drop artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -29,6 +29,11 @@
|
|||||||
"message": "Invalid generator settings. No password was generated",
|
"message": "Invalid generator settings. No password was generated",
|
||||||
"description": "Message which is shown after a creation of password failed"
|
"description": "Message which is shown after a creation of password failed"
|
||||||
},
|
},
|
||||||
|
"notEnoughChars":
|
||||||
|
{
|
||||||
|
"message": "With your current settings, your password length should not exceed %MIN_CHARS% characters",
|
||||||
|
"description": "Message which is shown if there's no enough characters to create a password"
|
||||||
|
},
|
||||||
"lengthPrompt":
|
"lengthPrompt":
|
||||||
{
|
{
|
||||||
"message": "Set password length. Press OK to use default password length (%LEN% characters)",
|
"message": "Set password length. Press OK to use default password length (%LEN% characters)",
|
||||||
@@ -80,6 +85,11 @@
|
|||||||
"message": "Exclude ambiguous characters (e.g.",
|
"message": "Exclude ambiguous characters (e.g.",
|
||||||
"description": "Option checkbox label"
|
"description": "Option checkbox label"
|
||||||
},
|
},
|
||||||
|
"dontRepeatChars":
|
||||||
|
{
|
||||||
|
"message": "Do not repeat characters",
|
||||||
|
"description": "Option checkbox label"
|
||||||
|
},
|
||||||
|
|
||||||
"extOptions":
|
"extOptions":
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,6 +29,11 @@
|
|||||||
"message": "Установлены неправильные настройки генератора. Ничего не было сгенерировано",
|
"message": "Установлены неправильные настройки генератора. Ничего не было сгенерировано",
|
||||||
"description": "Message which is shown after a creation of password failed"
|
"description": "Message which is shown after a creation of password failed"
|
||||||
},
|
},
|
||||||
|
"notEnoughChars":
|
||||||
|
{
|
||||||
|
"message": "При текущих параметрах длина создаваемого пароля должна быть не больше %MIN_CHARS% знаков",
|
||||||
|
"description": "Message which is shown if there's no enough characters to create a password"
|
||||||
|
},
|
||||||
"lengthPrompt":
|
"lengthPrompt":
|
||||||
{
|
{
|
||||||
"message": "Укажите длину пароля. Нажмите ОК чтобы использовать длину по умолчанию (%LEN% символов)",
|
"message": "Укажите длину пароля. Нажмите ОК чтобы использовать длину по умолчанию (%LEN% символов)",
|
||||||
@@ -80,6 +85,11 @@
|
|||||||
"message": "Исключить специальные символы (например:",
|
"message": "Исключить специальные символы (например:",
|
||||||
"description": "Option checkbox label"
|
"description": "Option checkbox label"
|
||||||
},
|
},
|
||||||
|
"dontRepeatChars":
|
||||||
|
{
|
||||||
|
"message": "Не повторять символы",
|
||||||
|
"description": "Option checkbox label"
|
||||||
|
},
|
||||||
|
|
||||||
"extOptions":
|
"extOptions":
|
||||||
{
|
{
|
||||||
|
|||||||
+9
-4
@@ -10,6 +10,7 @@ chrome.storage.sync.get(
|
|||||||
includeUppercase: true,
|
includeUppercase: true,
|
||||||
excludeSimilar: true,
|
excludeSimilar: true,
|
||||||
excludeSpecial: true,
|
excludeSpecial: true,
|
||||||
|
dontRepeatChars: false,
|
||||||
|
|
||||||
// Extension settings
|
// Extension settings
|
||||||
showButton: true,
|
showButton: true,
|
||||||
@@ -32,6 +33,7 @@ chrome.storage.sync.get(
|
|||||||
"includeUppercase",
|
"includeUppercase",
|
||||||
"excludeSimilar",
|
"excludeSimilar",
|
||||||
"excludeSpecial",
|
"excludeSpecial",
|
||||||
|
"dontRepeatChars",
|
||||||
|
|
||||||
"showButton",
|
"showButton",
|
||||||
"showContext",
|
"showContext",
|
||||||
@@ -47,8 +49,11 @@ chrome.storage.sync.get(
|
|||||||
function SetupEventHandlers()
|
function SetupEventHandlers()
|
||||||
{
|
{
|
||||||
document.querySelectorAll("input").forEach(i =>
|
document.querySelectorAll("input").forEach(i =>
|
||||||
i.addEventListener("input",
|
i.addEventListener(
|
||||||
() => chrome.storage.sync.set(JSON.parse("{ \"" + i.id + "\": " + (i.type == "checkbox" ? i.checked : i.value) + " }"))));
|
"input",
|
||||||
|
() => chrome.storage.sync.set(JSON.parse("{ \"" + i.id + "\": " + (i.type == "checkbox" ? i.checked : i.value) + " }"))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
document.querySelector("#generate").addEventListener("click", () => GeneratePassword(null, true));
|
document.querySelector("#generate").addEventListener("click", () => GeneratePassword(null, true));
|
||||||
document.querySelector("#more").addEventListener("click", (s) =>
|
document.querySelector("#more").addEventListener("click", (s) =>
|
||||||
@@ -57,12 +62,12 @@ function SetupEventHandlers()
|
|||||||
if (group.hasAttribute("hidden"))
|
if (group.hasAttribute("hidden"))
|
||||||
{
|
{
|
||||||
group.removeAttribute("hidden");
|
group.removeAttribute("hidden");
|
||||||
s.currentTarget.querySelector("i").textContent = "";
|
s.currentTarget.querySelector("i").textContent = "\uE010";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
group.setAttribute("hidden", "");
|
group.setAttribute("hidden", "");
|
||||||
s.currentTarget.querySelector("i").textContent = "";
|
s.currentTarget.querySelector("i").textContent = "\uE011";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
+9
-2
@@ -49,7 +49,8 @@ function GeneratePassword(e, useDefaultLength = false)
|
|||||||
excludeSimilar: true,
|
excludeSimilar: true,
|
||||||
excludeSpecial: true,
|
excludeSpecial: true,
|
||||||
hideAlert: false,
|
hideAlert: false,
|
||||||
promptForLength: false
|
promptForLength: false,
|
||||||
|
dontRepeatChars: false,
|
||||||
},
|
},
|
||||||
(settings) =>
|
(settings) =>
|
||||||
{
|
{
|
||||||
@@ -82,7 +83,7 @@ function GeneratePassword(e, useDefaultLength = false)
|
|||||||
if (response === null) // If user clicked 'Cancel'
|
if (response === null) // If user clicked 'Cancel'
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (parseInt(response))
|
if (parseInt(response) && response > 1)
|
||||||
{
|
{
|
||||||
pwdLength = response;
|
pwdLength = response;
|
||||||
break;
|
break;
|
||||||
@@ -91,6 +92,12 @@ function GeneratePassword(e, useDefaultLength = false)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (settings.dontRepeatChars && availableCharacters.length < pwdLength)
|
||||||
|
{
|
||||||
|
alert(chrome.i18n.getMessage("notEnoughChars").replace("%MIN_CHARS%", availableCharacters.length));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (k = 0; k < pwdLength; k++)
|
for (k = 0; k < pwdLength; k++)
|
||||||
password += availableCharacters[GetRandomInt(0, availableCharacters.length)]; // Picking random characters
|
password += availableCharacters[GetRandomInt(0, availableCharacters.length)]; // Picking random characters
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_name__",
|
"name": "__MSG_name__",
|
||||||
"version": "1.1",
|
"version": "1.2",
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"description": "__MSG_description__",
|
"description": "__MSG_description__",
|
||||||
"author": "__MSG_author__",
|
"author": "__MSG_author__",
|
||||||
|
|||||||
+6
-1
@@ -20,7 +20,7 @@
|
|||||||
<h2 loc="generatorOptions">Generator options</h2>
|
<h2 loc="generatorOptions">Generator options</h2>
|
||||||
<div class="group">
|
<div class="group">
|
||||||
<label for="length" style="margin: 5px 0px;"><b loc="length">Password length</b></label>
|
<label for="length" style="margin: 5px 0px;"><b loc="length">Password length</b></label>
|
||||||
<input id="length" type="number" />
|
<input id="length" type="number" min="2"/>
|
||||||
<label><span loc="hint">Reccommended password length:</span> <b>16-32</b></label>
|
<label><span loc="hint">Reccommended password length:</span> <b>16-32</b></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="group">
|
<div class="group">
|
||||||
@@ -54,6 +54,11 @@
|
|||||||
<span class="mark"></span>
|
<span class="mark"></span>
|
||||||
<span><span loc="excludeSpecial">Exclude ambiguous characters (e.g.</span> { } [ ] ( ) / \ ' " ` ~ , ; : . < >)</span>
|
<span><span loc="excludeSpecial">Exclude ambiguous characters (e.g.</span> { } [ ] ( ) / \ ' " ` ~ , ; : . < >)</span>
|
||||||
</label>
|
</label>
|
||||||
|
<label class="checkbox control">
|
||||||
|
<input id="dontRepeatChars" type="checkbox" />
|
||||||
|
<span class="mark"></span>
|
||||||
|
<span><span loc="dontRepeatChars">Do not repeat characters</span>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2 loc="extOptions">Extension options</h2>
|
<h2 loc="extOptions">Extension options</h2>
|
||||||
|
|||||||
Reference in New Issue
Block a user