diff --git a/background-script.js b/background-script.js index a9b19fe..bd6b9b2 100644 --- a/background-script.js +++ b/background-script.js @@ -125,6 +125,9 @@ const getNewTabPosition = () => * @return {Promise} */ const calculateNewTabIndex = (senderTab, tabs) => { + // If no index is specified, Firefox automatically places the tab according to user settings. + if (isFirefox) return Promise.resolve(undefined); + if (senderTab !== undefined) { return getNewTabPosition().then((newTabPosition) => { switch (newTabPosition) { @@ -143,6 +146,11 @@ const calculateNewTabIndex = (senderTab, tabs) => { } }; +let isFirefox; +this?.browser?.runtime?.getBrowserInfo()?.then((brinfo) => { + isFirefox = brinfo.name === "Firefox"; +}); + chrome.runtime.getPlatformInfo((info) => { const isMac = info.os === "mac";