feat(pass-extension): add autofill keyboard shortcut command#481
Open
yuribodo wants to merge 5 commits intoProtonMail:mainfrom
Open
feat(pass-extension): add autofill keyboard shortcut command#481yuribodo wants to merge 5 commits intoProtonMail:mainfrom
yuribodo wants to merge 5 commits intoProtonMail:mainfrom
Conversation
…nd handle tab id 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a keyboard shortcut to trigger autofill in the Proton Pass browser extension, as discussed and approved in #453.
autofillcommand in Chrome and Firefox manifests withCtrl+Shift+Uas the default shortcutAUTOFILL_TRIGGERmessage to the active tab's content scriptCloses #453
Changes
manifest-chrome.json"autofill"command entrymanifest-firefox.json"autofill"command entrysrc/types/messages.tsAUTOFILL_TRIGGERtoWorkerMessageTypeenumsrc/lib/extension/commands.ts"autofill"commandsrc/lib/extension/commands.spec.tssrc/app/content/services/autofill/autofill.service.tsAUTOFILL_TRIGGERhandler usingwithContextpatternHow it works
Ctrl+Shift+Ubrowser.commands.onCommandfires in the background scriptAUTOFILL_TRIGGERviabrowser.tabs.sendMessageFrameMessageBrokerreceives the messageDropdownAction.AUTOFILL_LOGINviaformManager.getFields()inline.dropdown.toggle()If no login field is detected on the page, the shortcut is a no-op.
Design decisions
Default shortcut
Ctrl+Shift+U: Chosen to avoid conflicts with existing commands (Ctrl+Shift+Xfor popup,Ctrl+Shift+Lfor larger window). The industry standard for autofill isCtrl+Shift+L(used by Bitwarden and LastPass). If the team is open to it, reassigningCtrl+Shift+Lfromopen-larger-windowtoautofillin a follow-up would align with user expectations from competing password managers.Dropdown approach (not direct autofill): Opens the dropdown instead of auto-filling the top match. This is safer, gives the user control when multiple credentials match, and reuses the existing dropdown infrastructure with minimal new code.
Safari excluded: Safari does not support the
browser.commandsAPI. The command listener is already gated byBUILD_TARGET !== 'safari'inworker/index.ts.Test plan
handleExtensionCommand(4 tests passing):open-larger-windowcommandAUTOFILL_TRIGGERto active tab forautofillcommandCtrl+Shift+Uon a login page → dropdown opens on first login fieldCtrl+Shift+Uon a page with no login form → nothing happensCtrl+Shift+XandCtrl+Shift+Lstill work as before