Firefox's behavior around window.open features

Basic behavior

Current behavior

Proposed behavior

To align with Chrome, Safari, and new Edge, make each boolean feature just a condition for where to open the link, from:

This change affects web content only. Any window.open call from chrome code still has ability to separately control visibility of each UI part.


Related prefs

browser.link.open_newwindow (int)

Current behavior

Control where to open a link.

Used in nsWindowWatcher::GetWindowOpenLocation

ValueMeaning
1 Open the link in the current tab.
2 Open the link in a new tab in a new window.
3 (default) Open the link in a new tab in the current window.

Proposed behavior

If the target browsing context isn't opened in popup (IsPopup returns false), open it in the specified place.

browser.link.open_newwindow.restriction (int)

Current behavior

Restrict where the new window can be opened

Used in nsWindowWatcher::GetWindowOpenLocation

ValueMeaning
0 Always use `browser.link.open_newwindow` value.
1 Always open the link in a new window.
2 (default) If some feature is specified, open the link in a new window. Otherwise use `browser.link.open_newwindow` value.

Proposed behavior

Keep the same behavior.

browser.link.open_newwindow.disabled_in_fullscreen (bool)

Used in nsWindowWatcher::GetWindowOpenLocation

Current behavior

  1. If the current window is in fullscreen, then:
    1. If browser.link.open_newwindow is 2 (new window), then:
      1. Override the pref value with 1 (current tab)
    1. Override browser.link.open_newwindow.restriction value with 0 (No restrictions)

Proposed behavior

Keep the same behavior.

dom.disable_window_open_feature.* (bool)

Current behavior

Allow/disallow each feature.

Used in nsWindowWatcher::CalculateChromeFlagsHelper

Introduced by Bug 107949

PrefDefaultHas effect?
dom.disable_window_open_feature.toolbar Allowed by default Has effect
dom.disable_window_open_feature.menubar Allowed by default Has effect (not on macOS, menu is always available)
dom.disable_window_open_feature.personalbar Allowed by default Has effect
dom.disable_window_open_feature.minimizable Allowed by default Has no effect, minimize button is always available
dom.disable_window_open_feature.location Disallowed by default Has effect
dom.disable_window_open_feature.resizable Disallowed by default Has effect
dom.disable_window_open_feature.status Disallowed by default Has no effect, status panel is always available.
dom.disable_window_open_feature.titlebar Disallowed for content Has no effect, disallowed for content
dom.disable_window_open_feature.close Disallowed for content Has no effect, disallowed for content

Proposed behavior

They are ignored.