Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
zznidar committed Aug 20, 2023
1 parent 0153cbf commit 1e09fa6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions background-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ const getNewTabPosition = () =>
* @return {Promise<number|undefined>}
*/
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) {
Expand All @@ -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";

Expand Down

0 comments on commit 1e09fa6

Please sign in to comment.