From d5d8c89280fd5b560c8c1bb2cd30c5b509fb6c62 Mon Sep 17 00:00:00 2001 From: lolcat Date: Tue, 28 Jul 2026 02:25:18 -0400 Subject: [PATCH] fix open_tab() not returning false on failure --- ext/bg.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/ext/bg.js b/ext/bg.js index 9066d8f..dee1df1 100644 --- a/ext/bg.js +++ b/ext/bg.js @@ -241,11 +241,25 @@ function attach_ws_events(ws){ break; case "tab_open": - var tab = - await browser.tabs.create({ - url: msg.url, - ...(typeof msg.container == "string" && { cookieStoreId: msg.container }) + + // sometimes opening tabs like about:blank with a + // container will fail. + var tab = null; + + try{ + tab = + await browser.tabs.create({ + url: msg.url, + ...(typeof msg.container == "string" && { cookieStoreId: msg.container }) + }); + }catch(err){ + + // send error: we attempted to open tab + send(ws, seqid, { + data: false }); + break; + } // immediately return even if its not loaded yet send(ws, seqid, {