Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <!DOCTYPE html> |
michael@0 | 2 | <script> |
michael@0 | 3 | function checkDomain(str, msg) { |
michael@0 | 4 | window.parent.postMessage((str == document.domain) + ";" +msg, |
michael@0 | 5 | "http://mochi.test:8888"); |
michael@0 | 6 | } |
michael@0 | 7 | |
michael@0 | 8 | function reportException(msg) { |
michael@0 | 9 | window.parent.postMessage(false + ";" + msg, "http://mochi.test:8888"); |
michael@0 | 10 | } |
michael@0 | 11 | |
michael@0 | 12 | var win1; |
michael@0 | 13 | try { |
michael@0 | 14 | win1 = window.open("", "", "width=100,height=100"); |
michael@0 | 15 | var otherDomain1 = win1.document.domain; |
michael@0 | 16 | win1.close(); |
michael@0 | 17 | checkDomain(otherDomain1, "Opened document should have our domain"); |
michael@0 | 18 | } catch(e) { |
michael@0 | 19 | reportException("Exception getting document.domain: " + e); |
michael@0 | 20 | } finally { |
michael@0 | 21 | win1.close(); |
michael@0 | 22 | } |
michael@0 | 23 | |
michael@0 | 24 | document.domain = "example.org"; |
michael@0 | 25 | |
michael@0 | 26 | var win2; |
michael@0 | 27 | try { |
michael@0 | 28 | win2 = window.open("", "", "width=100,height=100"); |
michael@0 | 29 | var otherDomain2 = win2.document.domain; |
michael@0 | 30 | checkDomain(otherDomain2, "Opened document should have our domain"); |
michael@0 | 31 | win2.close(); |
michael@0 | 32 | } catch(e) { |
michael@0 | 33 | reportException("Exception getting document.domain after domain set: " + e); |
michael@0 | 34 | } finally { |
michael@0 | 35 | win2.close(); |
michael@0 | 36 | } |
michael@0 | 37 | </script> |