mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 09:01:39 -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 (await firefoxVersionAtLeast(80)) {
|
||||
// work around #2695 until we can work out what is going on
|
||||
if (args.active === false || args.cookieStoreId !== undefined || waitForDom === true) {
|
||||
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 }))
|
||||
// browser.search.search(tabId, ...) sometimes does not work when it is executed
|
||||
// right after openInNewTab(). Calling browser.tabs.get() between openInNewTab()
|
||||
// and browser.search.search() seems to fix that problem.
|
||||
// See https://github.com/tridactyl/tridactyl/pull/4791.
|
||||
return openInNewTab(null, args, waitForDom)
|
||||
.then(tab => browser.tabs.get(tab.id))
|
||||
.then(tab => browser.search.search({tabId: tab.id, ...maybeURL}))
|
||||
}
|
||||
|
||||
// Fall back to about:newtab
|
||||
|
|
Loading…
Add table
Reference in a new issue