<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>tab on
A Scripter's Notes</title><link>https://scripter.co/tags/tab/</link><description>Recent content in tab
on A Scripter's Notes</description><language>en-us</language><managingEditor>kaushal.modi@gmail.com (Kaushal Modi)</managingEditor><webMaster>kaushal.modi@gmail.com (Kaushal Modi)</webMaster><lastBuildDate>Wed, 22 Apr 2026 08:24:58 -0400</lastBuildDate><generator>Hugo -- gohugo.io</generator><docs>https://validator.w3.org/feed/docs/rss2.html</docs><atom:link href="https://scripter.co/tags/tab/index.xml" rel="self" type="application/rss+xml"/><item><title>Firefox: Always open a New Tab after Current</title><link>https://scripter.co/firefox-always-open-a-new-tab-after-current/</link><description>&lt;blockquote>The default behavior of Firefox opening new tabs from links had been
troubling me for a while .. it was time I tried to do something about
it.&lt;/blockquote>&lt;div class="ox-hugo-toc toc">
&lt;div class="heading">Table of Contents&lt;/div>
&lt;ul>
&lt;li>&lt;a href="#the-issue">The Issue&lt;/a>&lt;/li>
&lt;li>&lt;a href="#expected-behavior">Expected Behavior&lt;/a>&lt;/li>
&lt;li>&lt;a href="#false-leads">False Leads&lt;/a>&lt;/li>
&lt;li>&lt;a href="#firefox-bug-1485683">Firefox Bug # 1485683&lt;/a>&lt;/li>
&lt;li>&lt;a href="#solution">Solution&lt;/a>&lt;/li>
&lt;/ul>
&lt;/div>
&lt;!--endtoc-->
&lt;p>This was one of the those little things in software that bug me, but I
don&amp;rsquo;t start looking for a solution right-away because of reasons like
&amp;ldquo;I am too busy with something else&amp;rdquo;, or &amp;ldquo;The bug is not so bad.. let
me see if I can live with it&amp;rdquo;.&lt;/p>
&lt;p>But no .. this particular issue with how Firefox dealt with opening
new tabs from links was now getting on my nerves.&lt;/p>
&lt;h2 id="the-issue">The Issue&amp;nbsp;&lt;a class="headline-hash no-text-decoration" href="#the-issue">#&lt;/a>&lt;/h2>
&lt;p>While visiting a page, I typically middle-click on links so that they
open in new tabs .. and I do that a lot! And this is the order of
where the new tabs would open:&lt;/p>
&lt;p>&lt;a id="figure--firefox-new-tabs-unexpected">&lt;/a>&lt;/p>
&lt;figure>
&lt;img src="https://scripter.co/firefox-always-open-a-new-tab-after-current/unexpected.svg" alt="Figure 1: Unexpected order of opening of new tabs opened after each middle-click"/> &lt;figcaption>
&lt;p>
&lt;span class="figure-number">Figure 1: &lt;/span>Unexpected order of opening of new tabs opened after each middle-click
&lt;/p>
&lt;/figcaption>&lt;/figure>
&lt;div class="org-center">
&lt;p>In my view, this behavior is completely wrong!&lt;/p>
&lt;/div>
&lt;p>As you can see above, if I already have a bunch of links open (see the
last row where &amp;ldquo;Tab 1&amp;rdquo;, &amp;ldquo;Tab 2&amp;rdquo; and &amp;ldquo;Tab 3&amp;rdquo; are already open), the
last opened tab will land up between those tabs and a sea of other
previously opened tabs! When you have over a dozen of tabs already
open, hunting for the &lt;em>last opened tabs&lt;/em> is really annoying.&lt;/p>
&lt;h2 id="expected-behavior">Expected Behavior&amp;nbsp;&lt;a class="headline-hash no-text-decoration" href="#expected-behavior">#&lt;/a>&lt;/h2>
&lt;p>I would instead expect for each middle-click to open the new tab
&lt;strong>immediately to the right&lt;/strong> of the current tab. Below diagram shows it
very clearly that this behavior would save me the exercise of hunting
for that new tab.&lt;/p>
&lt;p>&lt;a id="figure--firefox-new-tabs-expected">&lt;/a>&lt;/p>
&lt;figure>
&lt;img src="https://scripter.co/firefox-always-open-a-new-tab-after-current/expected.svg" alt="Figure 2: Expected order of opening of new tabs opened after each middle-click"/> &lt;figcaption>
&lt;p>
&lt;span class="figure-number">Figure 2: &lt;/span>&lt;strong>Expected&lt;/strong> order of opening of new tabs opened after each middle-click
&lt;/p>
&lt;/figcaption>&lt;/figure>
&lt;h2 id="false-leads">False Leads&amp;nbsp;&lt;a class="headline-hash no-text-decoration" href="#false-leads">#&lt;/a>&lt;/h2>
&lt;p>So I searched online for &amp;ldquo;firefox new tab location&amp;rdquo; and similar search
terms, and found &lt;em>Q&amp;amp;A&lt;/em> on Mozilla Support like &lt;a href="https://support.mozilla.org/en-US/questions/1229062#answer-1141742">How do I make tabs open
on the right by default?&lt;/a> and &lt;a href="https://support.mozilla.org/en-US/questions/1295586#answer-1334375">New tabs ALWAYS open to the right of
the last open tab, not to the right of current tab&lt;/a>.&lt;/p>
&lt;p>The &amp;ldquo;Chosen solutions&amp;rdquo; for both of these issues suggested setting
&lt;code>browser.tabs.insertAfterCurrent = true&lt;/code> and
&lt;code>browser.tabs.insertRelatedAfterCurrent = true&lt;/code> (which is the default)
in the Firefox &lt;strong>about:config&lt;/strong>.&lt;/p>
&lt;div class="verse">
&lt;p>        But that didn&amp;rsquo;t work!!&lt;br />&lt;/p>
&lt;/div>
&lt;p>Setting &lt;code>browser.tabs.insertAfterCurrent = true&lt;/code> affected the &amp;ldquo;new tab
opening&amp;rdquo; behavior when opening only blank new tabs using &lt;code>Ctrl+T&lt;/code> or
hitting the &amp;ldquo;New Tab&amp;rdquo; button.
&lt;mark>This setting had &lt;strong>nothing&lt;/strong> to do with the location of new tabs opened
by the &amp;ldquo;Open Link in New Tab&amp;rdquo; or &amp;ldquo;middle-click on link&amp;rdquo; action.&lt;/mark>&lt;/p>
&lt;h2 id="firefox-bug-1485683">Firefox Bug # 1485683&amp;nbsp;&lt;a class="headline-hash no-text-decoration" href="#firefox-bug-1485683">#&lt;/a>&lt;/h2>
&lt;p>After scouring through many search results, I landed up on &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1485683">Firefox
Bug # 1485683: browser.tab.insertaftercurrent order&lt;/a> which reported
the exact same issue I was seeing 🎉.&lt;/p>
&lt;p>So I replied to that bug thread confirming that I still saw that issue
on Firefox 101.0.1 .. &lt;strong>4 years later&lt;/strong> .. just in case that motivates
someone to still fix it.&lt;/p>
&lt;p>But my issue isn&amp;rsquo;t fixed yet.&lt;/p>
&lt;h2 id="solution">Solution&amp;nbsp;&lt;a class="headline-hash no-text-decoration" href="#solution">#&lt;/a>&lt;/h2>
&lt;p>Finally, the &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/open-tabs-next-to-current/">Open Tabs Next to Current&lt;/a> (&lt;a href="https://github.com/sblask/webextension-open-tabs-next-to-current">repo&lt;/a>) Firefox Add-on saved the
day!&lt;/p>
&lt;p>The introduction of this add-on incorrectly states this:&lt;/p>
&lt;blockquote>
&lt;p>After the addition of the &lt;code>browser.tabs.insertAfterCurrent&lt;/code> setting in
&lt;strong>about:config&lt;/strong> you do not need this extension anymore.&lt;/p>
&lt;/blockquote>
&lt;p>But I still tried installing it to see .. just in case
.. 🤞 ..&lt;/p>
&lt;div class="verse">
&lt;p>And it worked!!&lt;br />&lt;/p>
&lt;/div>
&lt;p>I could finally get new tabs to open in the order as shown in the
&lt;a href="#figure--firefox-new-tabs-expected">Expected Tab Order figure&lt;/a> above 😂.&lt;/p>
&lt;p>Thank you Sebastian Blask for &lt;strong>Open Tabs Next to Current&lt;/strong>!&lt;/p></description><author>Kaushal.Modi@fakeEmailToMakeValidatorHappy.com (Kaushal Modi)</author><category domain="https://scripter.co/categories/web">web</category><category domain="https://scripter.co/tags/firefox">firefox</category><category domain="https://scripter.co/tags/tab">tab</category><category domain="https://scripter.co/tags/add-on">add-on</category><category domain="https://scripter.co/tags/100daystooffload">100DaysToOffload</category><guid>https://scripter.co/firefox-always-open-a-new-tab-after-current/</guid><pubDate>Wed, 15 Jun 2022 02:08:00 -0400</pubDate></item></channel></rss>