clients/apps/browser/src/background
Daniel James Smith ec19fc7225
[PS-2072] Browser Badge fixes (#4363)
* Force update of badge icon and text on all windows

Affects MV2 and MV3
No longer pass in tab and windowId to setLoggedOut and setLocked

When the vault is locked or the user logs out, all open windows/tabs need to be updated

Iterating over all active tabs like in 2022.10.1 was missing:

488734577f/apps/browser/src/background/main.background.ts (L859-L867)

Create clearBadgeText function to take care of it.

* Only try to retrieve tab in unlocked state

* Remove lock icon when unlocking on all windows

* Only use windowId to retrieve tab when defined

In MV2 the `windowId` isn't passed into updateBage and fails to retrieve the correct tab to update.

This resorted in the badge not showing a match count in another window.

Fixes #4260

Ensure in MV3 that all listener pass on the windowId if present.

* Fix Firefox private mode

Only pass on the windowId if defined and within Firefox

In private mode the main.background bootstrap-method passes in the windowId

Do not refreshBadge when in private mode

Previously 488734577f/apps/browser/src/background/main.background.ts (L575-L586) setIcon would skip in private mode. Calling refreshBadge without this would update the badge on all windows (normal and private ones)
2023-01-03 18:06:21 +01:00
..
models [EC-183] Mono Repository - Browser (#2531) 2022-05-03 19:38:55 +02:00
service_factories Revert "[EC-772] Add i18n key typechecking in web (#4023)" (#4296) 2022-12-21 17:46:23 -05:00
commands.background.ts [EC-377] Transition Policy service into providing observables (#3259) 2022-10-11 13:08:48 +01:00
contextMenus.background.ts [PS-1906] Extract uploadEvents from EventService into new service (#4108) 2022-12-06 14:47:42 +01:00
idle.background.ts [PS-1854] Split services between background and visualizations (#4075) 2022-11-23 16:26:57 -06:00
main.background.ts [PS-2072] Browser Badge fixes (#4363) 2023-01-03 18:06:21 +01:00
nativeMessaging.background.ts [SM-288] Rename models to follow naming convention (#3795) 2022-10-14 18:25:50 +02:00
notification.background.ts [PS-1854] Split services between background and visualizations (#4075) 2022-11-23 16:26:57 -06:00
runtime.background.ts [SG-58] Avatar color selector (#3691) 2023-01-01 10:30:09 -05:00
tabs.background.ts Ps 1291 fix extension icon updates (#3571) 2022-10-19 08:55:57 -05:00
webRequest.background.ts Ps 1291 fix extension icon updates (#3571) 2022-10-19 08:55:57 -05:00