| <!DOCTYPE html> |
| <html> |
| <body> |
| <script> |
| window.onmessage = () => { |
| var fail = msg => parent.window.postMessage(msg, '*'); |
| try { |
| var result = window.open('about:blank', '_blank'); |
| if (result !== null) fail('window.open != null'); |
| result = alert("Yay!"); |
| if (result !== undefined) fail('alert() != undefined'); |
| result = print(); |
| if (result !== undefined) fail('print() != undefined'); |
| result = confirm("Question?"); |
| if (result !== false) fail('confirm() != false'); |
| result = prompt("Question?"); |
| if (result !== null) fail('prompt() != null'); |
| parent.window.postMessage('success', '*'); |
| } catch (err) { |
| fail(err.name); |
| } |
| } |
| </script> |
| </body> |
| </html> |