Commits

p3...@fe34127c-c842-0410-aa83-9fc675b9a81c  committed 30848b6

some bug fixes with XSubdomain

  • Participants
  • Parent commits 8085170
  • Branches 0.5

Comments (0)

Files changed (2)

File daemon/orbited/static/XSubdomainBridge.html

 };
 
 
-// Message receiver handler (req. for Opera compatibility)
-document.addEventListener('message', function(e) {
-    var msg = e.data;
-    var response = JSON.parse(msg);
-    req = response;
+if (typeof(opera) != "undefined")
+{
+    // Message receiver handler (req. for Opera compatibility)
+    document.addEventListener('message', function(e) {
+        var msg = e.data;
+        var response = JSON.parse(msg);
+        req = response;
+    }
+    , false
+    );  
 }
-, false
-);
 
 
 </script>

File daemon/orbited/static/XSubdomainRequest.js

 
 // Message handler - parses messages posted by the
 // XSubdomainBridge
-document.addEventListener('message', function(e) {
-    var msg = e.data.split(" ");
-    var cmd = msg.shift();
-    if (cmd == "event") 
-    {
-        var id = msg.shift();
-        var dataString = msg.join(" ");
-        var data = JSON.parse(dataString);
 
-        XSubdomainRequest.prototype._event(id, data);
-    }
-    if (cmd == "queues")
-    {
-        var id = msg.shift();
-        var queue = XSubdomainRequest.prototype._state.queues[id];
-        if (queue.length > 0) {
-            var data = queue.shift();
-            e.source.postMessage(JSON.stringify(data), e.origin);
+if (browser == "opera")
+{
+    document.addEventListener('message', function(e) {
+        var msg = e.data.split(" ");
+        var cmd = msg.shift();
+        if (cmd == "event") 
+        {
+            var id = msg.shift();
+            var dataString = msg.join(" ");
+            var data = JSON.parse(dataString);
+    
+            XSubdomainRequest.prototype._event(id, data);
         }
-    }
-}, false
-);
+        if (cmd == "queues")
+        {
+            var id = msg.shift();
+            var queue = XSubdomainRequest.prototype._state.queues[id];
+            if (queue.length > 0) {
+                var data = queue.shift();
+                e.source.postMessage(JSON.stringify(data), e.origin);
+            }
+        }
+    }, false
+    );
+}