fix open_tab() not returning false on failure

This commit is contained in:
2026-07-28 02:25:18 -04:00
parent 6b9ac26f82
commit d5d8c89280

View File

@@ -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, {