Skip to content

Commit

Permalink
Revert "Updated for manifest version 2"
Browse files Browse the repository at this point in the history
This reverts commit 0a6881a.
  • Loading branch information
Aaron Artille committed Apr 7, 2013
1 parent 0a6881a commit 0f92c72
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 51 deletions.
Binary file removed .DS_Store
Binary file not shown.
Empty file modified LICENSE 100755 → 100644
Empty file.
Empty file modified README.md 100755 → 100644
Empty file.
Binary file removed src/.DS_Store
Binary file not shown.
Empty file modified src/css/manage.css 100755 → 100644
Empty file.
3 changes: 3 additions & 0 deletions src/html/background.html
@@ -0,0 +1,3 @@
<html>
<script src="../js/background.js"></script>
</html>
Empty file modified src/html/manage.html 100755 → 100644
Empty file.
Empty file modified src/img/icon128.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/img/icon48.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/img/logo.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/js/.DS_Store
Binary file not shown.
Empty file modified src/js/background.js 100755 → 100644
Empty file.
23 changes: 7 additions & 16 deletions src/js/log.js 100755 → 100644
Expand Up @@ -55,30 +55,21 @@ function monitorKeystrokes() {
var passcode; // extension passcode
var progress = 0; // characters of passcode matched

// request passcode from local storage
chrome.storage.local.get('passcode', function(response) {
if (response.passcode) {
passcode = response.passcode.toUpperCase();
} else {
chrome.storage.local.set({'passcode': 'gselog'}, function() {
passcode = 'GSELOG';
});
}
});

chrome.storage.onChanged.addListener(function(changes, namespace) {
for (key in changes) {
if (key == 'passcode')
passcode = changes[key].newValue.toUpperCase();
}
// request passcode from localStorage
chrome.extension.sendRequest({action: 'getPasscode'}, function(response) {
passcode = response.toUpperCase();
});

window.addEventListener('keydown', function(event) {

// compare input with expected charCode
if (event.which == passcode.charCodeAt(progress)) {

if (progress == passcode.length - 1) {

// request to open the `manage` page
chrome.extension.sendRequest({action: 'openManage'});

} else {
progress++;
return true;
Expand Down
22 changes: 8 additions & 14 deletions src/js/manage.js 100755 → 100644
@@ -1,5 +1,4 @@
var timeout;
var passcode;

window.onload = function() {

Expand All @@ -15,24 +14,19 @@ window.onload = function() {
// confirm deletion
if (counter.innerHTML > 0 && confirm('Delete ' + counter.innerHTML +
' record(s)? Severely permanent, mind you.')) {

queryRecords('delete');
}
});

// get passcode
chrome.storage.local.get('passcode', function(response) {
console.log(response)
passcode = response.passcode
});

// change passcode
// change extension passcode
passcodeBtn.addEventListener('click', function() {
var p = prompt('Enter a passcode (minimum 4 characters):', passcode);
if (p && p.length >= 4) {
chrome.storage.local.set({'passcode': p}, function() {
passcode = p;
});
}

var p = prompt('Enter a passcode (minimum 4 characters):',
localStorage['passcode']);

if (p && p.length >= 4)
localStorage['passcode'] = p;
});

// toggle an extraordinarily shameless plug
Expand Down
37 changes: 16 additions & 21 deletions src/manifest.json 100755 → 100644
@@ -1,23 +1,18 @@
{
"manifest_version": 2,
"name": "Gumshoe",
"version": "2.1",
"description": "Discreetly records login data to local storage.",
"icons": {
"128": "img/icon128.png",
"48": "img/icon48.png"
},
"permissions": [
"tabs",
"storage"
],
"background": {
"scripts": ["js/background.js"]
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["js/log.js"]
}
]
"manifest_version": 2,
"name": "Gumshoe",
"version": "2.0",
"description": "Discreetly record global login data to local storage.",
"icons": {
"128": "img/icon128.png",
"48": "img/icon48.png"
},
"permissions": ["tabs"],
"background": "html/background.html",
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["js/log.js"]
}
]
}

0 comments on commit 0f92c72

Please sign in to comment.