From ee6fb78583ada4d4ed2ae4848f691ec6048e822f Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 31 Aug 2017 12:42:09 -0400 Subject: [PATCH] autofill command, adjust default commands --- src/background.js | 13 ++++++++++++- src/manifest.json | 11 +++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/background.js b/src/background.js index 2fa2479264..bee3368a6e 100644 --- a/src/background.js +++ b/src/background.js @@ -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 }]); diff --git a/src/manifest.json b/src/manifest.json index eab60613cd..da9fde7f32 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -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" } } },