Last Comment Bug 278429 - doesn't work in app suite and that pref isn't exposed in UI
: doesn't work in app suite and that pref isn't e...
Product: SeaMonkey
Classification: Client Software
Component: Preferences (show other bugs)
: Trunk
: x86 Linux
-- normal with 3 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
Depends on:
  Show dependency treegraph
Reported: 2005-01-14 12:31 PST by Akkana Peck
Modified: 2010-06-09 04:44 PDT (History)
12 users (show)
dbaron: blocking1.8b-
kairo: blocking‑seamonkey1.0a-
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

test case (237 bytes, text/html)
2005-01-16 20:14 PST, Akkana Peck
no flags Details

Description User image Akkana Peck 2005-01-14 12:31:38 PST
In 1.8a6, links with target=_blank are popping up new windows, even though I
have browser.block.target_new_window=true.
Comment 1 User image sairuh (rarely reading bugmail) 2005-01-14 12:52:05 PST
could this be due to the merge of 172962 to the trunk? (referring to bug 172962
comment 218; see also bug 274143 for Camino.)
Comment 2 User image Akkana Peck 2005-01-14 14:30:52 PST
I read the bugs sairuh referenced, and a few other bugs mentioned; I see lots of
requests for docs but there's still nothing in the release notes under "new" or

I tried
user_pref("", 1); // OPEN_CURRENTWINDOW
since that seemed like the most obvious pref name and the most obvious idl
symbol, but it didn't help, target=_blank still opens in a new window.

It looks like the relevant code is here:
and the values it uses are here:

However, it looks like openURI, if passed aWhere==OPEN_NEWWINDOW, doesn't check
any prefs at all, and immediately proceeds to open up a new window.  If
aWhere==OPEN_DEFAULTWINDOW, then it does check prefs, and might replace aWhere;
the first clause is checking, which makes sense, but
then for internal links it checks  So the pref is for links with aWhere ==
nsCI.nsIBrowserDOMWindow.OPEN_DEFAULTWINDOW and aContext != OPEN_EXTERNAL, not
for links with aWhere == OPEN_NEWWINDOW.

What is aWhere?  The only documentation for it in nsIBrowserDOMWindow.idl is
"see possible values described above".  Does it reflect the target=whatever on
the link, or something else?

There's also one other pref that looks like it might be relevant:  The only code which uses it is here:
but it baffles me so I can't guess what the right value would be (and do I want
to "divert", "not divert", or "divert with features"?  What are the features?)
So I tried exhaustive search, trying 1 and 2 (default was 0), but in each case a
target=_blank link still opened in a new window.

I'm out of ideas.  Do these prefs actually work?  What do the settings mean?
Comment 3 User image Dan M 2005-01-16 17:57:46 PST
Build date? Testcase? Duplicate of one of the other four invalid or duplicate
target_new_window bugs?
Comment 4 User image Akkana Peck 2005-01-16 20:07:53 PST
I need a build date for "1.8a6"?  Sorry, I assumed that there was only one
release by that number.  It's "Build ID 2005011116", "Mozilla/5.0 (X11; U; Linux
i686; en-US; rv:1.8a6) Gecko/20050111", from the full installer.

Testcase: I'll attach an html file with a target=_blank link.  I didn't before
because I assumed there were tons of those floating around already.

Dup?  I don't know.  I assume it's related to the bugs sairuh mentioned, and
some of the others linked therefrom, but I didn't see a bug that specifically
covers this issue in the suite.  There may well be a bug open on this issue
which I haven't found.
Comment 5 User image Akkana Peck 2005-01-16 20:14:03 PST
Created attachment 171466 [details]
test case

Set the pref browser.block.target_new_window to true, so that new windows
should be blocked, then click on the "target _blank" link.  A new window pops
Comment 6 User image sairuh (rarely reading bugmail) 2005-01-16 20:26:44 PST
related to (or dup) of bug 78037?
Comment 7 User image Akkana Peck 2005-01-16 20:55:32 PST
Bug 78037 seems to be on exposing the pref in the prefs UI, though the summary
doesn't make that clear.  The pref itself has been in place for years and
working fine, until now.
Comment 8 User image Dan M 2005-01-16 21:46:46 PST
OK, the actual 1.8a6 build. (When *I* say 1.8a6 build, I generally mean
something later than the official release, and currently there is some suspicion
that something of this regressed in 20050112 builds.) And I wanted to see a
testcase to see if you were doing something tricky. Basically I was curious to
see whether this was some variant of bug 278143.

But I see none of that applies. browser.block.target_new_window is now obsolete.
You want See See also bug 276335 which by the
way is the most obvious choice of bugs to dupe this one against.

Yes the Aviary branch landing damaged the Suite's single window mode
capabilities. However the piece of SWM that covers the old target_new_window is
functional in the Suite on the trunk. The new pref works for me using the
official WinXP 1.8a6 build.
Comment 9 User image Akkana Peck 2005-01-16 23:14:35 PST
Yikes!  Playing around some more with the value of that preference, I discovered
two things: (1) When set to 1, I wasn't seeing any change before because the
test page has to be reloaded after changing the pref, in order to see any
difference in behavior, and (2) I had been setting the pref in user.js, which is
being completely ignored.

My user.js line looked like this:
user_pref("", 1);
yet when I restarted mozilla, visited about:config and limited to "newwindow",
the setting was still 2, the default.

