1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

refactor autofill. add auto-fill on page load

This commit is contained in:
Kyle Spearrin
2017-08-28 13:00:46 -04:00
parent c40465f292
commit ad544e5240
12 changed files with 225 additions and 111 deletions

View File

@@ -962,9 +962,9 @@
var pageDetailsObj = JSON.parse(pageDetails);
chrome.runtime.sendMessage({
command: 'collectPageDetailsResponse',
tabId: msg.tabId,
tab: msg.tab,
details: pageDetailsObj,
contentScript: msg.contentScript ? true : false
sender: msg.sender
});
sendResponse();
return true;

15
src/content/autofiller.js Normal file
View File

@@ -0,0 +1,15 @@
document.addEventListener('DOMContentLoaded', function (event) {
chrome.storage.local.get('enableAutoFillOnPageLoad', function (obj) {
if (obj && obj.enableAutoFillOnPageLoad === true) {
setTimeout(fill, 500);
window.addEventListener('popstate', fill);
}
});
function fill() {
chrome.runtime.sendMessage({
command: 'bgCollectPageDetails',
sender: 'autofiller'
});
}
});

View File

@@ -36,7 +36,8 @@
chrome.storage.local.get('disableAddLoginNotification', function (obj) {
if (!obj || !obj.disableAddLoginNotification) {
chrome.runtime.sendMessage({
command: 'bgCollectPageDetails'
command: 'bgCollectPageDetails',
sender: 'notificationBar'
});
}
});