mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 09:31:41 -05:00
Make openInNewTab always open in background
New active tabs focus address bar, while new inactive tabs do not. By opening all tabs as inactive, then making active afterwards, focus can be maintained on content for all new tabs.
This commit is contained in:
parent
9d7b1107cd
commit
4a08e0e6e9
1 changed files with 6 additions and 2 deletions
|
@ -105,7 +105,7 @@ export async function openInNewTab(
|
|||
) {
|
||||
const thisTab = await activeTab()
|
||||
const options: any = {
|
||||
active: kwargs.active,
|
||||
active: false,
|
||||
url,
|
||||
cookieStoreId: kwargs.cookieStoreId,
|
||||
}
|
||||
|
@ -135,7 +135,11 @@ export async function openInNewTab(
|
|||
break
|
||||
}
|
||||
|
||||
return browserBg.tabs.create(options)
|
||||
if (kwargs.active === false) { // load in background
|
||||
return browserBg.tabs.create(options)
|
||||
} else { // load in background and then activate, per issue #1993
|
||||
return browserBg.tabs.create(options).then(newtab => browserBg.tabs.update(newtab.id, { active: true }))
|
||||
}
|
||||
}
|
||||
|
||||
// lazily copied from excmds.ts' winopen - forceURI really ought to be moved to lib/webext
|
||||
|
|
Loading…
Add table
Reference in a new issue