OLD | NEW |
(Empty) | |
| 1 onconnect = function (event) { |
| 2 var port = event.ports[0]; |
| 3 var xhr = new XMLHttpRequest; |
| 4 xhr.onerror = function () { |
| 5 port.postMessage("xhr blocked"); |
| 6 port.postMessage("TEST COMPLETE"); |
| 7 }; |
| 8 xhr.onload = function () { |
| 9 if (xhr.responseText == "FAIL") { |
| 10 port.postMessage("xhr allowed"); |
| 11 } else { |
| 12 port.postMessage("xhr blocked"); |
| 13 } |
| 14 port.postMessage("TEST COMPLETE"); |
| 15 }; |
| 16 try { |
| 17 xhr.open("GET", "/common/redirect.py?location=http://www1.{{host}}:{{por
ts[http][0]}}/content-security-policy/support/fail.asis", true); |
| 18 xhr.send(); |
| 19 } catch (e) { |
| 20 port.postMessage("xhr blocked"); |
| 21 port.postMessage("TEST COMPLETE"); |
| 22 } |
| 23 } |
OLD | NEW |