mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
Pass tab onto getClickedElement, no need to look up the current tab
This commit is contained in:
@@ -31,7 +31,7 @@ export default class ContextMenusBackground {
|
|||||||
if (info.menuItemId === 'generate-password') {
|
if (info.menuItemId === 'generate-password') {
|
||||||
await this.generatePasswordToClipboard();
|
await this.generatePasswordToClipboard();
|
||||||
} else if (info.menuItemId === 'copy-identifier') {
|
} else if (info.menuItemId === 'copy-identifier') {
|
||||||
await this.getClickedElement(info.frameId);
|
await this.getClickedElement(tab, info.frameId);
|
||||||
} else if (info.parentMenuItemId === 'autofill' ||
|
} else if (info.parentMenuItemId === 'autofill' ||
|
||||||
info.parentMenuItemId === 'copy-username' ||
|
info.parentMenuItemId === 'copy-username' ||
|
||||||
info.parentMenuItemId === 'copy-password' ||
|
info.parentMenuItemId === 'copy-password' ||
|
||||||
@@ -48,8 +48,7 @@ export default class ContextMenusBackground {
|
|||||||
this.passwordGenerationService.addHistory(password);
|
this.passwordGenerationService.addHistory(password);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getClickedElement(frameId: number) {
|
private async getClickedElement(tab: chrome.tabs.Tab, frameId: number) {
|
||||||
const tab = await BrowserApi.getTabFromCurrentWindow();
|
|
||||||
if (tab == null) {
|
if (tab == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user