clients icon indicating copy to clipboard operation
clients copied to clipboard

[PS-817] Add Generate Password Shortcut to MV3

Open justindbaur opened this issue 1 year ago • 0 comments

Type of change

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

Objective

Add ability to generate a password with Ctrl+Shift+9 (by default) and have the password get cleared from the clipboard based on the users setting. This also fixes the autofill that was broken at some point. In addition it also takes advantage of the service factories.

Code changes

  • apps/browser/src/background.ts: Add alarms listener.
  • apps/browser/src/globals.d.ts: Add types for Opera stuff
  • apps/browser/src/content/miscUtils.ts: Add helper content script for copying text to the clipboard.
  • apps/browser/src/listeners/onCommandListener.ts: Add in a handler for generating and copying password.
  • apps/browser/src/services/browserPlatformUtils.service.ts: Change various checks to be MV3 safe since window is unreferencable. Also remove unnecessary any casts.
  • apps/browser/src/manifest.v3.json: Add reference to new content script.
  • libs/common/src/abstractions/passwordGeneration.service.ts: Add types for password generation options.

Screenshots

Before you submit

  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

justindbaur avatar Sep 21 '22 15:09 justindbaur