-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added initial Chrome packaging support - not really working, but at l…
…east the extension installs
- Loading branch information
Wladimir Palant
committed
Apr 25, 2016
1 parent
1a74f50
commit 4262486
Showing
15 changed files
with
397 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
/build/ | ||
/build-jpm/ | ||
/build-chrome/ | ||
/node_modules/ | ||
*.xpi | ||
*.crx | ||
*.zip | ||
*.pyc | ||
*.sh | ||
*.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
|
||
<!-- | ||
- This Source Code is subject to the terms of the Mozilla Public License | ||
- version 2.0 (the "License"). You can obtain a copy of the License at | ||
- http://mozilla.org/MPL/2.0/. | ||
--> | ||
|
||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title data-l10n-id="options-title"></title> | ||
<link rel="stylesheet" href="options.css"> | ||
</head> | ||
<body> | ||
<label for="autolock" data-l10n-id="autolock_title"></label> | ||
<div class="subtitle" data-l10n-id="autolock_description"></div> | ||
<input type="checkbox" id="autolock" checked> | ||
|
||
<label for="autolock_delay" data-l10n-id="autolock_delay_title"></label> | ||
<div class="subtitle" data-l10n-id="autolock_delay_description"></div> | ||
<input type="number" id="autolock_delay" value="10" min="0"> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* This Source Code is subject to the terms of the Mozilla Public License | ||
* version 2.0 (the "License"). You can obtain a copy of the License at | ||
* http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
"use strict"; | ||
|
||
require("sdk/simple-storage").init.then(() => | ||
{ | ||
require("../../lib/masterPassword"); | ||
require("../../lib/passwords"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* This Source Code is subject to the terms of the Mozilla Public License | ||
* version 2.0 (the "License"). You can obtain a copy of the License at | ||
* http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
"use strict"; | ||
|
||
exports.emit = function(obj) | ||
{ | ||
obj.emit.apply(obj, [].slice.call(arguments, 1)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* This Source Code is subject to the terms of the Mozilla Public License | ||
* version 2.0 (the "License"). You can obtain a copy of the License at | ||
* http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
"use strict"; | ||
|
||
let proto = { | ||
on: function(eventName, listener) | ||
{ | ||
if (!(eventName in this._listeners)) | ||
this._listeners[eventName] = []; | ||
this._listeners[eventName].push(listener); | ||
}, | ||
|
||
off: function(eventName, listener) | ||
{ | ||
let index = (eventName in this._listeners ? this._listeners[eventName].indexOf(listener) : -1); | ||
if (index >= 0) | ||
this._listeners[eventName].splice(index, 1); | ||
}, | ||
|
||
once: function(eventName, listener) | ||
{ | ||
let wrapper = () => | ||
{ | ||
this.off(eventName, wrapper); | ||
listener.apply(this, arguments); | ||
}; | ||
this.on(eventName, wrapper); | ||
}, | ||
|
||
emit: function(eventName) | ||
{ | ||
let args = [].slice.call(arguments, 1); | ||
for (let listener of this._listeners[eventName] || []) | ||
listener.apply(null, args); | ||
} | ||
}; | ||
|
||
exports.EventTarget = function() | ||
{ | ||
let result = Object.create(proto); | ||
result._listeners = []; | ||
return result; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* This Source Code is subject to the terms of the Mozilla Public License | ||
* version 2.0 (the "License"). You can obtain a copy of the License at | ||
* http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
"use strict"; | ||
|
||
exports.Page = function(options) | ||
{ | ||
this.frame = document.createElement("iframe"); | ||
document.body.appendChild(this.frame); | ||
|
||
this.frame.src = options.contentURL; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* This Source Code is subject to the terms of the Mozilla Public License | ||
* version 2.0 (the "License"). You can obtain a copy of the License at | ||
* http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
"use strict"; | ||
|
||
/* global chrome */ | ||
|
||
exports.data = { | ||
url: function(path) | ||
{ | ||
return chrome.runtime.getURL("data/" + path); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* This Source Code is subject to the terms of the Mozilla Public License | ||
* version 2.0 (the "License"). You can obtain a copy of the License at | ||
* http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
"use strict"; | ||
|
||
exports.prefs = window.simpleStorage; | ||
|
||
exports.on = function(key, handler) | ||
{ | ||
window.addEventListener("storage", function(event) | ||
{ | ||
if (event.key == key) | ||
handler(); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* This Source Code is subject to the terms of the Mozilla Public License | ||
* version 2.0 (the "License"). You can obtain a copy of the License at | ||
* http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
"use strict"; | ||
|
||
/* global chrome */ | ||
|
||
exports.init = new Promise((resolve, reject) => | ||
{ | ||
chrome.storage.local.get("passwords", function(items) | ||
{ | ||
if (chrome.runtime.lastError) | ||
reject(chrome.runtime.lastError); | ||
else | ||
{ | ||
exports.storage = items.passwords; | ||
setTimeout(function() | ||
{ | ||
chrome.storage.local.set({passwords: exports.storage}); | ||
}, 30000); | ||
resolve(); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* This Source Code is subject to the terms of the Mozilla Public License | ||
* version 2.0 (the "License"). You can obtain a copy of the License at | ||
* http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
"use strict"; | ||
|
||
exports.setTimeout = window.setTimeout; | ||
exports.setInterval = window.setInterval; | ||
exports.clearTimeout = window.clearTimeout; |
Oops, something went wrong.