[Pkg-javascript-commits] [sockjs-client] 234/434: Get document.domain trick/same origin policy work for ie7
Tonnerre Lombard
tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:16 UTC 2014
This is an automated email from the git hooks/post-receive script.
tonnerre-guest pushed a commit to branch master
in repository sockjs-client.
commit 3d7d9946320537e649613173db849fe89cec514a
Author: Marek Majkowski <majek04 at gmail.com>
Date: Thu Dec 1 11:46:45 2011 +0000
Get document.domain trick/same origin policy work for ie7
the document.domain setter must be in head.
---
tests/html/iframe.html | 19 +++++++++++--------
tests/html/src/domtests.coffee | 4 +++-
tests/html/tests-qunit.html | 3 +++
3 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/tests/html/iframe.html b/tests/html/iframe.html
index 6b7b5d1..86dfb0f 100644
--- a/tests/html/iframe.html
+++ b/tests/html/iframe.html
@@ -3,18 +3,21 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <script>
+ document.domain = document.domain;
+ </script>
<script src="/lib/sockjs.js"></script>
</head>
-<body>
+<body onload="onload();">
<h2>Don't panic!</h2>
<p>This is a SockJS hidden iframe. It's used for cross domain magic.</p>
<script>
- document.domain = document.domain;
- history.navigationMode = 'compatible';
- c = parent._sockjs_global;
- window_id = document.location.hash.slice(1);
- hook = c(window_id);
- hook.callback = function(code) {eval(code);};
- hook.open();
+ onload = function() {
+ c = parent._sockjs_global;
+ window_id = document.location.hash.slice(1);
+ hook = c(window_id);
+ hook.callback = function(code) {eval(code);};
+ hook.open();
+ }
</script>
</body>
diff --git a/tests/html/src/domtests.coffee b/tests/html/src/domtests.coffee
index a3e9646..b523cea 100644
--- a/tests/html/src/domtests.coffee
+++ b/tests/html/src/domtests.coffee
@@ -3,7 +3,9 @@ module('Dom')
u = SockJS.getUtils()
newIframe = ->
- document.domain = document.domain
+ # Must do:
+ # document.domain = document.domain
+ # in HEAD, for IE7
hook = u.createHook()
err = ->
log('iframe error. bad.')
diff --git a/tests/html/tests-qunit.html b/tests/html/tests-qunit.html
index 930ff2c..0187f39 100644
--- a/tests/html/tests-qunit.html
+++ b/tests/html/tests-qunit.html
@@ -3,6 +3,9 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="UTF-8" />
+ <script>
+ document.domain = document.domain;
+ </script>
<link href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII=" rel="icon" type="image/x-icon" />
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git
More information about the Pkg-javascript-commits
mailing list