User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:22.214.171.124) Gecko/20060111 Firefox/126.96.36.199 have a page with a a href tag like this: <a href="mypage.html" target="xxx">Click here</a> User can so open it click directly on the iperlink or decide to open in another window/tab. the mypage.html try to get the window.name but this is not correct (i think so) if the page is open in a new window/tab with Firefox 1.x (i try with 188.8.131.52 too). On IE all works fine (and if i remember well also with older version of Mozilla and so maybe with a older version of gecko engine). in every case with IE the window.name return "xxx" either if it's open in the same window or in a new window. Using Firefox instead window.name return "xxx" only if open in the same window. If the user open the linked page using "open in a new window/tab" the window.name value is void. From http://www.w3.org/TR/REC-html40/present/frames.html#h-16.3.2 you can read that : "If an element has its target attribute set to a known frame, when the element is activated (i.e., a link is followed or a form is processed), the resource designated by the element should be loaded into the target frame" So also if the user open the link in a new window, the window name must be the target one.. Reproducible: Always Steps to Reproduce: To reproduce the bug use this html page: TestFirefox.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <HTML dir=""> <HEAD> <META http-equiv="Content-Style-Type" content="text/css; charset="> <META HTTP-EQUIV="Expires" CONTENT="0"> </HEAD> <BODY> <FORM> <a href="TestFirefox2.html" target="main">Click Here</a><br> If you open the link directly the results is correct, <br> istead if you open the link using "open in a new window (or tab)" the window.name is not valid.<br> In every case the value must be equal to the target one (so "main" in this example). </FORM> </BODY> </HTML> TestFirefox2.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <HTML dir=""> <HEAD> <META http-equiv="Content-Style-Type" content="text/css; charset="> <META HTTP-EQUIV="Expires" CONTENT="0"> <SCRIPT> alert("window name:" +window.name); </SCRIPT> </HEAD> <BODY> The alest must show "main" as window name!!! </BODY> </HTML> Actual Results: Now you can execute the TestFirefox.html page. Try it using Firefox and IE. and open the link click directly or using the open in new window or tab. You can see that if you open the link in a new window (e.g. using the context menu) the value on the TestFirefox2.html of window.name is void instead that "main". Expected Results: window.name in TestFirefox2.html must be always equals to the target set in the caller window (so "main")
Assignee: nobody → general
Component: General → DOM: Level 0
Product: Firefox → Core
QA Contact: general → ian
Summary: Open in new window and window.name bug → window.name should reflect link target attribute even if I use e.g. "Open Link in New Tab"
Version: unspecified → 1.8 Branch
data:text/html,<a href="data:text/html,<script>document.write(window.name==='')</script>" target=test>test</a> I can reproduce this still. Seems to work in Chrome too. Middle-click doesn't really change the name of the target window. Not sure if I prefer the Chrome behavior though.
Status: UNCONFIRMED → NEW
Ever confirmed: true
I don't think we should fix this. Safari doesn't do this either. The less names are leaked the better.
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.