mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 09:43:23 +00:00
2fa login fixes for duo on safari
This commit is contained in:
@@ -93,12 +93,11 @@ export default class CommandsBackground {
|
||||
|
||||
private async openPopup() {
|
||||
// Chrome APIs cannot open popup
|
||||
if (!this.isSafari || !safari.extension.toolbarItems || !safari.extension.toolbarItems.length) {
|
||||
if (!this.isSafari) {
|
||||
return;
|
||||
}
|
||||
|
||||
safari.extension.toolbarItems[0].showPopover();
|
||||
|
||||
this.main.openPopup();
|
||||
(window as any).ga('send', {
|
||||
hitType: 'event',
|
||||
eventAction: 'Opened Popup From Command',
|
||||
|
||||
@@ -282,6 +282,21 @@ export default class MainBackground {
|
||||
this.runtimeBackground.processMessage(message, { tab: null }, () => { /* No response needed. */ });
|
||||
}
|
||||
|
||||
async openPopup() {
|
||||
// Chrome APIs cannot open popup
|
||||
if (!this.isSafari || !safari.extension.toolbarItems || !safari.extension.toolbarItems.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
const activeToolBars = safari.extension.toolbarItems.filter((tb: any) => {
|
||||
return tb.browserWindow === safari.application.activeBrowserWindow;
|
||||
});
|
||||
|
||||
if (activeToolBars && activeToolBars.length) {
|
||||
activeToolBars[0].showPopover();
|
||||
}
|
||||
}
|
||||
|
||||
private async buildContextMenu() {
|
||||
if (this.isSafari || !chrome.contextMenus || this.buildingContextMenu) {
|
||||
return;
|
||||
|
||||
@@ -81,6 +81,9 @@ export default class RuntimeBackground {
|
||||
setTimeout(async () => await this.main.refreshBadgeAndMenu(), 2000);
|
||||
}
|
||||
break;
|
||||
case 'openPopup':
|
||||
await this.main.openPopup();
|
||||
break;
|
||||
case 'bgGetDataForTab':
|
||||
await this.getDataForTab(sender.tab, msg.responseCommand);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user