MozillaZine

Scripts may not close windows that were not opened by script

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
gauravshri12
 
Posts: 1
Joined: April 19th, 2017, 11:43 pm

Post Posted April 19th, 2017, 11:48 pm

I have Logout Button in my web application & need to close the tab as soon as i click on logout button which is not happening at the moment in firefox rest other browser are working fine with the below solution.

Works fine in all browser except Firefox.

onclick="javascript:window.close();opener.window.focus();">

DanRaisch
Moderator

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

Post Posted April 20th, 2017, 4:08 am

Moving to Web Development.

Frenzie

User avatar
 
Posts: 2103
Joined: May 5th, 2004, 10:40 am
Location: Belgium

Post Posted April 21st, 2017, 3:20 am

Other browsers are obviously broken. Users should be in control of their browser windows.

Why not simply redirect back to the login screen or to a news page or some such?
Intelligent alien life does exist, otherwise they would have contacted us.

isaacschemm
 
Posts: 204
Joined: January 20th, 2015, 12:29 pm

Post Posted April 24th, 2017, 9:59 am

Maybe add a redirect after you run window.close(), that goes to a page saying "you can now close this window" or something similar.

Return to Web Development / Standards Evangelism


Who is online

Users browsing this forum: No registered users and 0 guests