2009-10-06 17:25:56 -07:00
|
|
|
<html>
|
|
|
|
<body>
|
|
|
|
<script>
|
|
|
|
window.returnValue = 3;
|
|
|
|
|
2010-03-12 13:53:36 -08:00
|
|
|
if (location.toString().match(/^http:\/\/mochi.test:8888/)) {
|
2009-10-06 17:25:56 -07:00
|
|
|
// Test that we got the right arguments.
|
|
|
|
opener.is(window.dialogArguments, "my args",
|
|
|
|
"dialog did not get the right arguments.");
|
|
|
|
|
2013-05-17 10:43:20 -07:00
|
|
|
// Load a different url, and test that it sees the arguments (since it's same origin).
|
|
|
|
window.location="data:text/html,<html><body onload=\"opener.is(window.dialogArguments, 'my args', 'subsequent dialog document did not get the right arguments.'); close();\">';";
|
2009-10-06 17:25:56 -07:00
|
|
|
} else {
|
|
|
|
// Post a message containing our arguments to the opener to test
|
|
|
|
// that this cross origing dialog does *not* see the passed in
|
|
|
|
// arguments.
|
|
|
|
opener.postMessage("args: " + window.dialogArguments,
|
2010-03-12 13:53:36 -08:00
|
|
|
"http://mochi.test:8888");
|
2009-10-06 17:25:56 -07:00
|
|
|
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
</script>
|