mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 06:43:35 +00:00
* 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 Previously488734577f/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)