First of all, ie can be window.close () to close the browser window, but under Firefox and Chrome is not valid.
The reason is:
The default setting for Firefox is not to close the browser window through a script to prevent malicious scripting from being injected,
So the way to adjust is to enter about:config in the URL address bar,
Then find dom.allow_scripts_to_close_windows in the configuration list
Click on the right button to change the above false to true. Default is False
Chrome is not supported by default, but it can be closed by some special means:
Copy Code code as follows:
Window.opener=null;
window.open (', ' _self ');
Window.close ();
Create a window without the parent element, while pointing the window to itself, and closing itself, the last can be closed, in fact, a bit similar with the script opened the current page, and then use the script to close the current page, and this way in the consortium is recognized!
We can not ask customers to change the browser configuration, 99% of the people are using the default configuration, this method to solve the current (2014-01-16) most browsers can not close the current page problem, 10 years later do not know (this is nonsense, hehe).