Is there a known regression reading user.js?  I didn't find anything searching

Anyway, it looks like when I set to 1 in
about:config, then hit reload on the test page, the link opens in the current
window, like the old pref.  If I set the pref to 3, though, it still opens in a
new window, not a new tab (same thing if it's set to 2).  What am I missing?

BTW, I don't suppose there's any way to have target=xxx open in the current
window, but open in a new tab, by any chance?  I'm trying to grok
what does from the terse comment in
customizing.html; and that page doesn't mention or
2 at all.  I can update that page if I can find out what these prefs actually do
and what the legal values are.
Comment 10 User image Dan M 2005-01-18 10:49:12 PST
> (1) ...I wasn't seeing any change before because the
> test page has to be reloaded after changing the pref

That's odd. The old code, the code that used the obsolete pref, required the
page to be reloaded before a change would take effect. The new code does not
cache the pref and indeed, changes take effect immediately in my testing. I'm
using Windows Firefox but the code is in Docshell, where it should be ignorant
about platforms and clients.

> Is there a known regression reading user.js?

None that I know of. user.js prefs behave as expected for me, even with this pref.

> If I set the pref to 3, though, it still opens in a
> new window, not a new tab

That's likely part of the damage to the Suite from the Aviary branch landing
that hasn't been sorted out.

> ...any way to have target=xxx open in the current
> window, but open in a new tab...?

We don't provide any way to distinguish behaviour at that level.

> I can update [customizing.html] if I can find out what these prefs actually do
> and what the legal values are.

I would have added it myself but it seemed out of place to me in a document that
lists favorite settings but doesn't enumerate them. Perhaps would have been a better document to


So where are we? Is this a bug or not? I don't understand the problem you're
having with pref cacheing. But it seems to me that outside of that issue, which
would be a separate bug anyway, we've settled that this is in fact a duplicate
of bug 276335. There are also other bugs like bug 276808 and bug 278867. Really
I expect the only part that does work well is what was once target_new_window.
Comment 11 User image Akkana Peck 2005-01-18 11:31:19 PST
Perhaps it's a dup of 278867, though someone searching for the bug would never
find that one, and it's assigned to nobody.

What about the release notes?  There's still no mention of this popular pref's
replacement in the release notes, nor is there documentation anywhere of the
legal values for the new prefs or how to duplicate the old behavior.  The
closest thing to documentation is a line in customizing.html, describing a
setting which doesn't actually work (  Is there
already a bug covering these documentation issues?  That's definitely part of
this bug: "How can people who used the old pref find out what they need to change?"

> Perhaps
> would have been a better
> document to name.

I'm not seeing any documentation of the open_newwindow options there either,
though it does have information about the values of open_newwindow.restriction.

I'll investigate the user.js problem and probably file a separate bug.
Comment 12 User image Dan M 2005-01-18 12:10:29 PST
Any relation of this bug to 278667 would be as a dependency, not a duplicate. I
can't find a distinction between this bug and 276335, now that we've determined
they're the same, disregarding some ancillary issues that might want their own bugs. is supposed to be surfaced in the actual UI. Values
are from nsIBrowserDOMWindow, though 0 is nonsensical as a pref setting. The
...restriction pref is in contrast a geek tweak that's not necessarily supposed
to be in the UI, and so it lives happily in the tips document. 1.8a6 release
notes should probably have brought this up though, pending a UI that would make
the grungy details moot.

> [customizing.html]... describing a
> setting which doesn't actually work (

Good point. It does work in Firefox, though.
Comment 13 User image David Baron :dbaron: ⌚️UTC-8 2005-02-18 12:04:02 PST
too late for 1.8b1, transferring request to 1.8b2
Comment 14 User image ChrisX 2005-03-01 02:12:49 PST
All I can say is that browser.block.target_new_window worked in 1.8a4 on the
Mac. When I went to 1.8b yesterday, I immediately noticed the broken function. I
would very much request this to be fixed in 1.8b2 because I am so much used to
tabbed browsing by now, and creating new windows is irritating when you don't
expect it, especially on the Mac where you don't have a startbar to switch
between them. Additionally, the new window is lowered, with the result that the
 status bar at the bottom is below the edge of the display (1ß24x768) and thus
Comment 15 User image ChrisX 2005-03-01 02:32:07 PST
I am sorry, I didn't read the comments closely enough. set to 1 in about:config actually restores the
functionality, and also sticks after quitting the browser. Problem solved (or
workedaround); but it's confusing that browser.block.target_new_window is still
present in about:config although it's obsolete (i.e. does nothing anymore).
Comment 16 User image Robert Kaiser 2005-03-29 16:42:56 PST
We're not holding an alpha release for a non-working hidden pref, I think. Would
be nice to see a patch though...
Comment 17 User image Akkana Peck 2005-11-02 12:27:23 PST
I think this summary reflects the remaining two problems as discussed in the comments.
Comment 18 User image Serge Gautherie (:sgautherie) 2008-06-11 15:03:26 PDT
(Filter "spam" on 'prefs-nobody-20080612'.)
Comment 19 User image Philip Chee 2010-06-09 04:44:20 PDT
browser.block.target_new_window is not present in comm-central

Note You need to log in before you can comment on or make changes to this bug.