Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | <!DOCTYPE html> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <script> |
michael@0 | 5 | function doIt() { |
michael@0 | 6 | var doc = window.frames[0].document; |
michael@0 | 7 | var ok = (doc.form1 == doc.getElementById("test1")); |
michael@0 | 8 | window.parent.postMessage( |
michael@0 | 9 | JSON.stringify({ ok: ok, |
michael@0 | 10 | reason: "Should be able to get named items by name" }), |
michael@0 | 11 | "*"); |
michael@0 | 12 | window.parent.postMessage("finish", "*"); |
michael@0 | 13 | } |
michael@0 | 14 | |
michael@0 | 15 | window.onmessage = function(ev) { |
michael@0 | 16 | if (ev.data == "start") { |
michael@0 | 17 | doIt(); |
michael@0 | 18 | } |
michael@0 | 19 | } |
michael@0 | 20 | |
michael@0 | 21 | document.domain = "example.org"; |
michael@0 | 22 | </script> |
michael@0 | 23 | </head> |
michael@0 | 24 | <body> |
michael@0 | 25 | <iframe id="subframe"></iframe> |
michael@0 | 26 | <script> |
michael@0 | 27 | document.getElementById("subframe").src = |
michael@0 | 28 | "http://test2.example.org" + |
michael@0 | 29 | location.pathname.replace(/file1_bug629227.html/, "file2_bug629227.html"); |
michael@0 | 30 | </script> |
michael@0 | 31 | </body> |
michael@0 | 32 | </html> |