Browse Source

[Pale-Moon] Issue #1782 - Add option to insert all new tabs after the current tab

This adds 'browser.tabs.insertAllAfterCurrent' as a preference which
makes all new tabs opened to be next to the currently active tab, instead
of at the end - regardless if the tab is considered "related" to the active
tab. This (naturally and logically) overrides 'insertRelatedAfterCurrent'

Resolves #1782
pull/24/head
Moonchild 2 years ago committed by Roy Tam
parent
commit
61e78cda6a
  1. 1
      application/palemoon/app/profile/palemoon.js
  2. 12
      application/palemoon/base/content/tabbrowser.xml

1
application/palemoon/app/profile/palemoon.js

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

12
application/palemoon/base/content/tabbrowser.xml

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

Loading…
Cancel
Save