Added some code for window.close() on Chrome - only supported with user action on FF 2.0 and up

master
kts 2013-08-06 01:11:17 -07:00
parent fc318b3d3d
commit 301a32fc36
1 changed files with 5 additions and 0 deletions

5
vif.js
View File

@ -98,6 +98,11 @@ JVIV = function() {
switch(event.keyCode) {
case 81: // q
loop.stop();
/* The following line enables window.close() in Chrome and < FF2.0
FF above that require explicit user action to enable:
about:config -> dom.allow_scripts_to_close_windows=true
*/
window.open('', '_self', ''); // enables window.close() in Chrome and FF1.5 to enable FF1.5
window.close();
break;
case 37: // left