Firefox Browser Add-ons
  • Extensions
  • Themes
    • for Firefox
    • Dictionaries & Language Packs
Log in
Preview of Right-Click to New-Tab 2026

Right-Click to New-Tab 2026 by Sean Hollen

Right-clicking a link opens it in a new tab, at the position a middle-click would have used.

0 (0 reviews)0 (0 reviews)
Download Firefox and get the extension
Download file

Extension Metadata

About this extension
Right-clicking a link opens it in a new tab, at the position a middle-click would have used.

Why it exists

Extensions that already do this are unreliable in three ways:
  1. They miss links. On many sites the right-click falls through to the normal context menu and no tab opens. The causes were the same across extensions:
  2. attaching listeners late (document_idle) or only when the page changes;
  3. listening for mousedown/mouseup, which never fire when a page calls preventDefault() on pointerdown (carousels, sliders, drag libraries);
  4. listening at a point the page can stop first (stopPropagation in a window capture listener);
  5. not handling shadow DOM, SVG links, <area>, srcdoc iframes or pages that call document.open().
  6. They put tabs in the wrong place. Several use index: current + 1, so clicking links 1, 2, 3 gives tabs in the order 3, 2, 1. Others ignore what the browser does after you switch tabs, close a child tab or middle-click between right-clicks. Most open into the wrong window when another window has focus.
  7. They fire on things that aren't links. Some open a tab for href="#", images or canvases, or for a link that sits under the element you clicked. Some open two tabs for nested links, or open a tab after a right-button drag.

How it works
  • Content script, injected at document_start into every frame, including about:blank and srcdoc frames:
  • Window capture listeners for pointerdown, contextmenu and pointerup. They are registered before any page script, so the page can't block them. Pointer events still fire when the page cancels mouse events.
  • On press, it finds the link under the cursor by walking the flattened tree: into open and closed shadow roots (event.originalTarget, openOrClosedShadowRoot), through slots, and out via ShadowRoot.host. Only <a href>, <area href> and SVG href/xlink:href links with an http(s) URL count.
  • It cancels contextmenu only for those links. This works whether the menu event fires on press (Linux, macOS) or on release (Windows).
  • On release, it opens the tab unless the pointer moved more than 6 px in any direction or a modifier key is held. The URL is read at release, as a middle-click would, so links whose href is rewritten on press are honoured. If the page removed the link meanwhile, the URL from the press is used.
  • A MutationObserver on document re-adds the listeners after document.open() wipes them.
  • Background script creates tabs one at a time, in click order:
  • openerTabId is set and no index is given, so Firefox positions the tab with its own middle-click rule. That rule covers placing tabs after earlier tabs opened from the same page, resetting when you switch tabs, and tab groups.
  • cookieStoreId is passed through, so the tab opens in the same container as the page.

What it deliberately doesn't do
  • No tab for anything without a URL: <button>, role="link", href="#", javascript:/mailto:/data: links, images, canvases, or links inside editable areas. These keep their normal right-click behaviour.
  • No telemetry, remote configuration or network requests. Permissions are storage, plus cookies to open tabs in the right container. There are no host permissions beyond the content script match.
  • No work outside the right button. Other clicks return at the first check, and nothing scans or tags links on the page.

Holding Shift, Ctrl, Alt or Meta while right-clicking, or using the keyboard menu key, shows the normal context menu. The toolbar button turns the extension off or on for the current site.

Results

Every scenario is also run with a native middle-click and no extension. That run is the reference for correct tab order.

69 synthetic edge cases and 11 tab-order scenarios. The pages cover the constructions above: shadow DOM, frames, page scripts that swallow events, SVG/area links, drags, holds and false-positive traps.

| Extension | Edge cases / 69 | Tab order / 11 |
|---|---|---|
| This extension | 69 | 11 |
| Right Click Opens Link New Tab 0.1.1 | 50 | 8 |
| Right Links WE 0.5b12 | 44 | 10 |
| Right Click Opens Link in a Background Tab 1.5 | 42 | 8 |
| Right Click Opens Link New Tab Correct Order 0.0.9 | 40 | 8 |
| Right Click Opens Link New Tab 0.0.7 | 28 | 2 |

Extensions not available for Firefox were ported to run the same tests.

Real sites: 246 out of 246 links worked, across about 35 sites (news, search, shopping, forums, docs, social), picking real links before and after scrolling. "Worked" means exactly one new tab, with the link's URL, no context menu, and the source page unchanged.

Page cost: on a page with 3,000 links and 300 consecutive DOM changes, the measured time was 1222–1234 ms, against 1235 ms with no extension. The two extensions that rescan the page on every change took about 3600 ms.

Known limitations
  • It can't run where Firefox blocks extensions: the PDF viewer, Reader View and about: pages.
  • Opened tabs carry no referrer. The tab-creation API can't set one.
  • It can't hide the menu if dom.event.contextmenu.enabled is false. That setting stops pages and extensions from suppressing the context menu, so the menu still appears.
  • Pseudo-links have no URL. Buttons and divs that navigate through JavaScript keep the normal right-click.
Rated 0 by 0 reviewers
Log in to rate this extension
There are no ratings yet

Star rating saved

5
0
4
0
3
0
2
0
1
0
No reviews yet
Permissions and data

Required permissions:

  • Access your data for all websites

Data collection:

  • The developer says this extension doesn't require data collection.
Learn more
More information
Add-on Links
  • Copy add-on ID
Version
1.2.0
Size
16.07 KB
Last updated
8 days ago (Oct 4, 2026)
Related Categories
  • Feeds, News & Blogging
  • Tabs
License
MIT License
Version History
  • See all versions
Add to collection
Report this add-on
Go to Mozilla's homepage

Add-ons

  • About
  • Firefox Add-ons Blog
  • Extension Workshop
  • Developer Hub
  • Developer Policies
  • Community Blog
  • Forum
  • Report a bug
  • Review Guide

Download

  • Download Firefox
  • Windows
  • macOS
  • iOS
  • Android
  • Linux
  • All

Latest Builds

  • Nightly
  • Beta

Firefox for Business

  • Enterprise

Community

  • Connect
  • Contribute
  • Developer

Follow

  • Instagram
  • YouTube
  • TikTok
  • Bluesky
  • Podcast
  • Privacy
  • Cookies
  • Legal

Except where otherwise noted, content on this site is licensed under the Creative Commons Attribution Share-Alike License v3.0 or any later version.