clients icon indicating copy to clipboard operation
clients copied to clipboard

[PM-6122] Rework `window` call within NotificationBackground to function within content script

Open cagonzalezcs opened this issue 1 year ago • 2 comments

Type of change

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

Objective

The objective of this PR is to remove usage of the window object from the NotificationBackground class to ensure the feature is usable within manifest v3. This work should not affect the behavior of the notification bar in any significant manner, and feature parity should remain in place for manifest v2.

Code changes

  • apps/browser/src/autofill/background/notification.background.ts: Removing usage of window.matchMedia within this background service class and instead just passing down the theme from the StateService class.
  • apps/browser/src/autofill/notification/bar.ts: Handling logic with the passed theme to ensure that we correctly identify a user's desired theme based on their system settings.

cagonzalezcs avatar Feb 06 '24 21:02 cagonzalezcs

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 25.05%. Comparing base (d0e9978) to head (06d2b73).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7828   +/-   ##
=======================================
  Coverage   25.05%   25.05%           
=======================================
  Files        2246     2246           
  Lines       65773    65773           
  Branches    12404    12404           
=======================================
  Hits        16481    16481           
  Misses      47952    47952           
  Partials     1340     1340           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 06 '24 21:02 codecov[bot]

Logo Checkmarx One – Scan Summary & Details99fb129d-253c-4bd8-80f0-67cf1e34e91a

No New Or Fixed Issues Found

bitwarden-bot avatar Feb 07 '24 10:02 bitwarden-bot

The "changes" introduced in this ticket appear to have been implemented in https://github.com/bitwarden/clients/pull/7737. As a result, this PR is no longer required and can be closed.

cagonzalezcs avatar Mar 04 '24 22:03 cagonzalezcs