diff options
Diffstat (limited to 'testing/web-platform/tests/service-workers/service-worker/resources/fetch-csp-iframe.html')
-rw-r--r-- | testing/web-platform/tests/service-workers/service-worker/resources/fetch-csp-iframe.html | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/web-platform/tests/service-workers/service-worker/resources/fetch-csp-iframe.html b/testing/web-platform/tests/service-workers/service-worker/resources/fetch-csp-iframe.html new file mode 100644 index 0000000000..33bf0416d5 --- /dev/null +++ b/testing/web-platform/tests/service-workers/service-worker/resources/fetch-csp-iframe.html @@ -0,0 +1,16 @@ +<script> +var meta = document.createElement('meta'); +meta.setAttribute('http-equiv', 'Content-Security-Policy'); +meta.setAttribute('content', decodeURIComponent(location.search.substring(1))); +document.head.appendChild(meta); + +function load_image(url) { + return new Promise(function(resolve, reject) { + var img = document.createElement('img'); + document.body.appendChild(img); + img.onload = resolve; + img.onerror = reject; + img.src = url; + }); +} +</script> |