From 301a32fc36fc1aa27b558da691e18c99b3a678f5 Mon Sep 17 00:00:00 2001 From: kts Date: Tue, 6 Aug 2013 01:11:17 -0700 Subject: [PATCH] Added some code for window.close() on Chrome - only supported with user action on FF 2.0 and up --- vif.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vif.js b/vif.js index 2939a57..d7a9c70 100644 --- a/vif.js +++ b/vif.js @@ -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