| OLD | NEW |
| (Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <script> |
| 5 // Override the |frames| property to test that such overrides are |
| 6 // properly ignored cross-origin. |
| 7 window.frames = "override"; |
| 8 |
| 9 // If we get a postMessage, we grab references to everything and set |
| 10 // document.domain to trim off our topmost subdomain. |
| 11 window.onmessage = function(evt) { |
| 12 window.windowReferences = []; |
| 13 window.locationReferences = []; |
| 14 for (var i = 0; i < parent.length; ++i) { |
| 15 windowReferences.push(parent[i]); |
| 16 locationReferences.push(parent[i].location); |
| 17 } |
| 18 document.domain = document.domain.substring(document.domain.indexOf('.') + 1
); |
| 19 evt.source.postMessage('', '*'); |
| 20 } |
| 21 |
| 22 function checkWindowReferences() { |
| 23 for (var i = 0; i < parent.length; ++i) { |
| 24 if (windowReferences[i] != parent[i]) |
| 25 throw new Error("Window references don't match for " + i + " after docum
ent.domain"); |
| 26 if (locationReferences[i] != parent[i].location) |
| 27 throw new Error("Location references don't match for " + i + " after doc
ument.domain"); |
| 28 } |
| 29 return true; |
| 30 } |
| 31 </script> |
| 32 </head> |
| 33 <body> |
| 34 </body> |
| 35 </html> |
| OLD | NEW |