How to make Back/Forward button to show on pop up window
w3school'd doc, https://www.w3schools.com/jsref/met_win_open.asp, indicates that FF supports "toolbar=yes" option for window.open method. I used the following code to open a pop up window.open("https://xyz", "_blank", "toolbar=yes,menubar=yes,width=500,height=600,top=300,left=50" ) The pop up opens but without toolbar or menubar. The window size and location work. I want to have the Back and Forward button to show up on the pop up window. How to do that? I tested this on FF 78.0.2 (64-bit) on Windows. Also like to make this to work on firefox-52.8.0 on Linux. Thanks to anybody who can give me a hint.
Kaikki vastaukset (5)
That is not possible if you open a standalone pop-up window. This window only shows a read-only location bar. You would have to divert the pop-up window to a new tab.
For links opened via JavaScript you can look at this pref:
- browser.link.open_newwindow.restriction = 0
- https://searchfox.org/mozilla-release/source/browser/app/profile/firefox.js#442
- https://support.mozilla.org/en-US/kb/about-config-editor-firefox
Thanks for the quick response. I set browser.link.open_newwindow.restriction = 0 in about:config. But the pop up opened by javascript window.open still does not honor toolbar=yes parameter. This doc seems to indicate it should. http://kb.mozillazine.org/Browser.link.open_newwindow.restriction Possible values and their effects 0 Divert all links according to browser.link.open_newwindow. (Default in Firefox 1.0.x and SeaMonkey 1.0 to 2.1a2) This includes: All HTML links with target="_blank". All JavaScript calls to window.open().
This doc clearly said if browser.link.open_newwindow=2, it will not honor 3rd parameter of window.open().
That doc on mozillaZine is outdated. They have recently changed the behavior and ignore all parameters passed to window.open() when you do not divert always.
- Bug 1507375 - Can we drop window.open's feature parameter which controls UI parts visibility? [76]
This should still work:
- browser.link.open_newwindow = 3
- browser.link.open_newwindow.restriction = 0
browser.link.open_newwindow = 3
browser.link.open_newwindow.restriction = 0
These basically change pop up to new Tab.
Just curious, is not honoring toolbar=yes a design choice or to be implemented in the future? If a design choice, what's the reason? Thanks.
Starting with Firefox 76, it will no longer be possible to control the browser’s user interface elements with certain window features such as menubar, personalbar and toolbar, which were only supported by Firefox and IE. This change aims not only to align with other modern browsers but also to avoid unexpected behaviours due to UI customization or session restore.
These window features continue to be used as conditions for Firefox to decide whether to open a new tab or popup window.
See bug 1507375.