|
1 <html> |
|
2 <body> |
|
3 <script> |
|
4 window.returnValue = 3; |
|
5 |
|
6 if (location.toString().match(/^http:\/\/mochi.test:8888/)) { |
|
7 // Test that we got the right arguments. |
|
8 opener.is(window.dialogArguments, "my args", |
|
9 "dialog did not get the right arguments."); |
|
10 |
|
11 // Load a different url, and test that it sees the arguments (since it's same origin). |
|
12 window.location="data:text/html,<html><body onload=\"opener.is(window.dialogArguments, 'my args', 'subsequent dialog document did not get the right arguments.'); close();\">';"; |
|
13 } else { |
|
14 // Post a message containing our arguments to the opener to test |
|
15 // that this cross origing dialog does *not* see the passed in |
|
16 // arguments. |
|
17 opener.postMessage("args: " + window.dialogArguments, |
|
18 "http://mochi.test:8888"); |
|
19 |
|
20 close(); |
|
21 } |
|
22 </script> |