Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
9cf67b5dec | |||
736367738f | |||
4dbd892d04 | |||
48f8b8d5bc | |||
2a0d1b0fe2 | |||
710fb753b7 | |||
c784e80ece | |||
8f7ec24032 | |||
9e6829e808 | |||
76362b8b6d |
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/.project
|
BIN
img/screenshot.png
Normal file
After Width: | Height: | Size: 11 KiB |
@@ -1 +0,0 @@
|
|||||||
|
|
@@ -1,33 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<link rel="stylesheet" href="pwgen.css"/>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<form>
|
|
||||||
<div>
|
|
||||||
<label for"length">length</label>
|
|
||||||
<input type="number" id="length" value="14" min="0" name="length">
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for"special">include special chars</label>
|
|
||||||
<input type="checkbox" id="special" checked="checked" name="special">
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for"pw">your password</label>
|
|
||||||
<input type="text" id="pw" name="pw">
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<button id="copy">copy to clipboard</button><button id="new">give me an other one</button>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for"directcopy">direct copy</label>
|
|
||||||
<input type="checkbox" id="directcopy" name="directcopy" title="next time when i click the button, copy the new password immediately to the clipboard">
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
<script src="pwgen.js"></script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
Before Width: | Height: | Size: 473 B After Width: | Height: | Size: 473 B |
Before Width: | Height: | Size: 647 B After Width: | Height: | Size: 647 B |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
@@ -2,7 +2,7 @@
|
|||||||
"description": "Just a toolbar button that generates a password and copies it to your clipboard.",
|
"description": "Just a toolbar button that generates a password and copies it to your clipboard.",
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "pwgen reloaded",
|
"name": "pwgen reloaded",
|
||||||
"version": "1.1.1",
|
"version": "1.1.4",
|
||||||
"homepage_url": "https://github.com/S2-/pwgen",
|
"homepage_url": "https://github.com/S2-/pwgen",
|
||||||
"icons": {
|
"icons": {
|
||||||
"48": "icons/lock-48.png"
|
"48": "icons/lock-48.png"
|
22
src/popup/pwgen.css
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
body {
|
||||||
|
margin: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="number"] {
|
||||||
|
-moz-appearance: none;
|
||||||
|
color: var(--in-content-text-color);
|
||||||
|
border: 1px solid var(--in-content-box-border-color);
|
||||||
|
-moz-border-top-colors: none !important;
|
||||||
|
-moz-border-right-colors: none !important;
|
||||||
|
-moz-border-bottom-colors: none !important;
|
||||||
|
-moz-border-left-colors: none !important;
|
||||||
|
border-radius: 2px;
|
||||||
|
background-color: var(--in-content-box-background);
|
||||||
|
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: inherit;
|
||||||
|
padding: 5px 10px;
|
||||||
|
}
|
||||||
|
input[type="checkbox"] {
|
||||||
|
margin-bottom: -7px;
|
||||||
|
}
|
45
src/popup/pwgen.html
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link rel="stylesheet" href="chrome://global/skin/global.css" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="chrome://mozapps/content/extensions/extensions.css" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="resource://gre-resources/forms.css" type="text/css" />
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="pwgen.css"/>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<form>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for"length">length <input type="number" id="length" value="14" min="0" name="length"></label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<input type="checkbox" id="special" checked="checked" name="special">
|
||||||
|
<label for"special">include special chars</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="pw">your password</label>
|
||||||
|
<input type="text" id="pw" name="pw">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button id="copy" style="margin-left: 0;">copy to clipboard</button><button id="new">give me an other one</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<input type="checkbox" id="directcopy" name="directcopy" title="next time when i click the button, copy the new password immediately to the clipboard">
|
||||||
|
<label for="directcopy">direct copy</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
<script src="pwgen.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
@@ -1,7 +1,7 @@
|
|||||||
function randPassword(length, includeSpecial) {
|
function randPassword(length, includeSpecial) {
|
||||||
let pwdChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";
|
let pwdChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";
|
||||||
if (includeSpecial) {
|
if (includeSpecial) {
|
||||||
pwdChars += '°^!"§$%&/()=?`´\}][{²³€|<>-.,;:*+_';
|
pwdChars += '°^!"§$%&/()=?`´\\}][{²³€|<>-.,;:*+_µ@~';
|
||||||
}
|
}
|
||||||
let randPassword = Array(length).fill(pwdChars).map(function(x) {
|
let randPassword = Array(length).fill(pwdChars).map(function(x) {
|
||||||
return x[Math.floor(Math.random() * x.length)]
|
return x[Math.floor(Math.random() * x.length)]
|
||||||
@@ -39,7 +39,6 @@ document.getElementById('new').addEventListener('click', (ev) => {
|
|||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
var params = getParams();
|
var params = getParams();
|
||||||
document.getElementById('pw').value = randPassword(params.length, params.special);
|
document.getElementById('pw').value = randPassword(params.length, params.special);
|
||||||
saveOptions(params);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('copy').addEventListener('click', (ev) => {
|
document.getElementById('copy').addEventListener('click', (ev) => {
|
||||||
@@ -47,9 +46,12 @@ document.getElementById('copy').addEventListener('click', (ev) => {
|
|||||||
copypasstoclippboard();
|
copypasstoclippboard();
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('directcopy').addEventListener('change', (ev) => {
|
var list = document.getElementsByTagName('input');
|
||||||
saveOptions(getParams());
|
for (var i = 0; i < list.length; i++) {
|
||||||
});
|
list[i].addEventListener('change', (ev) => {
|
||||||
|
saveOptions(getParams());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
loadOptions().then((options) => {
|
loadOptions().then((options) => {
|
||||||
document.getElementById('length').value = options.length;
|
document.getElementById('length').value = options.length;
|