Closed Bug 302033 Opened 19 years ago Closed 15 years ago

window.open open a new window instead of refreshing an existing one when launched from an https popup

Categories

(Firefox :: General, defect)

1.0 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: fplante, Unassigned)

References

()

Details

Attachments

(1 file, 3 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

I discovered this problem when working with a online payment system.
Here is how i could find what was going wrong :
I've got a Web page ( ex: http://www.myserver.com/page1.htm ) with a button.

This webpage is called "Main" trough that javascript code :
<script type="text/javascript">self.name = 'Main';</script>

When you click the button it open a pop up window with an url like  :
https://www.paymentsytem.com/foo.html

on this popup ya fill in some information then submit the form, after that the
popup launch the following window.open :
<script type="text/javascript">
window.open('http://www.myserver.com/page2.htm','Main','menubar=1,toolbar=1,location=1,status=1,scrollbars=1');
</script>
Logically, Firfefox should show that Url in the 1st opened window, called
'Main', but in my case it opens a new window with that url, it acts as it don't
"recognize" that a window called "Main" is already opened...

This happens ONLY if my popup is in https, otherwise it works fine and
refreshing the existing window "Main".

I made a lot of tests, but could not reproduce because i'm not able to setup an
https server just to test that.


This bug only affects Firefox > 1.0.1.. It's quite annoying in my case because a
lot of website i made with that payment solution doesn't work well anymore..

Sorry for my bad english..

Reproducible: Always

Steps to Reproduce:
You need 2 web servers, server1 in http, server2 in https

1. On page1.html on server 1 put that code :
 <html>
 <head>
 <title>Page 1</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 </head>
 <body>
 <script type="text/javascript">
 self.name='Main';
 </script>
 <p>Page 1</p>
 <input type="button" name="Button" value="Button"
onclick="window.open('https://www.server2.com/popup.html', 'popup',
'width=530,height=420,status=no,resizable=yes,top=200,left=200,scrollbars=yes');"
/> 
 </body>
 </html>
 
2. On page2.html on server 1 put that code :
 <html>
 <head>
 <title>Page 2</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 </head>
 <body>
 <p>Page 2</p>
 </body>
 </html>
 
3. On popup.html on server2 put that code :
 <html>
 <head>
 <title>https Popup</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 </head>
 <body>
 <p>Https Popup Window</p>
 <script type="text/javascript">
 setTimeout("window.open('http://www.server1.com/page2.html', 'Main',
'width=530,height=420,status=no,resizable=yes,top=200,left=200,scrollbars=yes');",3000);
 </script></body>
 </html>

4. With a Firefox >= 1.0.1 go to http://www.server1.com/page1.html, click the
button to open the popup and see the bug..
Actual Results:  
It open a new firefox window to that url : http://www.server1.com/page2.html

Expected Results:  
it shoud have refresh the first window called 'Main' to that Url :
http://www.server1.com/page1.html
Sorry, i made an error in the description,

in expected results, you should have read :

Expected Results:  
it should have refresh the first window called 'Main' to that Url :
http://www.server1.com/page2.html
I think I see this on some websites too.
When I get a new PM, a popup appears to let me know, with a dialog saying "click
here to read your msg" or whatever.
But when I click the link, the message opens up in the (small) window where
notification occured, rather in the main browser window that triggered the popup
in the first place.
Reporter, can you make and attach a testcase to show this behaviour if it is
possible? The 'Create new attachment' will let you attach various types of files.
(In reply to comment #2)
> I think I see this on some websites too.
> When I get a new PM, a popup appears to let me know, with a dialog saying "click
> here to read your msg" or whatever.
> But when I click the link, the message opens up in the (small) window where
> notification occured, rather in the main browser window that triggered the popup
> in the first place.

The problem you describe is not the same as mine i think.
When window.open(Url, WinName) is executed, the browser should first look if a
window called WinName already exists. If yes the browser refresh the existing
window to that Url, if not, the Browser open a new window with Url as location.

This Behaviour is correct and works fine when the window.open is executed from a
page hosted on an http server.

When window.open is executed from a page hosted on an https server, the browser
will not find the window called WinName, if the Url in that existing window is
"http://something", and then it always open a new window instead of refreshing
the existing one called WinName.
(In reply to comment #3)
> Reporter, can you make and attach a testcase to show this behaviour if it is
> possible? The 'Create new attachment' will let you attach various types of files.

I can't make a testcase as you need an https server to test that behaviour
Fortunately, bugzilla uses https:// for everything, including its attachments.
Attached file https popup testcase (obsolete) —
Attached file https popup testcase #2 (obsolete) —
Attachment #190534 - Attachment is obsolete: true
Attached file https popup testcase #3 (obsolete) —
Attachment #190535 - Attachment is obsolete: true
Attachment #190536 - Attachment is obsolete: true
(In reply to comment #6)
> Fortunately, bugzilla uses https:// for everything, including its attachments.

Ok, i succeded making a testcase, thanks Steve..

1 - Close all yr Firefox windows and open a new one
2 - Go to http://www.fredsattitude.net/page1.html
3 - You'll be able to see the wrong behaviour, in the https case it opens a new
window  (wrong), in http it refreshs the existing one(correct)
This bug was reported on Firefox 2.x or older, which is no longer supported and will not be receiving any more updates. I strongly suggest that you update to Firefox 3.6.3 or later, update your plugins (flash, adobe, etc.), and retest in a new profile. If you still see the issue with the updated Firefox, please post here. Otherwise, please close as RESOLVED > WORKSFORME
http://www.mozilla.com
http://support.mozilla.com/kb/Managing+profiles
http://support.mozilla.com/kb/Safe+mode
Version: unspecified → 1.0 Branch
No reply, INCOMPLETE. Please retest with Firefox 3.6.3 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INCOMPLETE
No reply, INCOMPLETE. Please retest with Firefox 3.6.3 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: