[kupu-checkins] r35022 - kupu/trunk/kupu/common

duncan at codespeak.net duncan at codespeak.net
Mon Nov 27 10:08:40 CET 2006


Author: duncan
Date: Mon Nov 27 10:08:39 2006
New Revision: 35022

Modified:
   kupu/trunk/kupu/common/kupustart.js
Log:
Applied patch from mors:
In file kupustart.js there's a small user agent matching that's done to set up the unload event listener. Problem is that any browser that isn't IE, and doesn't have a 'rv:' token in it's ua string will break.

Modified: kupu/trunk/kupu/common/kupustart.js
==============================================================================
--- kupu/trunk/kupu/common/kupustart.js	(original)
+++ kupu/trunk/kupu/common/kupustart.js	Mon Nov 27 10:08:39 2006
@@ -48,7 +48,7 @@
         // so let's try to register and if it fails fall back on onunload
         var re = /rv:([0-9\.]+)/
         var match = re.exec(navigator.userAgent)
-        if (match[1] && parseFloat(match[1]) > 1.6) {
+        if (match && match[1] && parseFloat(match[1]) > 1.6) {
             addEventHandler(window, 'beforeunload', saveOnPart);
         } else {
             addEventHandler(window, 'unload', saveOnPart);


More information about the kupu-checkins mailing list