mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
scripts/ui: add tabs.query promise error handler (#16915)
This commit is contained in:
parent
6a23dcc68a
commit
be6edb4bc8
@ -18,6 +18,7 @@ import {
|
||||
PLATFORM_FIREFOX,
|
||||
} from '../../shared/constants/app';
|
||||
import { isManifestV3 } from '../../shared/modules/mv3.utils';
|
||||
import { checkForLastErrorAndLog } from '../../shared/modules/browser-runtime.utils';
|
||||
import { SUPPORT_LINK } from '../../shared/lib/ui-utils';
|
||||
import { getErrorHtml } from '../../shared/lib/error-utils';
|
||||
import ExtensionPlatform from './platforms/extension';
|
||||
@ -289,7 +290,12 @@ async function queryCurrentActiveTab(windowType) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
|
||||
const tabs = await browser.tabs
|
||||
.query({ active: true, currentWindow: true })
|
||||
.catch((e) => {
|
||||
checkForLastErrorAndLog() || log.error(e);
|
||||
});
|
||||
|
||||
const [activeTab] = tabs;
|
||||
const { id, title, url } = activeTab;
|
||||
const { origin, protocol } = url ? new URL(url) : {};
|
||||
|
Loading…
Reference in New Issue
Block a user