Browse Source

work around bug in Iceweasel 3.0 that causes it to report its platform version as 1.9 instead of 1.9.0.x

Myk Melez 15 years ago
parent
commit
49c463d4d7
1 changed files with 5 additions and 1 deletions
  1. 5 1
      JSON.js

+ 5 - 1
JSON.js

@@ -67,7 +67,11 @@ const Cu = Components.utils;
 
 let appInfo = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo);
 
-if (appInfo.platformVersion.indexOf("1.9.0") == 0) {
+// Iceweasel 3.0 has a bug where it reports its platform version as 1.9 instead
+// of 1.9.0.n; we work around the bug by checking for 1.9 in addition to 1.9.0.n
+// and wrapping the JSON API in both cases.
+if (appInfo.platformVersion.indexOf("1.9.0") == 0 ||
+    appInfo.platformVersion == "1.9") {
   // Declare JSON with |var| so it'll be defined outside the enclosing
   // conditional block.
   var JSON = {