Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
<!DOCTYPE HTML>
<html>
<head>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<script>
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [
// Enable popup blocker
["dom.disable_open_during_load", true],
],
});
});
add_task(async function() {
var script = SpecialPowers.loadChromeScript(() => {
/* eslint-env mozilla/chrome-script */
Services.obs.addObserver(function onExamResp(subject) {
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
info("request observed: " + channel.URI.spec);
return;
}
try {
is(channel.getRequestHeader("Sec-Fetch-User"), "?1", "testing sec-fetch-user");
} catch (e) {
ok(false, "sec-fetch-user should be set");
}
sendAsyncMessage("test-pass");
}, "http-on-stop-request");
});
let promise = new Promise(resolve => script.addMessageListener("test-pass", resolve));
SpecialPowers.wrap(document).notifyUserGestureActivation();
await promise;
win.close();
});
</script>
</body>
</html>