From a4fd1f7ff00da993f9c8875bf68fa2e4a33a48e8 Mon Sep 17 00:00:00 2001
From: Shane Tomlinson <stomlinson@mozilla.com>
Date: Fri, 30 Dec 2011 11:39:33 +0000
Subject: [PATCH] Check for the existence of the JSON object - WinChan depends
 on it.

issue #803
---
 resources/static/include_js/include.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/resources/static/include_js/include.js b/resources/static/include_js/include.js
index dc7dc1d68..d97c9bfbc 100644
--- a/resources/static/include_js/include.js
+++ b/resources/static/include_js/include.js
@@ -879,8 +879,14 @@
       }
     }
 
+    function checkJSON() {
+      if(!(window.JSON && window.JSON.stringify && window.JSON.parse)) {
+        return "JSON";
+      }
+    }
+
     function isSupported() {
-      reason = checkLocalStorage() || checkPostMessage() || explicitNosupport();
+      reason = checkLocalStorage() || checkPostMessage() || checkJSON() || explicitNosupport();
 
       return !reason;
     }
-- 
GitLab