By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,739 Members | 1,081 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,739 IT Pros & Developers. It's quick & easy.

Safari issue with self.close

P: n/a
Hi,

I have a page that has a button "Exit and Close", which closes the
popup window that it has opened. This works fine under IE, NN, FF and
Opera but not Safari. Any ideas why? I even tried checking the
self.name property and this is returned blank in Safari. Any help
would be appreciated.

Cheers

Feb 28 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
al******@gmail.com wrote:
Hi,

I have a page that has a button "Exit and Close", which closes the
popup window that it has opened. This works fine under IE, NN, FF and
Opera but not Safari. Any ideas why? I even tried checking the
self.name property and this is returned blank in Safari. Any help
would be appreciated.
Did you try window.close()?
Feb 28 '07 #2

P: n/a
On Feb 28, 2:31 pm, Harlan Messinger
<hmessinger.removet...@comcast.netwrote:
Did you try window.close()?
Yeah, same problem. Thing is that the self.close() seems to work on
some pages but not others......no idea why!?


Feb 28 '07 #3

P: n/a
al******@gmail.com wrote:
Thing is that the self.close() seems to work on
some pages but not others......no idea why!?
Don't know about Safari, but last time I tested many browsers would not
allow window closure via script if the window had any history. Maybe
this would explain the discrepancy?

Osmo
Mar 1 '07 #4

P: n/a
On Mar 1, 5:08 am, Osmo Saarikumpu <o...@weppipakki.comwrote:
Don't know about Safari, but last time I tested many browsers would not
allow window closure via script if the window had any history. Maybe
this would explain the discrepancy?
Thats interesting, but I checked it out and the other windows that
would close also have a history, so I guess thats not it.
Mar 1 '07 #5

P: n/a
On Mar 1, 5:08 am, Osmo Saarikumpu <o...@weppipakki.comwrote:Don't know about Safari, but last time I tested many browsers would not
allow window closure via script if the window had any history. Maybe
this would explain the discrepancy?
Funny, adding the window-features property did the trick....window-
features="menubar=no,scrollbars=yes,resizable=yes, width=700,height=450"
anyone know why this would happen?

Mar 1 '07 #6

P: n/a
al******@gmail.com wrote:
>On Mar 1, 5:08 am, Osmo Saarikumpu <o...@weppipakki.comwrote:Don't know about Safari, but last time I tested many browsers would not
allow window closure via script if the window had any history. Maybe
this would explain the discrepancy?

Funny, adding the window-features property did the trick....window-
features="menubar=no,scrollbars=yes,resizable=yes, width=700,height=450"
anyone know why this would happen?
Perhaps to keep malicious websites from closing windows that don't
"belong" to them, Safari doesn't let scripts close "ordinary" browser
windows opened without any special configuration parameters, but
considers windows opened with feature specifications to be special
windows that "belong" to the app and that the script is entitled to
close. This would extend further the protection offered by other
browsers that won't honor window.close() on a browser that was opened by
the user instead of by script.
Mar 1 '07 #7

P: n/a
al******@gmail.com wrote :
On Feb 28, 2:31 pm, Harlan Messinger
<hmessinger.removet...@comcast.netwrote:
>Did you try window.close()?

Yeah, same problem. Thing is that the self.close() seems to work on
some pages but not others......no idea why!?
New windows not opened by javascript can not as a rule be closed by
JavaScript.
http://developer.mozilla.org/en/docs...indow.open#FAQ

dom.allow_scripts_to_close_windows
False (default): Only windows opened via script may be closed via close().
http://kb.mozillazine.org/about:config_entries#DOM..2A

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Mar 4 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.