Re-focus to last open tab before user was prompted for log in

This commit is contained in:
Daniel James Smith 2021-10-11 17:46:43 +02:00
parent b74efc1dbf
commit 7f98ce347d
No known key found for this signature in database
GPG Key ID: 03E4BD365FF06726
2 changed files with 8 additions and 0 deletions

View File

@ -79,6 +79,10 @@ export default class RuntimeBackground {
await this.processMessage(retryItem.msg, retryItem.sender, null);
await BrowserApi.closeLoginTab();
if (retryItem?.sender?.tab?.id) {
await BrowserApi.focusSpecifiedTab(retryItem.sender.tab.id);
}
}
break;
case 'addToLockedVaultPendingNotifications':

View File

@ -111,6 +111,10 @@ export class BrowserApi {
chrome.tabs.remove(tabToClose);
}
static async focusSpecifiedTab(tabId: number) {
chrome.tabs.update(tabId, { active: true, highlighted: true });
}
static closePopup(win: Window) {
if (BrowserApi.isWebExtensionsApi && BrowserApi.isFirefoxOnAndroid) {
// Reactivating the active tab dismisses the popup tab. The promise final