Closed Bug 174266 Opened 22 years ago Closed 20 years ago

links opening blank new window but content showing in current window if browser.block.target_new_window

Categories

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

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.8alpha3

People

(Reporter: jmd, Assigned: bzbarsky)

References

Details

(Keywords: fixed-aviary1.0, fixed1.7.5)

Attachments

(2 files)

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/gnapster/gnapster/ChangeLog Click the link at the top, "1.7" http://themes.freshmeat.net/browse/920/?topic_id=920 Click the first screenshot. Both cases, a blank new window is opened, but the screenshot or changelog is loaded in the old window. Linux 2002101305 but this is a very old bug. See it at many different sites. May be affected by these in my user.js: user_pref("browser.block.target_new_window", true); user_pref("dom.disable_open_click_delay", 1000); user_pref("capability.policy.default.Window.onunload", "noAccess");
> user_pref("browser.block.target_new_window", true); Does removing that affect the behavior? Because that link on the sourceforge page does: <a href="/cgi-bin/viewcvs.cgi/*checkout*/gnapster/gnapster/ChangeLog?rev=1.7" target="cvs_checkout" onClick="window.open('about:blank', 'cvs_checkout', 'resizeable=1,scrollbars=1')" > We execute the JS but we disallow the retargeting because of that pref, I bet... (and that is such a _stupid_ way to write a link!)
Another major site where this is happening. Survey at: http://www.popsci.com/popsci/aviation/article/0,12543,365576-4,00.html Rather different code though: <form method="post" action="http://www.pathfinder.com/gdml.dyn" target="_blank" onsubmit="openTarget (this, 'width=350,height=600,resizable=1,scrollbars=1'); return true;">
Netscape webmail used to do this all the time too when you clicked on Preferances, but it seems OK now. Should this bug be moved to evang?
Same problem on laposte.net (French Post Office webmail) using last night's build. This happens even with everything allowed in "Scripts and Plugins". As far as I can tell the bug appeared with 1.2a or 1.2b (but I skipped everything between 1.0rc2 and 1.2a).
Gone fishing some previous versions... for me, bug is absent in 1.1 (Aug 26), and shows up in 1.2a (Sept 11), if this can help.
Related/dependes on bug 64560? Since this seems to be caused by window.open I am sending this to DOM Level 0 (where bug 64560 also lives). This happens on win too (2002110708), changing OS to All.
Assignee: asa → jst
Component: Browser-General → DOM Level 0
OS: Linux → All
QA Contact: asa → desale
...and on macs, HW->All
Hardware: PC → All
I've encountered this bug only with user_pref("browser.block.target_new_window", true); With this pref set to false, the bug disappears, i.e. instead of opening an empty window it opens a window that contains the new page. I have neither user_pref("dom.disable_open_click_delay", 1000); nor user_pref("capability.policy.default.Window.onunload", "noAccess"); (about:config doesn't even list them. Do they exist in 1.3?)
Mass-reassigning bugs to dom_bugs@netscape.com
Assignee: jst → dom_bugs
*** Bug 206831 has been marked as a duplicate of this bug. ***
Attached file simple testcase
this uses freshmeat's target=screenshot, window.open('', 'screenshot', ...) bit, that should open mozilla.org in the popup.
I tried the testcase: clicking on the link loads mozilla.org into the popup. WORKSFORME Mozilla 1.8a2 build 2004061308 and Firefox 0.9 build 20040614 rv:1.7 under XP Pro SP1a here.
I also tried the testcase at http://www.kaosol.net/~ziz/formtarget.html (see bug 206831) and it WORKSFORME with Moz 1.8a2.
WFM 1.7 final win2k
Nothing has changed here... My testcase and the test in comment 13 still open the content in the main browser window rather than the popup. Changing the browser.block.target_new_window pref (back to false) in about:config did nothing for me, I had to restart for things to work as they should.
Resolving as WORKSFORME then
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → WORKSFORME
It's either invalid, or evang, but not WFM. Behavior is still the same. This bug still makes surfing with browser.block.target_new_window rather unpleasant, which is the opposite of its intended effect. :(
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Blocks: 245971
Attached patch Proposed patchSplinter Review
Comment on attachment 152987 [details] [diff] [review] Proposed patch Danm, could you review? The short of it is that the second arg to FindItemWithName is used internally by that method to prevent infinite recursion. If it's set, that call to the method will NOT ask the window watcher for targets, hence will not find targets in different windows. So toplevel entry points into FindItemWithName should really pass in null for the second arg...
Attachment #152987 - Flags: review?(danm.moz)
Comment on attachment 152987 [details] [diff] [review] Proposed patch As you said, the point of this argument is to prevent a recursive search from re-entering places it's already been. Beginning a fresh search with anything but null for that parameter looks like an error to me. Now about the hackish nature of this whole section of code...
Attachment #152987 - Flags: review?(danm.moz) → review+
Summary: links opening blank new window but content showing in current window → links opening blank new window but content showing in current window if browser.block.target_new_window
Yeah, we really need to combine this with the windowwatcher OpenWindowJS code better...
Comment on attachment 152987 [details] [diff] [review] Proposed patch jst, would you sr?
Attachment #152987 - Flags: superreview?
Attachment #152987 - Flags: superreview? → superreview?(jst)
Comment on attachment 152987 [details] [diff] [review] Proposed patch sr=jst
Attachment #152987 - Flags: superreview?(jst) → superreview+
Assignee: general → bzbarsky
Status: REOPENED → NEW
Target Milestone: --- → mozilla1.8alpha3
I don't know about anyone else, but I'd sure like to have this in Firefox 1.0 (hint, hint)... ;) Thanks for all your work guys.
Fixed on trunk.
Status: NEW → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → FIXED
Comment on attachment 152987 [details] [diff] [review] Proposed patch I feel that this simple fix is worth taking on branch (and once again I'll need someone for the aviary checkin....)
Attachment #152987 - Flags: approval1.7.2?
Attachment #152987 - Flags: approval-aviary?
Comment on attachment 152987 [details] [diff] [review] Proposed patch a=mkaply for 1.7.2
Attachment #152987 - Flags: approval1.7.2? → approval1.7.2+
Fixed on branch.
Keywords: fixed1.7.2
This still needs aviary landing.
No, it needs aviary _approval_. Then someone with an aviary tree can land it.
Comment on attachment 152987 [details] [diff] [review] Proposed patch a=asa (on behalf of aviary drivers) for checkin to the aviary branch.
Attachment #152987 - Flags: approval-aviary? → approval-aviary+
Checked in on aviary by rjkeller.
Keywords: fixed-aviary1.0
V w/ Gecko/20040804 Firefox/0.9.1+. Nice fix! Nothing beats receiving e-mails with the strings "X-Bugzilla-Reason: Reporter" and "Keywords Added fixed-aviary1.0".
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: