1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-02 13:23:29 +01:00
bitwarden-browser/src/background/windows.background.ts
Kyle Spearrin b7c2c76230
finish autofill from view, other misc cleanup (#1368)
* finish autofill from view, other misc cleanup

* compare hostnames for authResult
2020-08-24 10:17:15 -04:00

26 lines
652 B
TypeScript

import MainBackground from './main.background';
export default class WindowsBackground {
private windows: any;
constructor(private main: MainBackground) {
this.windows = chrome.windows;
}
async init() {
if (!this.windows) {
return;
}
this.windows.onFocusChanged.addListener(async (windowId: any) => {
if (windowId === null || windowId < 0) {
return;
}
await this.main.refreshBadgeAndMenu();
this.main.messagingService.send('windowFocused');
this.main.messagingService.send('windowChanged');
});
}
}