mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 01:51:40 -05:00
Respect the tabs.move/tabs.create API
According to MDN[1], when you create a tab that should be placed at the end of a window, you should use the number of tabs of the window as index. But if you use tabs.move(), you should use an index value of -1[2]. Probably fixes https://github.com/tridactyl/tridactyl/issues/990 . 1: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/create#Parameters 2: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/move#Parameters
This commit is contained in:
parent
da0604f344
commit
a7ddcb1b5a
2 changed files with 2 additions and 2 deletions
|
@ -338,7 +338,7 @@ export async function nativeopen(url: string, ...firefoxArgs: string[]) {
|
|||
let index = (await activeTab()).index + 1
|
||||
switch (pos) {
|
||||
case "last":
|
||||
index = 99999
|
||||
index = -1
|
||||
break
|
||||
case "related":
|
||||
// How do we simulate that?
|
||||
|
|
|
@ -114,7 +114,7 @@ export async function openInNewTab(
|
|||
break
|
||||
case "last":
|
||||
// Infinity can't be serialised, apparently.
|
||||
options.index = 99999
|
||||
options.index = (await browserBg.tabs.query({currentWindow: true})).length
|
||||
break
|
||||
case "related":
|
||||
if (await firefoxVersionAtLeast(57)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue