Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE HTML>
<html>
<!--
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1596040 - Link relList support returns false for manifest</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
<script>
"use strict";
SimpleTest.waitForExplicitFinish();
async function run() {
const prefSetting = [
{ manifest: true, modulepreload: true },
{ manifest: true, modulepreload: false },
{ manifest: false, modulepreload: true },
{ manifest: false, modulepreload: false },
];
for (const { manifest, modulepreload } of prefSetting) {
await SpecialPowers.pushPrefEnv({
set: [
["dom.manifest.enabled", manifest],
["network.modulepreload", modulepreload],
],
});
const { relList } = document.createElement("link");
is(
relList.supports("manifest"),
manifest,
`Expected manifest to be ${manifest}`
);
is(
relList.supports("modulepreload"),
modulepreload,
`Expected preload to be ${modulepreload}`
);
}
}
run()
.catch(console.error)
.finally(() => SimpleTest.finish());
</script>
</head>