Closed Bug 1119328 Opened 10 years ago Closed 7 years ago

window.open() doesn't open a new tab anymore

Categories

(Core :: DOM: Core & HTML, defect)

34 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: areichelt, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 Steps to reproduce: Since v34, window.open() doesn't open a new tab anymore on many of our machines. If I downgrade to Firefox v32 using the same user profile, it works like expected. Also, if we develop applications using Visual Studio, since upgrading to v34 new debugging sessions open in the active tab instead of opening a new tab. Here's the source code: var win = window.open('http://rot-s-anwsrv2:56024/Default.aspx?Kdnr=' + kundennummer, '_blank'); win.focus(); Actual results: Instead of opening a new tab, the page loads in the active tab. Expected results: It should open a new tab.
Flags: needinfo?(areichelt)
(In reply to Josh Matthews [:jdm] from comment #1) > Do you see a difference in behaviour if you use safe mode? > https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe- > mode#w_how-to-start-firefox-in-safe-mode Still the same behavior. I'm using the beta channel on this machine, by the way, so v35.
Flags: needinfo?(areichelt)
In the profiles where the problem is happening what are the values of the following preferences in about:config: browser.link.open_newwindow browser.link.open_newwindow.restriction ?
Flags: needinfo?(areichelt)
(In reply to Boris Zbarsky [:bz] from comment #3) > In the profiles where the problem is happening what are the values of the > following preferences in about:config: > > browser.link.open_newwindow > browser.link.open_newwindow.restriction > > ? "1" and "2"
Flags: needinfo?(areichelt)
Well, there's your problem. The defaults, and the comments describing what the values mean, are: // handle links targeting new windows // 1=current window/tab, 2=new window, 3=new tab in most recent window pref("browser.link.open_newwindow", 3); and // 0: no restrictions - divert everything // 1: don't divert window.open at all // 2: don't divert window.open with features pref("browser.link.open_newwindow.restriction", 2); so your problem is that someone set "browser.link.open_newwindow" to 1, when the default value is 3. You said that in Firefox 32 things work correctly. Is that using the same pref values? Because I just tried Firefo 32 with "browser.link.open_newwindow" set to 1, and I see it working as expected: window.open targets the same window instead of creating a new tab or window.
(In reply to Boris Zbarsky [:bz] from comment #5) At least both settings are not fat, therefore I estimate that they are set to default. Normally, changed values appear in fat. However, if I fire up my v32 test instance, I get 3 and 2 instead. That's weird. Were there any changes to the default values in v34? I have no idea where those wrong values are coming from!
Do you happen to have some addons installed?
> Were there any changes to the default values in v34? No. The last time the default value of "browser.link.open_newwindow" was changed was in March 2006. The last change to the default value of "browser.link.open_newwindow.restriction" was in October 2005. So let's think about where the values are coming from. There are the following possible places: 1) Some .js file (all.js, firefox.js, others?) in the browser install location. 2) Some .js file (e.g. prefs.js) in the profile. I'd be quite interested in knowing which of those files contain the string "browser.link.open_newwindow" in your case.
(In reply to Boris Zbarsky [:bz] from comment #8) > So let's think about where the values are coming from. There are the > following possible places: > > 1) Some .js file (all.js, firefox.js, others?) in the browser install > location. There are only 2 .js files in my install folder, channel-prefs.js and local-settings.js, but they are both just a few bytes big and neither of them contains the mentioned setting. However, local-settings.js contains the following line: pref("general.config.filename", "mozilla.cfg"); And it seems that this file is responsible for the misbehavior (lines 36–38): // New pages should be opened in: a new tab defaultPref("browser.link.open_external", 1); defaultPref("browser.link.open_newwindow", 1); Seems like the solution, right? > 2) Some .js file (e.g. prefs.js) in the profile. I changed the setting manually to verify your approach, so this one now says 3.
(In reply to Olli Pettay [:smaug] from comment #7) > Do you happen to have some addons installed? A few, but nothing of importance. I also tested it in safe mode and I still had the issues.
> pref("general.config.filename", "mozilla.cfg"); Ah, that's the preference for setting up preference autoconfig stuff. That said, I see no mention of "local-settings.js" anywhere in our codebase. We do ship a channel-prefs.js but not a local-settings.js. So where is that local-settings.js file coming from for you, and where is the mozilla.cfg file it pulls in coming from?
(In reply to Boris Zbarsky [:bz] from comment #11) > > pref("general.config.filename", "mozilla.cfg"); > > Ah, that's the preference for setting up preference autoconfig stuff. Yes, seems like our admins made a mistake there. I'll talk to the person in charge asap and tell you if it worked afterwards. I already want to thank you for your help!
After reading the bug I guess that this is wfm.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.