autofill command, adjust default commands

This commit is contained in:
Kyle Spearrin 2017-08-31 12:42:09 -04:00
parent 60b8c1aec3
commit ee6fb78583
2 changed files with 21 additions and 3 deletions

View File

@ -31,6 +31,17 @@ if (chrome.commands) {
bg_utilsService.copyToClipboard(password);
});
}
else if (command === 'autofill_login') {
chrome.tabs.query({ active: true }, function (tabs) {
if (tabs.length) {
ga('send', {
hitType: 'event',
eventAction: 'Autofilled From Command'
});
collectPageDetailsForContentScript(tabs[0], 'autofill_cmd');
}
});
}
});
}
@ -82,7 +93,7 @@ chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
var forms = bg_autofillService.getFormsWithPasswordFields(msg.details);
messageTab(msg.tab.id, 'pageDetails', { details: msg.details, forms: forms });
}
else if (msg.sender === 'autofiller') {
else if (msg.sender === 'autofiller' || msg.sender === 'autofill_cmd') {
bg_autofillService.doAutoFillForLastUsedLogin([{
frameId: sender.frameId, tab: msg.tab, details: msg.details
}]);

View File

@ -75,15 +75,22 @@
"https://*/*"
],
"commands": {
"autofill_login": {
"suggested_key": {
"default": "Ctrl+Shift+L"
},
"description": "Auto-fill the last used login for the current website."
},
"generate_password": {
"suggested_key": {
"default": "Ctrl+Shift+O"
"default": "Ctrl+Shift+Period"
},
"description": "Generate and copy a new random password to the clipboard."
},
"_execute_browser_action": {
"suggested_key": {
"default": "Ctrl+Shift+Y"
"default": "Ctrl+Shift+Y",
"linux": "Ctrl+Shift+U"
}
}
},