Skip to content

Commit

Permalink
Fix bug where we broke autofill
Browse files Browse the repository at this point in the history
  • Loading branch information
subdavis committed Jan 6, 2018
1 parent 8c325bf commit f15b46b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 35 deletions.
6 changes: 2 additions & 4 deletions background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ function Background(protectedMemory, settings) {
m: "fillPassword",
u: message.u,
p: message.p,
o: message.o,
uca: message.uca
o: message.o
});
return;
}
Expand All @@ -103,8 +102,7 @@ function Background(protectedMemory, settings) {
m: "fillPassword",
u: message.u,
p: message.p,
o: message.o,
uca: message.uca
o: message.o
});
});
})
Expand Down
11 changes: 0 additions & 11 deletions background/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,6 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {

//passed the origin check - go ahead and fill the password
filler.fillPassword(message.u, message.p);

if (message.uca && navigator.credentials) {
// try to tell Chrome to remember the password
let credential = new PasswordCredential({
'id': message.u,
'password': message.p
})
navigator.credentials.store(credential).then( results => {
console.log(results);
});
}
}

function parseUrl(url) {
Expand Down
2 changes: 1 addition & 1 deletion chrome.manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "KeePass Tusk - A better password manager",
"short_name": "KeePass Tusk",
"version": "2018.1.5",
"version": "2018.1.6",
"manifest_version": 2,
"minimum_chrome_version": "48",
"description": "Readonly KeePass password database integration for Chrome™",
Expand Down
2 changes: 1 addition & 1 deletion firefox.manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "KeePass Tusk - A better password manager",
"short_name": "KeePass Tusk",
"version": "2018.1.5",
"version": "2018.1.6",
"manifest_version": 2,
"minimum_chrome_version": "48",
"description": "Readonly KeePass password database integration for Chrome™",
Expand Down
4 changes: 3 additions & 1 deletion services/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ function Settings(secureCache) {
//upgrade old settings. Called on install.
exports.upgrade = function() {
// Patch https://subdavis.com/blog/jekyll/update/2017/01/02/ckp-security-flaw.html
chrome.storage.local.clear()
// chrome.storage.local.clear()

// That's been done now. Nothing to see here....
}

exports.getKeyFiles = function() {
Expand Down
31 changes: 14 additions & 17 deletions services/unlockedState.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,21 @@ function UnlockedState($router, keepassReference, protectedMemory, settings) {
setTimeout(my.clearClipboardState, 60000); //clear backgroundstate after 1 minutes live - we should never be alive that long

my.autofill = function(entry) {
settings.getUseCredentialApiFlag().then(useCredentialApi => {
chrome.runtime.sendMessage({
m: "requestPermission",
perms: {
origins: [my.origin]
},
then: {
m: "autofill",
tabId: my.tabId,
u: entry.userName,
p: getPassword(entry),
o: my.origin,
uca: useCredentialApi
}
});
chrome.runtime.sendMessage({
m: "requestPermission",
perms: {
origins: [my.origin]
},
then: {
m: "autofill",
tabId: my.tabId,
u: entry.userName,
p: getPassword(entry),
o: my.origin
}
});

// window.close(); //close the popup
})
window.close(); //close the popup
}

//get clear-text password from entry
Expand Down

0 comments on commit f15b46b

Please sign in to comment.