mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-01 23:01:28 +01:00
[PM-669] Right Click Autofill List Contains Incorrect Entries (#5711)
This commit is contained in:
parent
eca060d7e6
commit
a7cce1a3ad
@ -21,6 +21,8 @@ export default class TabsBackground {
|
||||
}
|
||||
|
||||
this.focusedWindowId = windowId;
|
||||
await this.main.refreshBadge();
|
||||
await this.main.refreshMenu();
|
||||
this.main.messagingService.send("windowChanged");
|
||||
});
|
||||
|
||||
|
@ -81,6 +81,12 @@ export class CipherContextMenuHandler {
|
||||
);
|
||||
}
|
||||
|
||||
static async windowsOnFocusChangedListener(windowId: number, serviceCache: CachedServices) {
|
||||
const cipherContextMenuHandler = await CipherContextMenuHandler.create(serviceCache);
|
||||
const tab = await BrowserApi.getTabFromCurrentWindow();
|
||||
await cipherContextMenuHandler.update(tab?.url);
|
||||
}
|
||||
|
||||
static async tabsOnActivatedListener(
|
||||
activeInfo: chrome.tabs.TabActiveInfo,
|
||||
serviceCache: CachedServices
|
||||
|
@ -8,6 +8,7 @@ import {
|
||||
onCommandListener,
|
||||
onInstallListener,
|
||||
runtimeMessageListener,
|
||||
windowsOnFocusChangedListener,
|
||||
tabsOnActivatedListener,
|
||||
tabsOnReplacedListener,
|
||||
tabsOnUpdatedListener,
|
||||
@ -18,6 +19,7 @@ if (BrowserApi.manifestVersion === 3) {
|
||||
chrome.runtime.onInstalled.addListener(onInstallListener);
|
||||
chrome.alarms.onAlarm.addListener(onAlarmListener);
|
||||
registerAlarms();
|
||||
chrome.windows.onFocusChanged.addListener(windowsOnFocusChangedListener);
|
||||
chrome.tabs.onActivated.addListener(tabsOnActivatedListener);
|
||||
chrome.tabs.onReplaced.addListener(tabsOnReplacedListener);
|
||||
chrome.tabs.onUpdated.addListener(tabsOnUpdatedListener);
|
||||
|
@ -6,6 +6,11 @@ import { onCommandListener } from "./on-command-listener";
|
||||
import { onInstallListener } from "./on-install-listener";
|
||||
import { UpdateBadge } from "./update-badge";
|
||||
|
||||
const windowsOnFocusChangedListener = combine([
|
||||
UpdateBadge.windowsOnFocusChangedListener,
|
||||
CipherContextMenuHandler.windowsOnFocusChangedListener,
|
||||
]);
|
||||
|
||||
const tabsOnActivatedListener = combine([
|
||||
UpdateBadge.tabsOnActivatedListener,
|
||||
CipherContextMenuHandler.tabsOnActivatedListener,
|
||||
@ -33,6 +38,7 @@ const runtimeMessageListener = combine<
|
||||
]);
|
||||
|
||||
export {
|
||||
windowsOnFocusChangedListener,
|
||||
tabsOnActivatedListener,
|
||||
tabsOnReplacedListener,
|
||||
tabsOnUpdatedListener,
|
||||
|
@ -42,6 +42,13 @@ export class UpdateBadge {
|
||||
"deletedCipher",
|
||||
];
|
||||
|
||||
static async windowsOnFocusChangedListener(
|
||||
windowId: number,
|
||||
serviceCache: Record<string, unknown>
|
||||
) {
|
||||
await new UpdateBadge(self).run({ windowId, existingServices: serviceCache });
|
||||
}
|
||||
|
||||
static async tabsOnActivatedListener(
|
||||
activeInfo: chrome.tabs.TabActiveInfo,
|
||||
serviceCache: Record<string, unknown>
|
||||
|
Loading…
Reference in New Issue
Block a user