Skip to content

feat(pass-extension): add autofill keyboard shortcut command#481

Open
yuribodo wants to merge 3343 commits into
ProtonMail:mainfrom
yuribodo:feat/autofill-keyboard-shortcut
Open

feat(pass-extension): add autofill keyboard shortcut command#481
yuribodo wants to merge 3343 commits into
ProtonMail:mainfrom
yuribodo:feat/autofill-keyboard-shortcut

Conversation

@yuribodo
Copy link
Copy Markdown

@yuribodo yuribodo commented Mar 29, 2026

Summary

Adds a keyboard shortcut to trigger autofill in the Proton Pass browser extension, as discussed and approved in #453.

  • Registers a new autofill command in Chrome and Firefox manifests with Ctrl+Shift+U as the default shortcut
  • Handles the command in the background script by sending an AUTOFILL_TRIGGER message to the active tab's content script
  • Content script finds the first detected login field and opens the autofill dropdown, reusing the existing inline dropdown flow

Closes #453

Changes

File Change
manifest-chrome.json Added "autofill" command entry
manifest-firefox.json Added "autofill" command entry
src/types/messages.ts Added AUTOFILL_TRIGGER to WorkerMessageType enum
src/lib/extension/commands.ts Added async handler for the "autofill" command
src/lib/extension/commands.spec.ts Added 4 unit tests for command handling
src/app/content/services/autofill/autofill.service.ts Registered AUTOFILL_TRIGGER handler using withContext pattern

How it works

  1. User presses Ctrl+Shift+U
  2. browser.commands.onCommand fires in the background script
  3. Background queries the active tab and sends AUTOFILL_TRIGGER via browser.tabs.sendMessage
  4. Content script's FrameMessageBroker receives the message
  5. Handler finds the first field with DropdownAction.AUTOFILL_LOGIN via formManager.getFields()
  6. Opens the autofill dropdown on that field using inline.dropdown.toggle()
  7. User selects credentials → normal autofill flow proceeds

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+X for popup, Ctrl+Shift+L for larger window). The industry standard for autofill is Ctrl+Shift+L (used by Bitwarden and LastPass). If the team is open to it, reassigning Ctrl+Shift+L from open-larger-window to autofill in 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.commands API. The command listener is already gated by BUILD_TARGET !== 'safari' in worker/index.ts.

Test plan

  • Unit tests for handleExtensionCommand (4 tests passing):
    • Opens larger window for open-larger-window command
    • Sends AUTOFILL_TRIGGER to active tab for autofill command
    • Does not send message when no active tab is found
    • Does nothing for unknown commands
  • Manual: press Ctrl+Shift+U on a login page → dropdown opens on first login field
  • Manual: press Ctrl+Shift+U on a page with no login form → nothing happens
  • Manual: verify Ctrl+Shift+X and Ctrl+Shift+L still work as before
  • Manual: verify new shortcut appears in Settings → Shortcuts

ElectroNafta and others added 30 commits March 24, 2026 10:45
fix(INDA-662): Fix mailto URL encoding on INDA side

See merge request web/clients!23585
…'main'

Guard against undefined 'Plans' in spring sale offer eligibility

See merge request web/clients!23586
Rename 'accepted' state to 'user joined' for external invitation (sharing modal)

See merge request web/clients!23583
Support shortcuts to open Pass popup and large window on Chrome & Firefox (not work on Safari)

See merge request web/clients!23488
Pass feature flags to the SDK and support payloads with body

See merge request web/clients!23591
…d-in-dashboard' into 'main'

Auto select OS tab for client download in dashboard

See merge request web/clients!22229
fix(INDA-412): Resolve issue with close ticket button in account

See merge request web/clients!23588
[DRVWEB-5253] Hidden the checkboxes in devices DriveExplorer

See merge request web/clients!23599
Add eligibility for feedback first cancellation

See merge request web/clients!23546
Fix: display billing address error message on account lite and spring sale offers

See merge request web/clients!23598
VPNPLG-39: Fix wrong placeholder for TV input

See merge request web/clients!23581
Fix: clarify trial dates on dashboard

See merge request web/clients!23602
… into 'main'

[VPNB2B-25] Allow SettingsListItem to and icon props to be optional and render accordingly

See merge request web/clients!23584
"larger window" opens in a new tab instead of a new window

See merge request web/clients!23597
[DRVWEB-4916] Fix album icon in sharing modal

See merge request web/clients!23601
flavienbonvin and others added 22 commits March 27, 2026 14:12
Co-authored-by: Nico Hoffmann <nicolas.hoffmann@proton.ch>
Add spotlight on app dropdown for the release of Meet and Booking

See merge request web/clients!23703
[DRVWEB-4973] Photos timeline with sdk

See merge request web/clients!23455
[DRVWEB-5167] folders section cleanup + DriveExplorer

See merge request web/clients!23415
DRVWEB: Search unit test suites + first integration tests for worker  (mock-free,  fakes and stub inside)

See merge request web/clients!23668
Docs update loading screen

See merge request web/clients!23717
Update all non-major dependencies

See merge request web/clients!23682
Meet mobile downloads section FF

See merge request web/clients!23730
@nguyenkims
Copy link
Copy Markdown
Collaborator

Hi thanks for the MR, from what I understand, it simply opens the dropdown? Currently it already opens when the username/password field is in focus, which is the default behavior for most websites.

@yuribodo
Copy link
Copy Markdown
Author

Hi thanks for the MR, from what I understand, it simply opens the dropdown? Currently it already opens when the username/password field is in focus, which is the default behavior for most websites.

Hi @nguyenkims , that's correct it opens the dropdown rather than firing autofill directly

The difference from the default focus behavior is that this works keyboard-only, without the user having to click or tab into a field first. That's the main use case: power users who want to fill credentials without touching the mouse at all.

The feature request in #453 has quite a bit of community interest, which is what motivated this contribution. Happy to discuss scope or adjust the approach if you have a different direction in mind!

@nguyenkims
Copy link
Copy Markdown
Collaborator

Thanks, but once the dropdown is shown, users still need to use the mouse to select a login. For a keyboard-centric experience, it'd be nice to let users navigate with the up/down arrow keys.

@mmso mmso force-pushed the main branch 5 times, most recently from 115579e to b6fd253 Compare June 3, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proton Pass Web Extension - Autofill keyboard shortcut contribution