[Mypal] Add option to insert all new tabs after the current tab.

master
Fedor 2020-07-16 04:17:31 +03:00
parent bf3babe621
commit 4d641f33b6
2 changed files with 8 additions and 5 deletions

View File

@ -433,6 +433,7 @@ pref("browser.link.open_newwindow.disabled_in_fullscreen", false);
// Tabbed browser // Tabbed browser
pref("browser.tabs.autoHide", false); pref("browser.tabs.autoHide", false);
pref("browser.tabs.closeWindowWithLastTab", true); pref("browser.tabs.closeWindowWithLastTab", true);
pref("browser.tabs.insertAllAfterCurrent", false);
pref("browser.tabs.insertRelatedAfterCurrent", true); pref("browser.tabs.insertRelatedAfterCurrent", true);
pref("browser.tabs.warnOnClose", true); pref("browser.tabs.warnOnClose", true);
pref("browser.tabs.warnOnCloseOtherTabs", true); pref("browser.tabs.warnOnCloseOtherTabs", true);

View File

@ -1734,13 +1734,15 @@
this._outerWindowIDBrowserMap.set(b.outerWindowID, b); this._outerWindowIDBrowserMap.set(b.outerWindowID, b);
} }
// Check if we're opening a tab related to the current tab and // Check if the user prefers inserting all new tabs after the current tab.
// move it to after the current tab. // If not, check if we're opening a tab related to the current tab.
// aReferrerURI is null or undefined if the tab is opened from // If either condition is met, move the new tab to after the current tab.
// Note: aReferrerURI is null or undefined if the tab is opened from
// an external application or bookmark, i.e. somewhere other // an external application or bookmark, i.e. somewhere other
// than the current tab. // than the current tab.
if ((aRelatedToCurrent == null ? aReferrerURI : aRelatedToCurrent) && if (Services.prefs.getBoolPref("browser.tabs.insertAllAfterCurrent", false) ||
Services.prefs.getBoolPref("browser.tabs.insertRelatedAfterCurrent")) { ((aRelatedToCurrent == null ? aReferrerURI : aRelatedToCurrent) &&
Services.prefs.getBoolPref("browser.tabs.insertRelatedAfterCurrent"))) {
let newTabPos = (this._lastRelatedTab || let newTabPos = (this._lastRelatedTab ||
this.selectedTab)._tPos + 1; this.selectedTab)._tPos + 1;
if (this._lastRelatedTab) if (this._lastRelatedTab)