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
|
||||
-
|
||||
|
||||
## 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
|
||||
2. Enable Developers mode on your browser extensions page
|
||||
3. Click "Load unpacked" button and navigate to the extension root folder (contains `manifest.json`)
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
# Trigger deploy on manifest change
|
||||
- 'manifest.json'
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
Firefox:
|
||||
@@ -35,7 +31,7 @@ jobs:
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: 'Firefox Artefacts'
|
||||
path: ${{ steps.web-ext-sign.outputs.target }}
|
||||
path: ${{ steps.web-ext-build.outputs.target }}
|
||||
|
||||
Chrome:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -58,6 +54,15 @@ jobs:
|
||||
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
|
||||
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
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
|
||||
@@ -29,6 +29,11 @@
|
||||
"message": "Invalid generator settings. No password was generated",
|
||||
"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":
|
||||
{
|
||||
"message": "Set password length. Press OK to use default password length (%LEN% characters)",
|
||||
@@ -80,6 +85,11 @@
|
||||
"message": "Exclude ambiguous characters (e.g.",
|
||||
"description": "Option checkbox label"
|
||||
},
|
||||
"dontRepeatChars":
|
||||
{
|
||||
"message": "Do not repeat characters",
|
||||
"description": "Option checkbox label"
|
||||
},
|
||||
|
||||
"extOptions":
|
||||
{
|
||||
|
||||
@@ -29,6 +29,11 @@
|
||||
"message": "Установлены неправильные настройки генератора. Ничего не было сгенерировано",
|
||||
"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":
|
||||
{
|
||||
"message": "Укажите длину пароля. Нажмите ОК чтобы использовать длину по умолчанию (%LEN% символов)",
|
||||
@@ -80,6 +85,11 @@
|
||||
"message": "Исключить специальные символы (например:",
|
||||
"description": "Option checkbox label"
|
||||
},
|
||||
"dontRepeatChars":
|
||||
{
|
||||
"message": "Не повторять символы",
|
||||
"description": "Option checkbox label"
|
||||
},
|
||||
|
||||
"extOptions":
|
||||
{
|
||||
|
||||
+9
-4
@@ -10,6 +10,7 @@ chrome.storage.sync.get(
|
||||
includeUppercase: true,
|
||||
excludeSimilar: true,
|
||||
excludeSpecial: true,
|
||||
dontRepeatChars: false,
|
||||
|
||||
// Extension settings
|
||||
showButton: true,
|
||||
@@ -32,6 +33,7 @@ chrome.storage.sync.get(
|
||||
"includeUppercase",
|
||||
"excludeSimilar",
|
||||
"excludeSpecial",
|
||||
"dontRepeatChars",
|
||||
|
||||
"showButton",
|
||||
"showContext",
|
||||
@@ -47,8 +49,11 @@ chrome.storage.sync.get(
|
||||
function SetupEventHandlers()
|
||||
{
|
||||
document.querySelectorAll("input").forEach(i =>
|
||||
i.addEventListener("input",
|
||||
() => chrome.storage.sync.set(JSON.parse("{ \"" + i.id + "\": " + (i.type == "checkbox" ? i.checked : i.value) + " }"))));
|
||||
i.addEventListener(
|
||||
"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("#more").addEventListener("click", (s) =>
|
||||
@@ -57,12 +62,12 @@ function SetupEventHandlers()
|
||||
if (group.hasAttribute("hidden"))
|
||||
{
|
||||
group.removeAttribute("hidden");
|
||||
s.currentTarget.querySelector("i").textContent = "";
|
||||
s.currentTarget.querySelector("i").textContent = "\uE010";
|
||||
}
|
||||
else
|
||||
{
|
||||
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,
|
||||
excludeSpecial: true,
|
||||
hideAlert: false,
|
||||
promptForLength: false
|
||||
promptForLength: false,
|
||||
dontRepeatChars: false,
|
||||
},
|
||||
(settings) =>
|
||||
{
|
||||
@@ -82,7 +83,7 @@ function GeneratePassword(e, useDefaultLength = false)
|
||||
if (response === null) // If user clicked 'Cancel'
|
||||
return;
|
||||
|
||||
if (parseInt(response))
|
||||
if (parseInt(response) && response > 1)
|
||||
{
|
||||
pwdLength = response;
|
||||
break;
|
||||
@@ -91,6 +92,12 @@ function GeneratePassword(e, useDefaultLength = false)
|
||||
break;
|
||||
}
|
||||
|
||||
if (settings.dontRepeatChars && availableCharacters.length < pwdLength)
|
||||
{
|
||||
alert(chrome.i18n.getMessage("notEnoughChars").replace("%MIN_CHARS%", availableCharacters.length));
|
||||
return;
|
||||
}
|
||||
|
||||
for (k = 0; k < pwdLength; k++)
|
||||
password += availableCharacters[GetRandomInt(0, availableCharacters.length)]; // Picking random characters
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "__MSG_name__",
|
||||
"version": "1.1",
|
||||
"version": "1.2",
|
||||
"manifest_version": 2,
|
||||
"description": "__MSG_description__",
|
||||
"author": "__MSG_author__",
|
||||
|
||||
+6
-1
@@ -20,7 +20,7 @@
|
||||
<h2 loc="generatorOptions">Generator options</h2>
|
||||
<div class="group">
|
||||
<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>
|
||||
</div>
|
||||
<div class="group">
|
||||
@@ -54,6 +54,11 @@
|
||||
<span class="mark"></span>
|
||||
<span><span loc="excludeSpecial">Exclude ambiguous characters (e.g.</span> { } [ ] ( ) / \ ' " ` ~ , ; : . < >)</span>
|
||||
</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>
|
||||
|
||||
<h2 loc="extOptions">Extension options</h2>
|
||||
|
||||
Reference in New Issue
Block a user