MozillaZine

Scripts may not close windows that were not opened by scrip

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
harilal

User avatar
 
Posts: 5
Joined: October 20th, 2014, 7:18 am

Post Posted October 20th, 2014, 7:33 am

Hi Fire Fox Team,
We are getting an error
"Scripts may close only the windows that were opened by it" while using the code

window.open('','_self').close(); (or what ever the code that i got by goggling for closing the window)

and it's calling in the on load script using "window.onload=closeBr;"

We want to auto close the browser when user log out .

Is there any solution for this issue?

-Thanks & Regards,
Harilal.A.S.

patrickjdempsey

User avatar
 
Posts: 23734
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC

Post Posted October 20th, 2014, 8:45 am

harilal wrote:We want to auto close the browser when user log out .

Is there any solution for this issue?

-Thanks & Regards,
Harilal.A.S.


Websites are not allowed to close the browser.
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/

DanRaisch
Moderator

User avatar
 
Posts: 122043
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Post Posted October 20th, 2014, 10:27 am

Moving to Web Development.

trolly
Moderator

User avatar
 
Posts: 39908
Joined: August 22nd, 2005, 7:25 am

Post Posted October 20th, 2014, 10:57 am

An extension may be able to do this.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

harilal

User avatar
 
Posts: 5
Joined: October 20th, 2014, 7:18 am

Post Posted October 20th, 2014, 11:24 am

trolly wrote:An extension may be able to do this.


Could you please share your thoughts on this?

Thanks & Regards,
Harilal.A.S.

trolly
Moderator

User avatar
 
Posts: 39908
Joined: August 22nd, 2005, 7:25 am

Post Posted October 20th, 2014, 11:40 am

An addon/extension has higher access rights and may monitor a specific web site and close firefox. Personally, I have no real idea how to do this. You may ask in the "Extension development" forum.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

harilal

User avatar
 
Posts: 5
Joined: October 20th, 2014, 7:18 am

Post Posted October 20th, 2014, 12:20 pm

trolly wrote:An addon/extension has higher access rights and may monitor a specific web site and close firefox. Personally, I have no real idea how to do this. You may ask in the "Extension development" forum.


Thank you, I will analyse more on this option.

The real bottle neck is that, the auto close is working for some other browsers irrespective of versions. And the end users going to use this. So in common we are not able to force end users to use a specific browser or not ask to change some settings on browser. And the end users may consider this as a bug in development other than browser issue.

So am searching more on this....

trolly
Moderator

User avatar
 
Posts: 39908
Joined: August 22nd, 2005, 7:25 am

Post Posted October 20th, 2014, 12:28 pm

Basically, allowing to close a browser by a web page is considered a security risk by Mozilla.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

jscher2000

User avatar
 
Posts: 10715
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA

Post Posted October 20th, 2014, 5:14 pm

You can display a message that says "You can close this window now". I think your users should be able to handle that.

patrickjdempsey

User avatar
 
Posts: 23734
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC

Post Posted October 20th, 2014, 5:40 pm

harilal wrote:The real bottle neck is that, the auto close is working for some other browsers irrespective of versions.


Like IE? You cannot use IE as a judge as to what safe browser behavior is.
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/

harilal

User avatar
 
Posts: 5
Joined: October 20th, 2014, 7:18 am

Post Posted October 21st, 2014, 2:47 am

jscher2000 wrote:You can display a message that says "You can close this window now". I think your users should be able to handle that.


Hi,
We already tried to show the message (exactly the one that you told) instead of closing the browser, but the client team not satisfied
Thanks & Regards,
Harilal.A.S.
Last edited by harilal on October 21st, 2014, 2:53 am, edited 1 time in total.

harilal

User avatar
 
Posts: 5
Joined: October 20th, 2014, 7:18 am

Post Posted October 21st, 2014, 2:51 am

patrickjdempsey wrote:
harilal wrote:The real bottle neck is that, the auto close is working for some other browsers irrespective of versions.


Like IE? You cannot use IE as a judge as to what safe browser behavior is.


Hi,
Not tested in IE, but in "Safari" the auto close feature is working fine (Our clients commonly work with Mozilla Fire Fox, Safari, Chrome, IE etc)
Thanks & Regards,
Harilal.A.S.

patrickjdempsey

User avatar
 
Posts: 23734
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC

Post Posted October 21st, 2014, 3:45 pm

Like IE, Safari will also automatically run installable files when you download them. Again, Safari is not a good example of safe browser behavior.
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/

trolly
Moderator

User avatar
 
Posts: 39908
Joined: August 22nd, 2005, 7:25 am

Post Posted October 22nd, 2014, 1:58 am

If this is allowed some hackers may be able to inject an advertisement that closes the browser when the user tries to close or leave the site. It is not really a good idea to allow that.
And if the user has scripts disabled it will not work anyway.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

Return to Web Development / Standards Evangelism


Who is online

Users browsing this forum: No registered users and 2 guests