Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/AlternativeDomain.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* File : AlternativeDomain.js
* Author : Christophe Liou Kee On
* Created on : 06/02/2010

License :

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand All @@ -17,9 +17,9 @@

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

Description :

AlternativeDomain allow to use an alternative domain as salt.
It can be set by the pwdhash button in Google Toolbar.
*
Expand All @@ -32,10 +32,10 @@

var AlternativeDomain = (function () {
var console = NullConsole;

var Self = function (get_default) {
var self = this;

this.setDomain = function (value) {
var domain = get_default();
var domains = {};
Expand Down Expand Up @@ -69,14 +69,14 @@ var AlternativeDomain = (function () {
}
return domain;
};
chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {

browser.runtime.onMessage.addListener(function(request, sender, sendResponse) {
if (request.controller != 'AlternativeDomain') return;

try {
if (request.action == "getDomain") {
sendResponse({domain: self.getDomain(), defaultDomain: get_default()});

} else if (request.action == "setDomain") {
self.setDomain(request.domain);
sendResponse({ok: true});
Expand All @@ -86,6 +86,6 @@ var AlternativeDomain = (function () {
}
});
};

return Self;
}) ();
26 changes: 13 additions & 13 deletions src/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* File : Settings.js
* Author : Christophe Liou Kee On
* Created on : 06/02/2010

License :

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
Expand All @@ -17,15 +17,15 @@

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

Description :
*
*/


var Settings = (function () {
var console = NullConsole;

var Self = function () {
this.store = function (k, v) {
console.log(k + ' <- ' + v);
Expand All @@ -37,17 +37,17 @@ var Settings = (function () {
return (JSON.parse(v));
return null;
};

var self = this;

this.listen = function (channel) {
chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
browser.runtime.onMessage.addListener(function(request, sender, sendResponse) {
if (request.controller != channel) return;

try {
if (request.action == "retrieve") {
sendResponse({ok: true, value: self.retrieve(request.key)});

} else if (request.action == "store") {
self.store(request.key, request.value);
sendResponse({ok: true});
Expand All @@ -59,10 +59,10 @@ var Settings = (function () {
});
};
}

Self.Remote = function (channel) {
this.retrieve = function (k, fn) {
chrome.extension.sendRequest({
browser.runtime.sendMessage({
controller: channel,
action: 'retrieve',
key: k
Expand All @@ -71,7 +71,7 @@ var Settings = (function () {
});
}
this.store = function (k, val, fn) {
chrome.extension.sendRequest({
browser.runtime.sendMessage({
controller: channel,
action: 'store',
key: k,
Expand All @@ -81,6 +81,6 @@ var Settings = (function () {
});
}
}

return Self;
}) ();
3 changes: 0 additions & 3 deletions src/background.html

This file was deleted.

34 changes: 20 additions & 14 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,54 @@ var settings = new Settings();
settings.listen('GlobalSettings');

if (settings.retrieve('hideIcon')) {
chrome.pageAction.hide();
browser.pageAction.hide();
}

var iconActionType = 'pageAction';

chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
browser.runtime.onMessage.addListener(function(request, sender, sendResponse) {
if (request.controller != 'Background_HTML') return;
try {
if (request.action == "setPwdHashIconOn") {
if (!settings.retrieve('hideIcon')) {
//chrome.tabs.getSelected(null, function(tab) {
chrome[iconActionType].setIcon({
//browser.tabs.getSelected(null, function(tab) {
browser.pageAction.setIcon({
tabId: sender.tab.id,
path: "images/icon19on.png"
});
browser.pageAction.setTitle({
tabId: sender.tab.id,
title: "Pwdhash is active"
});
//});
}
sendResponse({ok: true});

} else if (request.action == "setPwdHashIconOff") {
if (!settings.retrieve('hideIcon')) {
//chrome.tabs.getSelected(null, function(tab) {
chrome[iconActionType].setIcon({
//browser.tabs.getSelected(null, function(tab) {
browser.pageAction.setIcon({
tabId: sender.tab.id,
path: "images/icon19off.png"
});
browser.pageAction.setTitle({
tabId: sender.tab.id,
title: "Pwdhash is not active"
});
//});
}
sendResponse({ok: true});

} else if (request.action == "showPwdHashIcon") {
if (!settings.retrieve('hideIcon')) {
//chrome.tabs.getSelected(null, function(tab) {
chrome[iconActionType].show(sender.tab.id);
//browser.tabs.getSelected(null, function(tab) {
browser.pageAction.show(sender.tab.id);
//});
}
sendResponse({ok: true});
}


} catch (e) {
sendResponse({ok: false});
console.log(e);
}
});
});
4 changes: 4 additions & 0 deletions src/jquery-3.2.1.min.js

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions src/jquery.js

This file was deleted.

20 changes: 12 additions & 8 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "PwdHash port beta",
"version": "0.4.3.6",
"name": "PwdHash",
"version": "0.4.4",
"manifest_version": 2,
"description": "Pwdhash 1.7 for Chrome. Automatically generates per-site passwords if you prefix your password with @@ or F2.",
"description": "Pwdhash 0.8. Automatically generates per-site passwords if you prefix your password with @@",
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
Expand All @@ -15,23 +15,27 @@
"stanford-pwdhash/chrome/content/stanford-pwdhash.js",
"null.js",
"AlternativeDomain.js",
"jquery.js",
"jquery-3.2.1.min.js",
"KeyHooker.js",
"Settings.js",
"pwdhash-chrome-port.js"
]
}
],
"options_page": "options.html",
"background": {"page": "background.html"},
"options_ui": {
"page": "options.html",
"browser_style": true
},
"background": {
"scripts": ["null.js", "Settings.js", "background.js"]
},
"icons": {
"48": "images/icon48.png",
"128": "images/icon128.png"
},
"permissions": ["tabs"],
"page_action": {
"default_icon": "images/icon19off.png",
"default_title": "PwdHash",
"default_popup": "popup.html"
"default_title": "PwdHash"
}
}
37 changes: 17 additions & 20 deletions src/options.html
Original file line number Diff line number Diff line change
@@ -1,39 +1,36 @@
<html>
<head>
<meta charset="utf-8">
<title>PwdHash Extension Options</title>
<link rel="stylesheet" type="text/css" href="options.css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="null.js"></script>
<script type="text/javascript" src="Settings.js"></script>
<script type="text/javascript" src="options.js"></script>
</head>
<body>

<img src="images/icon128.png" />
<h1>PwdHash Chrome Extension</h1>
<form>
<div>
<input type="checkbox" id="hideIcon" class="setting" />
<label for="hideIcon">Hide icon in browser url bar</label>
</div>

<!--
<script type="text/javascript" src="jquery.js"></script>
-->
<div>
<input type="checkbox" id="alertPwd" class="setting" />
<label for="alertPwd">Prompt a dialog box containing password and its hash</label>
</div>

<p><input type="checkbox" id="hideIcon" class="setting" />
<label for="hideIcon">Hide icon in Chrome's page action toolbar</label></p>
<div>
<input type="checkbox" id="noIntercept" class="setting" />
<label for="noIntercept">Disable keyboard security (Prevent website from catching your master password by intercept keyboard events) </label>
</div>

<p><input type="checkbox" id="alertPwd" class="setting" />
<label for="alertPwd">Prompt password and hashed</label>
</p>
<p>
Prompt a dialog box containing password and its hashed.
</p>
</form>

<p><input type="checkbox" id="noIntercept" class="setting" />
<label for="noIntercept">Disable keyboard security</label></p>
<p>
Prevent website from catching your master password by intercept keyboard events.
</p>
<!--
<br /><a href="http://infocris.nuxit.net/pwdhash/test_keyboard.html">Test keyboard interception shield</a>
-->

</body>
</html>
</html>
8 changes: 4 additions & 4 deletions src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ var $P = function (id) {
this.val = function (a1) {
if (a1 == undefined) {
if (e.type == 'checkbox')
return e.checked;
else return e.value;
return e.checked;
else return e.value;
}
if (e.type == 'checkbox') {
e.checked = a1;
}
else e.value = a1;

return o;
};
})(document.getElementById(id));
Expand All @@ -42,4 +42,4 @@ $('.setting').each(function () {
});
});

});
});
Loading