mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 09:31:41 -05:00
Merge pull request #4791 from petoncle/fix-wrong-behavior-of-tabopen-with-containers
Fix wrong behavior of :tabopen with containers
This commit is contained in:
commit
dd535a4e32
1 changed files with 7 additions and 10 deletions
|
@ -2837,16 +2837,13 @@ export async function tabopen_helper({ addressarr = [], waitForDom = false }): P
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof maybeURL === "object") {
|
if (typeof maybeURL === "object") {
|
||||||
if (await firefoxVersionAtLeast(80)) {
|
// browser.search.search(tabId, ...) sometimes does not work when it is executed
|
||||||
// work around #2695 until we can work out what is going on
|
// right after openInNewTab(). Calling browser.tabs.get() between openInNewTab()
|
||||||
if (args.active === false || args.cookieStoreId !== undefined || waitForDom === true) {
|
// and browser.search.search() seems to fix that problem.
|
||||||
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")
|
// See https://github.com/tridactyl/tridactyl/pull/4791.
|
||||||
}
|
return openInNewTab(null, args, waitForDom)
|
||||||
|
.then(tab => browser.tabs.get(tab.id))
|
||||||
// This ignores :set tabopenpos / issue #342. TODO: fix that somehow.
|
.then(tab => browser.search.search({tabId: tab.id, ...maybeURL}))
|
||||||
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
|
||||||
|
|
Loading…
Add table
Reference in a new issue