I don't know if it's a good place for posting this kind of topic but after some research on how to detect if a browser doesn't support the window.close() method in JavaScript:
How do I programmatically detect how a browser handles window.close()?
Detecting if window.close worked
After many attempts I think I found a reliable solution for allowing this method to work.
I tested it on Mobile Safari (iOS) and Internet Explorer when the user answers No to the exiting confirmation. I posted this topic because I want to know how many browsers support the hack I've found and I need testers for it.
The code in question:
function selfclose(){
var quit = true;
window.close(); // try to quit
quit = false; // will be executed if not out of app or not supported
setTimeout(function(){ // give a little delay for allowing browser to exit without firing error message
if(!quit){
alert("You haven't quit the website or your browser doesn't support self-closing.");
}
},400);
}