Skip to content

Instantly share code, notes, and snippets.

@mikewest
Last active December 12, 2015 09:48
Show Gist options
  • Save mikewest/4753771 to your computer and use it in GitHub Desktop.
Save mikewest/4753771 to your computer and use it in GitHub Desktop.
CONSOLE MESSAGE: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe-for-location-get-test.html from frame with URL http://127.0.0.1:8000/security/cross-frame-access-location-minimal.html. Domains, protocols and ports must match.
CONSOLE MESSAGE: line 20: Exception! TypeError
Exception! TypeError
CONSOLE MESSAGE: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe-for-location-get-test.html from frame with URL http://127.0.0.1:8000/security/cross-frame-access-location-minimal.html. Domains, protocols and ports must match.
CONSOLE MESSAGE: line 20: Exception! SecurityError
Exception! SecurityError
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
window.onload = function () {
var frame = document.querySelector('iframe');
frame.onload = test;
frame.src = "http://localhost:8000/security/resources/cross-frame-iframe-for-location-get-test.html";
};
function test() {
var target = frames[0];
try {
target.location.href;
console.log('No exception!');
document.getElementById('output').innerText = "No exception! ";
} catch (e) {
console.log('Exception! ' + e.name);
document.getElementById('output').innerText = "Exception! " + e.name;
}
if (window.testRunner)
testRunner.notifyDone();
}
</script>
<iframe></iframe>
<pre id="output"></pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment