summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/mozilla/tests/fetch/fetchpriority/support/link-tests/link-dynamic-prefetch.h2.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/mozilla/tests/fetch/fetchpriority/support/link-tests/link-dynamic-prefetch.h2.html')
-rw-r--r--testing/web-platform/mozilla/tests/fetch/fetchpriority/support/link-tests/link-dynamic-prefetch.h2.html36
1 files changed, 36 insertions, 0 deletions
diff --git a/testing/web-platform/mozilla/tests/fetch/fetchpriority/support/link-tests/link-dynamic-prefetch.h2.html b/testing/web-platform/mozilla/tests/fetch/fetchpriority/support/link-tests/link-dynamic-prefetch.h2.html
new file mode 100644
index 0000000000..2640596ee8
--- /dev/null
+++ b/testing/web-platform/mozilla/tests/fetch/fetchpriority/support/link-tests/link-dynamic-prefetch.h2.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>fetchpriority</title>
+</head>
+<body>
+<script>
+ onload = function() {
+ const kData = [
+ { href: "../resources/dummy.txt?1", fetchPriority: "low" },
+ { href: "../resources/dummy.txt?2", fetchPriority: "high" },
+ { href: "../resources/dummy.txt?3", fetchPriority: "auto" },
+ { href: "../resources/dummy.txt?4" }
+ ];
+
+ let allLinkElements = [];
+ for (data of kData) {
+ let linkElement = document.createElement("link");
+ linkElement.rel = "prefetch";
+ linkElement.href = data.href;
+
+ if ("fetchPriority" in data) {
+ linkElement.fetchPriority = data.fetchPriority;
+ }
+
+ allLinkElements.push(linkElement);
+ }
+
+ document.head.append(...allLinkElements)
+
+ opener.postMessage("ChildLoaded", "*");
+ }
+</script>
+</body>
+</html>