Skip to content

Commit

Permalink
added ability to modify domain and removed click event
Browse files Browse the repository at this point in the history
  • Loading branch information
adm244 committed Jun 20, 2016
1 parent 3a419f5 commit d421efb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Expand Up @@ -3,7 +3,7 @@

"name": "Hashpass",
"description": "A simple, stateless password manager for Chrome.",
"version": "1.9.4",
"version": "1.9.5",
"permissions": [
"activeTab"
],
Expand Down
3 changes: 2 additions & 1 deletion popup.html
Expand Up @@ -65,7 +65,8 @@
<script type="text/javascript" src="popup.js"></script>
</head>
<body>
<p>Domain: <strong><span id="domain"></span></strong></p>
<p class="small-bottom-margin">Domain:</p>
<input id="domain" class="small-top-margin" type="text" />
<p class="small-bottom-margin">Key:</p>
<input id="key" class="small-top-margin" type="password" />
<p class="small-bottom-margin">Hash:</p>
Expand Down
9 changes: 6 additions & 3 deletions popup.js
Expand Up @@ -24,7 +24,8 @@ $(function() {
currentWindow: true
}, function(tabs) {
var showError = function(err) {
$('#domain').text('N/A');
$('#domain').val('N/A').addClass('disabled');
$('#domain').prop('disabled', true);
$('#key').prop('disabled', true);
$('#hash').prop('disabled', true);
$('p:not(#message)').addClass('disabled');
Expand All @@ -49,7 +50,7 @@ $(function() {
// Technical reason: Chrome prevents content scripts from running in the app gallery.
return showError('Try Hashpass on another domain.');
}
$('#domain').text(domain);
$('#domain').val(domain);

// Run the content script to register the message handler.
chrome.tabs.executeScript(tabs[0].id, {
Expand All @@ -72,6 +73,7 @@ $(function() {
var update = function() {
// Compute the first 16 base64 characters of iterated-SHA-256(domain + '/' + key, 2 ^ difficulty).
var key = $('#key').val();
domain = $('#domain').val();

var rounds = Math.pow(2, difficulty);
var bits = domain + '/' + key;
Expand Down Expand Up @@ -119,7 +121,8 @@ $(function() {

if (!passwordMode) {
// Register the update handler.
$('#key').bind('propertychange change click keyup input paste', debouncedUpdate);
$('#domain').bind('propertychange change keyup input paste', debouncedUpdate);
$('#key').bind('propertychange change keyup input paste', debouncedUpdate);
}

// Update the hash right away.
Expand Down

0 comments on commit d421efb

Please sign in to comment.