Source code

Revision control

Copy as Markdown

Other Tools

<!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`; }
.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>