lib/webext.ts: Fix error thrown on page load

It is not useful to await in ownTabContainer as it could cause an
unnecessary context switch and will throw an error if the tab is not in
a container.
While it could seem like throwing errors in ownTabContainer is not a big
deal, it is actually quite annoying when using Firefox's "Pause on
exceptions" feature: execution is paused even if the error is caught by
the caller and there is no stack trace to help us understand what's
happening because ownTabContainer is async.

Thus, removing this await is very useful.
This commit is contained in:
glacambre 2018-10-10 16:09:34 +02:00
parent 1123554970
commit 8744d73423
No known key found for this signature in database
GPG key ID: B9625DB1767553AC

View file

@ -70,7 +70,7 @@ export async function ownTabId() {
//#content_helper //#content_helper
export async function ownTabContainer() { export async function ownTabContainer() {
return await browserBg.contextualIdentities.get( return browserBg.contextualIdentities.get(
(await ownTab()).cookieStoreId, (await ownTab()).cookieStoreId,
) )
} }