OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script> | 4 <script> |
5 var req = new XMLHttpRequest(); | 5 var req = new XMLHttpRequest(); |
6 req.open('GET', location); | 6 req.open('GET', location); |
7 req.onerror = function() { | 7 try { |
8 window.parent.postMessage('PASS', '*'); | 8 req.send(); |
| 9 window.parent.postMessage('FAIL', '*'); |
| 10 } catch (e) { |
| 11 window.parent.postMessage(e.name, '*'); |
9 } | 12 } |
10 req.send(); | |
11 </script> | 13 </script> |
12 </head> | 14 </head> |
13 <body> | 15 <body> |
14 Documents loaded from file: shouldn't be able to access themselves via XHR. | 16 Documents loaded from file: shouldn't be able to access themselves via XHR. |
15 </body> | 17 </body> |
16 </html> | 18 </html> |
OLD | NEW |