Fix wrong behavior of :tabopen with containers

This commit is contained in:
petoncle 2023-10-25 00:13:19 +02:00
parent f224e6cf44
commit d2b0330879

View file

@ -2806,16 +2806,9 @@ export async function tabopen_helper({ addressarr = [], waitForDom = false }): P
} }
if (typeof maybeURL === "object") { if (typeof maybeURL === "object") {
if (await firefoxVersionAtLeast(80)) { return openInNewTab(null, args, waitForDom)
// work around #2695 until we can work out what is going on .then(tab => browser.tabs.get(tab.id))
if (args.active === false || args.cookieStoreId !== undefined || waitForDom === true) { .then(tab => browser.search.search({tabId: tab.id, ...maybeURL}))
throw new Error("Firefox search engines do not support containers or background tabs in FF >80. `:set searchengine google` or see issue https://github.com/tridactyl/tridactyl/issues/2695")
}
// This ignores :set tabopenpos / issue #342. TODO: fix that somehow.
return browser.search.search(maybeURL)
}
return openInNewTab(null, args, waitForDom).then(tab => browser.search.search({ tabId: tab.id, ...maybeURL }))
} }
// Fall back to about:newtab // Fall back to about:newtab