How to prevent bare windows in Firefox and related browsers?
Some websites like to use JavaScript links that open a new window, which lacks any UI except for the address bar. Meaning no extension buttons, search bar, home/back/etc. buttons, bookmarks, tab bar and so on. Opening the link in a new tab/window does not work because the JS fails to work properly.
I encountered this behavior on a private site so I can't link to an example, but if you know one please let me know and I will add it here.
Is there a way to prevent this from happening, and force every window created by JS to have the full interface of a normal Firefox window? Is there a way to get controls back? I believe Chrome for instance has a menu command for it, but I'm not sure about FF.
NB: I am actually on Waterfox but let's answer for Firefox and hopefully it will apply to the forks as well.
Found it: http://kb.mozillazine.org/Prevent_websites_from_disabling_new_window_features
In about:config
find dom.disable_window_open_feature.*
There are quite a few entries here that correspond to the various features that can be disabled/manipulated. Here's the list:
- close: Prevents the close button from being disabled.
- directories: Prevents the bookmarks toolbar from being hidden.
- location: Prevents the address bar from being hidden
- menubar: Prevents the menubar from being hidden.
- minimizable: Prevents popup window minimization from being disabled.
- personalbar: Prevents the bookmarks toolbar from being hidden.
- resizable: Prevents popup window resizing from being disabled.
- scrollbars: Prevents the scrollbars on a popup from being disabled.
- status: Prevents the status bar from being hidden.
- titlebar: Prevents the title bar from being hidden.
- toolbar: Prevents the navigation toolbar from being hidden.
Setting these to true overrides the developers preferences.
Mozilla's online documenation for the Window.open()
web API describes how to make changes within the about:config
Firefox management interface that will help accomplish what you want:
menubar: Mozilla and Firefox users can force new windows to always render the menubar by setting dom.disable_window_open_feature.menubar to true
toolbar: If this feature is on, then the new secondary window renders the Navigation Toolbar (Back, Forward, Reload, Stop buttons). Mozilla and Firefox users can force new windows to always render the Navigation Toolbar by setting dom.disable_window_open_feature.toolbar to true
personalbar: Mozilla and Firefox users can force new windows to always render the Personal Toolbar/Bookmarks toolbar by setting dom.disable_window_open_feature.personalbar to true
titlebar: Mozilla and Firefox users can force new windows to always render the titlebar by setting dom.disable_window_open_feature.titlebar to true
close: Mozilla and Firefox users can force new windows to always have a close button by setting dom.disable_window_open_feature.close to true
Notably, the following preference settings already default to true and don't need to be changed:
dom.disable_window_open_feature.resizable
dom.disable_window_open_feature.location
Also, starting with Firefox 49 the following feature is on by default so the about:config
preference has been removed:
dom.disable_window_open_feature.scrollbars
Source: https://developer.mozilla.org/en-US/docs/Web/API/Window/open