[how to] Forbid Firefox to open new windows without extensions

rado84

Well-Known Member
Joined
Feb 25, 2019
Messages
790
Reaction score
644
Credits
5,031
Years ago, long before Firefox switched to web extensions, there was an addon that would forbid the browser to open new windows for whatever reason and everything would open in a new tab instead. But ever since Mozilla decided to move to web extensions, that addon was abandoned and is now considered "legacy", meaning it's not supported anymore. That means the browser (by default) can and will open new instances of itself whenever it wants to. But personally I hate that, so I fiddled with the about:config until I found a solution. If you're like me and hate the browser opening new instances of itself, keep reading.

1. In the URL bar type about:config and press enter. In the search field that will appear type:
Code:
browser.link.open_newwindow.restriction
double click it and change the number to 3.

Here's an explanation of the numbers this form accepts:
  • 3 = divert new window to a new tab
  • 2 = allow link to open a new window (default)
  • 1 = force new window into same tab
And done! There's no need to restart the browser, it's being applied instantly.

2. Go to ~/.local/share/applications (or /usr/share/applications) and find Firefox.desktop. Open it in a text editor and find this line: [Desktop Action new-window]. Delete THAT line and everything below it.
Also, if you don't use private windows, delete this line too: [Desktop Action new-private-window] and everything below it.

There's a bug which allows Firefox to still open new windows while these two lines in question are present in the .desktop file.
 

Staff online

Members online


Top