mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-05 18:47:52 +01:00
Re-focus to last open tab before user was prompted for log in
This commit is contained in:
parent
b74efc1dbf
commit
7f98ce347d
@ -79,6 +79,10 @@ export default class RuntimeBackground {
|
|||||||
await this.processMessage(retryItem.msg, retryItem.sender, null);
|
await this.processMessage(retryItem.msg, retryItem.sender, null);
|
||||||
|
|
||||||
await BrowserApi.closeLoginTab();
|
await BrowserApi.closeLoginTab();
|
||||||
|
|
||||||
|
if (retryItem?.sender?.tab?.id) {
|
||||||
|
await BrowserApi.focusSpecifiedTab(retryItem.sender.tab.id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'addToLockedVaultPendingNotifications':
|
case 'addToLockedVaultPendingNotifications':
|
||||||
|
@ -111,6 +111,10 @@ export class BrowserApi {
|
|||||||
chrome.tabs.remove(tabToClose);
|
chrome.tabs.remove(tabToClose);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async focusSpecifiedTab(tabId: number) {
|
||||||
|
chrome.tabs.update(tabId, { active: true, highlighted: true });
|
||||||
|
}
|
||||||
|
|
||||||
static closePopup(win: Window) {
|
static closePopup(win: Window) {
|
||||||
if (BrowserApi.isWebExtensionsApi && BrowserApi.isFirefoxOnAndroid) {
|
if (BrowserApi.isWebExtensionsApi && BrowserApi.isFirefoxOnAndroid) {
|
||||||
// Reactivating the active tab dismisses the popup tab. The promise final
|
// Reactivating the active tab dismisses the popup tab. The promise final
|
||||||
|
Loading…
Reference in New Issue
Block a user