搜尋 Mozilla 技術支援網站

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Prevent new window from hiding addons in toolbar

  • 16 回覆
  • 1 有這個問題
  • 66 次檢視
  • 最近回覆由 jscher2000

more options

Recently, when a popup window appears, the toolbar doesn't have buttons for any of my addons.

In about:config, I'd intentionally set dom.disable_window_open_feature.toolbar to true (following the solution provided in: question 1206512).

Previously, this was successful in ensuring that popup windows got the full toolbar, but now it has stopped working.

I'm not sure exactly which release this started with.

Steps to reproduce:

1) Set dom.disable_window_open_feature.toolbar to true.

2) Visit https://jeffersonscher.com/res/popit.html and follow the third link.

3) The window that pops up has no toolbar icons for the installed extensions.

附加的畫面擷圖

由 philipmgrant 於 修改

被選擇的解決方法

I think this is a change in Firefox 76 to be more consistent with other browsers. (Compat Note)

At least there is a menu button! But yes, it is annoying not to have the full set of tools we prefer.

I'm not yet aware of a workaround. (UPDATE: For an unofficial style rule hack using a userChrome.css file, see #answer-1334817.)

As a possible quick hack when relevant, you can re-launch the page in a new tab:

(1) Open the Web Console by pressing Ctrl+Shift+k

(2) Type or paste

window.open(location.href)

after the >> (or the 1) and press Enter (or click Run) to execute it

I'm sure there are some sites where that won't give you a usable page, but until something better comes along, it's an option for many pages.

If you want to get rid of popup windows and always get a new tab, there is a preference for that. As mentioned on the popit page:

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk.

(2) In the search box in the page, type or paste neww and pause while the list is filtered

