Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<meta charset="utf-8" />
<title>prefetch source</title>
<script>
const params = new URLSearchParams(location.search);
const rule = {
source: "list",
urls: [params.get("target")],
eagerness: "immediate",
};
if (params.has("tag")) {
rule.tag = params.get("tag");
}
const script = document.createElement("script");
script.type = "speculationrules";
script.textContent = JSON.stringify({ prefetch: [rule] });
document.head.appendChild(script);
</script>