diff options
Diffstat (limited to '')
-rw-r--r-- | toolkit/components/extensions/test/mochitest/file_redirect_cors_bypass.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/toolkit/components/extensions/test/mochitest/file_redirect_cors_bypass.html b/toolkit/components/extensions/test/mochitest/file_redirect_cors_bypass.html new file mode 100644 index 0000000000..b8fda2369a --- /dev/null +++ b/toolkit/components/extensions/test/mochitest/file_redirect_cors_bypass.html @@ -0,0 +1,30 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>1450965 Skip Cors Check for Early WebExtention Redirects</title> +</head> +<body> + <pre id="c"> + Fetching ... + </pre> + <script> + "use strict"; + let c = document.querySelector("#c"); + const channel = new BroadcastChannel("test_bus"); + function l(t) { c.innerText += `${t}\n`; } + + fetch("https://example.org/tests/toolkit/components/extensions/test/mochitest/file_cors_blocked.txt") + .then(r => r.text()) + .then(t => { + // This Request should have been redirected to /file_sample.txt in + // onBeforeRequest. So the text should be 'Sample' + l(`Loaded: ${t}`); + channel.postMessage(t); + }).catch(e => { + // The Redirect Failed, most likly due to a CORS Error + l(`e`); + channel.postMessage(e.toString()); + }); + </script> +</body> +</html> |