(3) Double-click the browser.link.open_newwindow.restriction preference to display an editing field, and change the value to 0 (that's a zero) then press Enter or click the blue check mark button to save the change.

More info on about:config: Configuration Editor for Firefox.

從原來的回覆中察看解決方案 👍 1

所有回覆 (16)

more options

選擇的解決方法

I think this is a change in Firefox 76 to be more consistent with other browsers. (Compat Note)

At least there is a menu button! But yes, it is annoying not to have the full set of tools we prefer.

I'm not yet aware of a workaround. (UPDATE: For an unofficial style rule hack using a userChrome.css file, see #answer-1334817.)

As a possible quick hack when relevant, you can re-launch the page in a new tab:

(1) Open the Web Console by pressing Ctrl+Shift+k

(2) Type or paste

window.open(location.href)

after the >> (or the 1) and press Enter (or click Run) to execute it

I'm sure there are some sites where that won't give you a usable page, but until something better comes along, it's an option for many pages.

If you want to get rid of popup windows and always get a new tab, there is a preference for that. As mentioned on the popit page:

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk.

(2) In the search box in the page, type or paste neww and pause while the list is filtered

(3) Double-click the browser.link.open_newwindow.restriction preference to display an editing field, and change the value to 0 (that's a zero) then press Enter or click the blue check mark button to save the change.

More info on about:config: Configuration Editor for Firefox.

由 jscher2000 於 修改

有幫助嗎?

more options

Thanks very much. I'm very happy for "popups" just to become new tabs in the same window, so I've set browser.link.open_newwindow.restriction to 0, and all is well!

有幫助嗎?

more options

It's been a long week so apologies, but with all due this is an insanely bad move.

This feature was literally THE reason why I used Firefox over Chrome all these years. I realize popups get a bad wrap but consider: I run a software company that creates web forms. When you preview the form you press a save button and a popup appears with your finished form. When developing and for my users it's incredibly helpful to see both the final output (the popup), and the form editor at once.

As these forms can have multiple pages at minimum having easily accessible back / forward control is a must. Gone. Worse, this change also removed the ability for popups to have tabs. I used tabs in popups all the time to perform secondary "research tasks", such as looking up a function call in Stack Overflow, etc. This was a wonderful way to work, as my "main" browser window sat uncluttered as I dutifully worked on my secondary task in the popup. When done a single click closed that "task" and my main browser window was ready to go again.

What's so aggravating is this was a solved issue for years. Give the web developer control over the presentation, and the user the ultimate say via preferences.

Revert this pointless change or loose me as a user.

有幫助嗎?

more options

Hi mattgrdinic, here in support we can suggest settings and workarounds to make Firefox behave the way you want, but we are not the software developers.

To submit feature suggestions, you have many choices, depending on your desired style of interaction. I'll provide a list at the end of this reply.

My understanding of your problem is that Firefox 76 broke your hack to work around the default feature of diverting new windows to a new tab instead. The popup no longer is fully featured. Since you want this particular button/link to launch a fully functional popup, you have several possible alternatives to the hack that involve varying levels of difficulty. However, I think they all start with changing your window.open() code so it doesn't trigger a restricted popup and then:

(A) Turn off the preference to divert new windows to a new tab instead

This is not site-specific. If you need to see both at once and the original window was maximized, you'll need to restore/resize the new popup since it also will be maximized.

(B) Keep the default behavior and after the new tab opens, "detach" the new tab to its own window

You can detach a tab by dragging the tab down from the tab bar over the main toolbar and releasing the mouse. If you need to see both at once and the original window was maximized, you'll need to restore/resize the new popup since it also will be maximized.

(C) Use an extension to create the desired popup

Does the popup have its own URL, i.e., it's not created using document.write()? An extension could detect the opening of the proofing page based on a parameter in the URL (tabs.onUpdated). If it is already in its own window, the extension could resize it as desired. If it's one of many tabs, the extension could create a new window of the desired size (windows.create) and move the page from the current window to that one (tabs.move).

This could be a nice bonus product for your users, and the code probably would be 99% the same between Firefox and Chrome so everyone can benefit.

(D) Redesign your tool to use a framed page for interactive preview instead of a separate window

If your users haven't been clamoring for this and your competitors don't yet offer it, it may not be worth the effort at this point.

Feature Suggestions

Discussion Sites/Advocacy

Limited Length Comments

Bug Tracking System

有幫助嗎?

more options

I appreciate the feedback! From your comments in some of the related issue (1635630) I can see you're well-versed in this change.

The only viable option would be C, but good lord the idea of creating a custom extension to fix something I didn't break....

More generally, I understand the desire to be like the others but just because other browsers behave in this way doesn't mean it's right.

Because of its long and storied history, Firefox had a unique feature that enabled powerful workflows that at worst could be ignored by the vast majority of web users and developers.

While no doubt meaning well, what's distressing is a single engineer could open a bug where he cites two of his own bugs as cases for, asks if it'll create compatibility issues without actually doing to work to see if it would (for real users), and the unilaterally removes the feature we depend on without providing a viable workaround.

This is a great way to loose market share.

I hope being like the other browsers in this one esoteric way is worth it, after more than 15 years you've lost me.

有幫助嗎?

more options

I don't believe all pop-up are evil. I just don't want a crippled browser window opening. This is another sad day for the freedom on Firefox's moment towards open internet... be like everyone else?

can anyone provide information as to other values for these?

       browser.link.open_newwindow: 
       browser.link.open_newwindow.restriction: 
       browser.link.open_newwindow.override.external:

有幫助嗎?

more options

Hi djk44883:

(A) browser.link.open_newwindow - for links in Firefox tabs

This is the one that has a checkbox on the Preferences page:

  • 3 = divert new window to a new tab (default)
  • 2 = allow link to open a new window
  • 1 = force new window into same tab

(B) browser.link.open_newwindow.restriction - for links in Firefox tabs

By default, if a page sets width, height, or toolbars for a popup, Firefox will let it be a separate window. To force those into a tab as well, you can change this preference to 0:

  • 0 = apply the setting under (A) to ALL new windows (even script windows with features)
  • 2 = apply the setting under (A) to normal windows, but NOT to script windows with features (default)
  • 1 = override the setting under (A) and always use new windows

(C) browser.link.open_newwindow.override.external - for links in other programs

  • -1 = apply the setting under (A) to external links (default)
  • 3 = open external links in a new tab in the last active window
  • 2 = open external links in a new window
  • 1 = open external links in the last active tab replacing the current page

To return to normal if things go haywire, there's an arrow-like reset button at the right end of each of those rows if it has a non-default value.

由 jscher2000 於 修改

有幫助嗎?

more options

Wow, this change is unacceptable. Why does Mozilla keep trying to make Firefox bad? It's still better than all of the other options, but they keep adding bad features and removing the good ones.

有幫助嗎?

more options

Jerl said

Wow, this change is unacceptable. Why does Mozilla keep trying to make Firefox bad? It's still better than all of the other options, but they keep adding bad features and removing the good ones.

The developers decided scripted popup windows should work the same in Firefox as other browsers. Why did you like it the way it was before -- was there a particular feature you forced on that is now turned off?

有幫助嗎?

more options

mattgrdinic said

As these forms can have multiple pages at minimum having easily accessible back / forward control is a must.

I forgot to mention there are two ways to go Back/Forward in a limited-feature popup:

  • right-click context menu (blank area of the page)
  • keyboard shortcuts (Windows: Alt+LeftArrow, Alt+RightArrow)

You probably have already found that to be true of other browsers as well.

有幫助嗎?

more options

Why should Firefox work the same as in other browsers? There's a reason I use Firefox - other browsers are terrible. Doing anything at all to try and make Firefox act more like other browsers is going in the wrong direction.

My problem has nothing to do with back/forward - Tridactyl handles those with a single keypress. It's the fact that it stops me from accessing add-on UI elements that are only accessible from icons placed in toolbars. For example, uMatrix or NoScript. If a page sends you to a different domain with a popup to complete some action, the only way to do so is to disable script protection globally. There are lots of other add-ons besides these that can only be accessed via toolbar icons. Besides that, though, I have a big problem with a website being able to tell me what my browser window should look like. If I want to be able to resize, minimize, etc a browser window, that should be my choice as a user. A web developer should not be able to lock me out of any settings that control the browser window itself. Their purview should only be within the webpage viewport.

由 Jerl 於 修改

有幫助嗎?

more options

Hi Jerl, you can launch a NoScript dialog using the right-click context menu.

It would be handy if there were a built-in feature to open all popups as completely normal windows instead of having to tolerate a limited-feature window or divert all popup windows to new tabs instead. I'm not aware of a preference for that. Someone could file a bug.

有幫助嗎?

more options

Interesting. It's been a while since I've used NoScript, so I didn't know about that feature.

That feature isn't present in uMatrix, though, and I'm not going to switch back to NoScript because of Mozilla's mistake.

That's exactly what the dom.disable_window_open_feature.* preferences did. If you enabled all of them, a web developer couldn't force anything about your browser window to be any different from others, all they can do to it is set an initial size which you could then resize to whatever you want. You'd get a normal, full-featured browser window on every popup. Mozilla removed this to "make their browser more like the others", which is a decision I categorically disagree with. Other browsers are moving further and further away from what I want a browser to be, and I would prefer if Firefox didn't follow them

有幫助嗎?

more options

Hi Jerl, you don't need to explain the problem to me. I still have dom.disable_window_open_feature.toolbar set to true in about:config although it no longer does anything. As support forum volunteers, we don't get special access to developers, we have to get in line like everyone else.


Did I post this before? The reason the toolbar buttons are hidden is a built-in style rule. So as an unofficial community developed workaround, you can inject an overriding style rule to make them visible again.

Setting this up is a little bit involved, so please set aside 10 quiet minutes to work through it.

(For anyone who already has a userChrome.css file set up, you just need to add the rule under (A) to your file.)

(A) Select and copy the following style rule code

/* Override Hiding of Toolbar Buttons in Limited Feature Windows */
*|*:root[chromehidden~="toolbar"] .chromeclass-toolbar-additional {
  display: -moz-box !important; /* default is display: none */
}


(B) Generate and download a userChrome.css file

Open the following page and paste the above rules into the editor, replacing the sample rule:

https://www.userchrome.org/download-userchrome-css.html

Then click "Generate CSS File" and save the userChrome.css file to your computer. (See first attached screenshot)

Use the downloads list on the toolbar to open the downloads folder directly to the new userChrome.css file. (See second attached screenshot)

Minimize that file browser window for later reference.

(C) Create a new chrome folder in your profile folder

The following article has the detailed steps for that (#1, #2, and I recommend #3)

https://www.userchrome.org/how-create-userchrome-css.html

I have videos for both Windows and Mac in case the text is not clear.

(D) Move the userChrome.css file you downloaded in Step B into the chrome folder you created in Step C

(E) Set Firefox to look for userChrome.css at startup -- see step #6 in the above article.

The next time you exit Firefox and start it up again, it should discover that file and apply the rule.

Success?

Once you start tweaking the interface this way, you'll probably find more and more things you want to do. I suggest bookmarking the pages where you get the code for future reference because changes to Firefox may break them and it's easier to request an update if you can find the source.

有幫助嗎?

more options

I am aware of user chrome and that it is extremely powerful. I don't feel that I should need to use unofficial measures, whether it's user chrome, addons, compiling my own modified version, or anything else when the functionality existed, but was removed because of a misguided desire to make Firefox behave like other browsers when Firefox NOT behaving like other browsers is what makes it great. The functionality simply should not have been removed. The thing that makes Firefox the best browser is that it gives the user much more control over everything about their browsing experience, but it feels like Mozilla has been trying to take that away. Firefox and its forks are the only browsers left with anything like about:config. Browsers, and software in general, need to move toward being MORE user-configurable with MORE settings, even if most of them are hidden away from normal users who don't want or need them in an advanced settings or configuration file. The current move toward more and more software being less configurable and "easier to figure out" is a mistake.

有幫助嗎?

more options

Hi Jert, support forum volunteers aren't Firefox developers. If you aren't here for support, some ideas on how to provide feedback were listed earlier in this thread: https://support.mozilla.org/en-US/questions/1286994#answer-1313429

有幫助嗎?

問個問題

如果您還沒有帳號,您必須先 登入您的帳號 來回覆文章。請 開始一個新問題