mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 05:13:29 +00:00
Fix Firefox phishing blocker continue button by awaiting tab navigation promises (#17436)
This commit is contained in:
@@ -268,11 +268,11 @@ export class BrowserApi {
|
||||
static async closeTab(tabId: number): Promise<void> {
|
||||
if (tabId) {
|
||||
if (BrowserApi.isWebExtensionsApi) {
|
||||
browser.tabs.remove(tabId).catch((error) => {
|
||||
await browser.tabs.remove(tabId).catch((error) => {
|
||||
throw new Error("[BrowserApi] Failed to remove current tab: " + error.message);
|
||||
});
|
||||
} else if (BrowserApi.isChromeApi) {
|
||||
chrome.tabs.remove(tabId).catch((error) => {
|
||||
await chrome.tabs.remove(tabId).catch((error) => {
|
||||
throw new Error("[BrowserApi] Failed to remove current tab: " + error.message);
|
||||
});
|
||||
}
|
||||
@@ -288,7 +288,7 @@ export class BrowserApi {
|
||||
static async navigateTabToUrl(tabId: number, url: URL): Promise<void> {
|
||||
if (tabId) {
|
||||
if (BrowserApi.isWebExtensionsApi) {
|
||||
browser.tabs.update(tabId, { url: url.href }).catch((error) => {
|
||||
await browser.tabs.update(tabId, { url: url.href }).catch((error) => {
|
||||
throw new Error("Failed to navigate tab to URL: " + error.message);
|
||||
});
|
||||
} else if (BrowserApi.isChromeApi) {
|
||||
|
||||
Reference in New Issue
Block a user