From 282fcc9c33f3973aee1af136d82150940b6b8433 Mon Sep 17 00:00:00 2001 From: "silver%warwickcompsoc.co.uk" Date: Mon, 26 Apr 2004 10:00:13 +0000 Subject: [PATCH] Bug 231534 - Catch errors when using XMLHttpRequest and survive them. Bump version to 0.9.82. r=rginda@hacksrus.com --- .../resources/content/venkman-static.js | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/extensions/venkman/resources/content/venkman-static.js b/extensions/venkman/resources/content/venkman-static.js index cde52574fd5e..dd0314e28844 100644 --- a/extensions/venkman/resources/content/venkman-static.js +++ b/extensions/venkman/resources/content/venkman-static.js @@ -37,7 +37,7 @@ * * ***** END LICENSE BLOCK ***** */ -const __vnk_version = "0.9.81"; +const __vnk_version = "0.9.82"; const __vnk_requiredLocale = "0.9.81"; var __vnk_versionSuffix = ""; @@ -652,12 +652,22 @@ function fetchLaunchCount() } }; - var r = new XMLHttpRequest(); - r.onload = onLoad; - r.open ("GET", - __vnk_counter_url + "?local=" + console.prefs["startupCount"] + - "&version=" + __vnk_version); - r.send (null); + try + { + var r = new XMLHttpRequest(); + r.onload = onLoad; + r.open ("GET", + __vnk_counter_url + "?local=" + console.prefs["startupCount"] + + "&version=" + __vnk_version); + r.send (null); + } + catch (ex) + { + // Oops. Probably missing the xmlextras extension, can't really do + // much about that. + display(getMsg(MSN_LAUNCH_COUNT, + [console.prefs["startupCount"], MSG_VAL_UNKNOWN])); + } } console.__defineGetter__ ("userAgent", con_ua);