summaryrefslogtreecommitdiff
path: root/src/chrome/content/igb/trusted.js
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2014-12-09 19:18:15 -0500
committerAlex Xu <alex_y_xu@yahoo.ca>2014-12-09 22:03:17 -0500
commit74ea762eef32df4bc459fe48247ab32049138e8a (patch)
tree90d83730375d104a45571ee73f7a6211ebb4119b /src/chrome/content/igb/trusted.js
parent3a93c00d336cc9e9201e41a9bacfcd2e916368b7 (diff)
downloadeib-74ea762eef32df4bc459fe48247ab32049138e8a.tar.xz
eib-74ea762eef32df4bc459fe48247ab32049138e8a.zip
Add features, XHR long polling.
Diffstat (limited to 'src/chrome/content/igb/trusted.js')
-rw-r--r--src/chrome/content/igb/trusted.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/chrome/content/igb/trusted.js b/src/chrome/content/igb/trusted.js
new file mode 100644
index 0000000..3c6a6c7
--- /dev/null
+++ b/src/chrome/content/igb/trusted.js
@@ -0,0 +1,15 @@
+window.onerror = function (e) { alert(e); };
+var xhr = new XMLHttpRequest();
+xhr.onreadystatechange = function () {
+ if (xhr.readyState === 4) {
+ var obj = JSON.parse(xhr.responseText);
+ CCPEVE[obj[0]].apply(CCPEVE, obj[1]);
+ // IGB imposes a 1s delay between JS calls
+ setTimeout(function () {
+ xhr.open("GET", "trusted");
+ xhr.send();
+ }, 1000);
+ }
+};
+xhr.open("GET", "trusted");
+xhr.send();