Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove specific keyboard shortcut logic #2148

Closed
wants to merge 4 commits into from

Conversation

djsmith85
Copy link
Contributor

@djsmith85 djsmith85 commented Oct 28, 2021

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

While Oscar reviewed the PR #2132 he had the following comment #2132 (comment)

Looking into the shortcut.ts I realized that, although built for Safari and Vivaldi the code to check for the message 'keyboardShortcutTriggered' would only apply to Vivaldi.

While discussing this further with Oscar via Slack, we found the changes that removed the check for Safari (PR #1491).

At the time I tested the keyboard shortcuts on Vivaldi while Oscar tested on Safari. Conclusion even when removing all logic for the shortcuts in shortcut.ts the keyboard shortcuts would still work as expected.

Through PR #1491 the check for isSafari was removed from commands.background.ts
Also with this PR the __bitwardenFrameId was removed all other places but not from shortcut.ts

Other interesting PR's:

Code changes

  • src/background/commands.background.ts: Removed code and check for command 'keyboardShortcutTriggered'
  • src/content/shortcut.ts: Deleted shortcut.ts
  • manifest.json: Removed loading of shortcut.js
  • webpack.config.js: Removed inclusion of shortcut.ts
  • gulpfile.js: Removed function to remove shortcut.js from certain distributions
  • package.json: Removed dependency on mousetrap and @types/mousetrap
  • package-lock.json: Removed dependency on mousetrap and @types/mousetrap

Testing requirements

The following keyboard shortcuts should still work under Safari and Vivaldi (there seems to be an upstream issue, where keyboard shortcuts will only work when set to Global instead of "In Vivaldi" (chrome://extensions/shortcuts) )
Ctrl/CMD + Shift + Y → Activate extension
Ctrl/CMD + Shift + L → Autofill, press again to cycle through matching logins
Ctrl/CMD + Shift + 9 → Generate a password and copy it to the clipboard

Ctrl/CMD + Shift + N → Lock extension

  • Does not get configured at all, present bug!
  • Need to do some further research
    • manifest.json only allows a max of 4 suggested_key attributes, but because _execute_sidebar_action which is only supported in FF we can't have another entry for lock vault.
    • Ctrl+Shift+N will not work on Firefox as it is a built-in shortcut
    • For the dist builds this would be removable via the gulpfile
    • Currently unable to remove it for npm run build as that just builds without modifying the manifest.json
      • We would need to add flags to the build-command for each browser, change in dev-flow!

Before you submit

  • I have checked for linting errors (npm run lint) (required)
  • This change requires a documentation update (notify the documentation team)
  • This change has particular deployment requirements (notify the DevOps team)

@djsmith85
Copy link
Contributor Author

Closing this in favour of #3173

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.

1 participant