I want to close window on logout. I have used
window.close()
, self.close()
,var win = window.open(\"\",\"_s
Working 100 % for me
In Mozilla by default the "dom.allow_scripts_to_close_windows" value which controls the Java Script close window is set to "false". In order to fix this issue change this value to "true"
Location of the File:
C:\Program Files\Mozilla Firefox\greprefs\all.js
change "dom.allow_scripts_to_close_windows" from "false" to "true"
Example:
Default value
pref("dom.allow_scripts_to_close_windows", false);
Change it to:
pref("dom.allow_scripts_to_close_windows", true);
2.Close Mozilla browser
3.Try accessing HTML page which has window.close() code snippet
Note : If you not find "all.js" then go to C:\Program Files (x86)\Mozilla Firefox\defaults\pref\channel-prefs.js and add "pref("dom.allow_scripts_to_close_windows", true);" into "channel-prefs.js" file
Is seems that they are working on Chrome Kiosk ( Fullscreen ) mode. Tried successfully. Up to 19 as of now.
I have found that Firefox can only use window.close() when script has been called to open that window in the first place.
Read here for more info.
So if you didn't use a script to open that window, it can't be done.
I tried to review all topics about window.close() and have found that: IE/Chrome/Safari(?) accept closure if we open something on _self, so generally
top.open('','_self',''); top.close();
does the work. FF (r 19 when writing this) is more strict about this and somehow forbids any probe like above. The good answer was found in related thread, that user must manually allow FF to have solution above working
about.config -> dom.allow_scripts_to_close_windows = true;
Big bravo to FF dev team. This is exactly how it should work; pity only is that is hard to find it.
Pawel.
This worked for me perfectly:
<a href="javascript:window.open('','_parent','');window.close();">Close this window</a>
Ive been using something like this:
<head>
<script language="javascript" >
function ffffd() {
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
window.open('http://www.google.com','mywindow','width=400,height=200');
window.close();
}
</script>
</head>
<body>
<input type= "button" name="new" value="New Window" onClick="ffffd()">
</body>