mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
Fix Copy Custom Field Name on pages with iframes (#2091)
* Improve error messages * Send getClickedElement msg to specific frameId * Add support for finding input element from label * Use i18n for error messages * Fix unrelated linting
This commit is contained in:
@@ -30,7 +30,7 @@ export default class ContextMenusBackground {
|
||||
if (info.menuItemId === 'generate-password') {
|
||||
await this.generatePasswordToClipboard();
|
||||
} else if (info.menuItemId === 'copy-identifier') {
|
||||
await this.getClickedElement();
|
||||
await this.getClickedElement(info.frameId);
|
||||
} else if (info.parentMenuItemId === 'autofill' ||
|
||||
info.parentMenuItemId === 'copy-username' ||
|
||||
info.parentMenuItemId === 'copy-password' ||
|
||||
@@ -47,13 +47,13 @@ export default class ContextMenusBackground {
|
||||
this.passwordGenerationService.addHistory(password);
|
||||
}
|
||||
|
||||
private async getClickedElement() {
|
||||
private async getClickedElement(frameId: number) {
|
||||
const tab = await BrowserApi.getTabFromCurrentWindow();
|
||||
if (tab == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
BrowserApi.tabSendMessageData(tab, 'getClickedElement');
|
||||
BrowserApi.tabSendMessage(tab, { command: 'getClickedElement' }, { frameId: frameId });
|
||||
}
|
||||
|
||||
private async cipherAction(info: any) {
|
||||
|
||||
Reference in New Issue
Block a user