471,073 Members | 1,419 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,073 software developers and data experts.

Safari issue with self.close

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
7 10351
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
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
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
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
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
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
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.

Similar topics

3 posts views Thread by Marcia Gulesian | last post: by
1 post views Thread by Limbo | last post: by
2 posts views Thread by gokhvat | last post: by
5 posts views Thread by =?gb2312?B?yMvR1MLkyNXKx8zs0cSjrM37vKvM7NHEsru8+7z | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.