dom/security/test/csp/file_strict_dynamic_default_src.html
author Edgar Chen <echen@mozilla.com>
Mon, 09 Sep 2019 17:44:36 +0000
changeset 553746 bdbfce5477b817b6267eb8dd74f0bd2d2899c9b0
parent 364558 f3c84b1049871fcbf39298d22411ecbc8b3ba8dd
permissions -rw-r--r--
Bug 1579088 - Do not use img.complete check whether the img is loaded; r=ckerschb Differential Revision: https://phabricator.services.mozilla.com/D44842

<!DOCTYPE HTML>
<html>
<head>
  <title>Bug 1299483 - CSP: Implement 'strict-dynamic'</title>
</head>
<body>

<div id="testdiv">blocked</div>
<script nonce="foo" src="http://mochi.test:8888/tests/dom/security/test/csp/file_strict_dynamic_default_src.js"></script>

<img id="testimage" src="http://mochi.test:8888/tests/image/test/mochitest/blue.png" data-result="blocked">
<script>
let img = document.getElementById("testimage");
img.addEventListener("load", function() {
  img.dataset.result = "allowed";
}, { once: true });
</script>

</body>
</html>