Browser.link.open newwindow.restriction
Background
Using JavaScript, web page authors can open new windows using window.open()
. However, many users prefer using tabs to multiple browser windows. If the user has set new windows to open in tabs, this preference allows for fine-tuning of just which JavaScript-opened links will be opened in tabs.
Oftentimes when a new window is opened from JavaScript, it’s a small popup without all of a usual browser window’s features—e.g., the back/forward/reload buttons are hidden, the status bar is hidden, the size is purposely smaller, etc. Usually in this situation, the window is designed specifically as a popup, and opening it in a tab actually makes it less useful. This preference can let these types of links open as new windows while opening all other types as new tabs.
Possible values and their effects
0
Redirect all window.open
calls to new tabs without exception.
1
Do not divert any window.open
calls (allow JavaScript to open new windows).
2
Redirect all window.open
calls to new tabs unless the new window specifies how it should be displayed. (Default)
Caveats
- browser.link.open_newwindow must be set to 3 (redirect links opening in new windows to tabs) for this preference to have an effect.
- Until recently, the default of this preference was 0.
First checked in
Has an effect in
- Mozilla Firefox (all versions since 1.0RC1)
Related bugs
- Bug 172962 - Options for where to open URLs from other applications (reuse tab, new tab, new window)
- Bug 313300 - change default for browser.link.open_newwindow.restriction to “2” (don’t divert window.open w/features)