file_sendbeacon.html (545B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <meta http-equiv="Content-Security-Policy" content= "connect-src 'none'"> 6 <title>Bug 1234813 - sendBeacon should not throw if blocked by Content Policy</title> 7 </head> 8 <body> 9 10 <script type="application/javascript"> 11 try { 12 navigator.sendBeacon("http://example.com/sendbeaconintonirvana"); 13 window.parent.postMessage({result: "blocked-beacon-does-not-throw"}, "*"); 14 } 15 catch (e) { 16 window.parent.postMessage({result: "blocked-beacon-throws"}, "*"); 17 } 18 </script> 19 20 </body> 21 </html>