1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-23 11:43:46 +00:00

[PS-102] BEEEP: Tab-change performance improvements (#2447)

* Remove passing in main to notification as it's unused

* Remove messages nothing reacts to

* Shorten re-draw of badge and menu on logout

* Remove windows.background and only listen to changes of tabs on focused window

* Only rreact to tab changes of current active tab

* Comments and console-logs

* Removed comments and console.logs

* Updated package-lock.json

* Check if chrome.windows is available

* Simplify check for active tab
This commit is contained in:
Daniel James Smith
2022-04-11 12:00:07 +02:00
committed by GitHub
parent f614ed877c
commit 29402f3109
5 changed files with 24 additions and 38 deletions

View File

@@ -95,7 +95,6 @@ import NotificationBackground from "./notification.background";
import RuntimeBackground from "./runtime.background";
import TabsBackground from "./tabs.background";
import WebRequestBackground from "./webRequest.background";
import WindowsBackground from "./windows.background";
export default class MainBackground {
messagingService: MessagingServiceAbstraction;
@@ -151,7 +150,6 @@ export default class MainBackground {
private runtimeBackground: RuntimeBackground;
private tabsBackground: TabsBackground;
private webRequestBackground: WebRequestBackground;
private windowsBackground: WindowsBackground;
private sidebarAction: any;
private buildingContextMenu: boolean;
@@ -422,7 +420,6 @@ export default class MainBackground {
this.vaultTimeoutService
);
this.notificationBackground = new NotificationBackground(
this,
this.autofillService,
this.cipherService,
this.vaultTimeoutService,
@@ -451,7 +448,6 @@ export default class MainBackground {
this.cipherService,
this.vaultTimeoutService
);
this.windowsBackground = new WindowsBackground(this);
this.twoFactorService = new TwoFactorService(this.i18nService, this.platformUtilsService);
@@ -502,7 +498,6 @@ export default class MainBackground {
await this.contextMenusBackground.init();
await this.idleBackground.init();
await this.webRequestBackground.init();
await this.windowsBackground.init();
if (this.platformUtilsService.isFirefox() && !this.isPrivateMode) {
// Set Private Mode windows to the default icon - they do not share state with the background page
@@ -599,7 +594,7 @@ export default class MainBackground {
}
await this.setIcon();
await this.refreshBadgeAndMenu();
await this.refreshBadgeAndMenu(true);
await this.reseedStorage();
this.notificationsService.updateConnection(false);
await this.systemService.clearPendingClipboard();