A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/WICG/nav-speculation/issues/348 below:

Allow external <script type=speculationrules> · Issue #348 · WICG/nav-speculation · GitHub

I’m building a project that is a bunch of plain HTML files with plain CSS and JS – there is no build step. I’m deploying this project to a server where I cannot control the headers being sent.

Because I can’t control the headers, I needed to add Speculation Rules by adding the following snippet to each and every HTML file:

<script type="speculationrules">
	{
		"prerender": [{
			"source": "document",
			"where": {
				"href_matches": "/*"
			},
			"eagerness": "moderate"
		}]
	}
</script>

This is very repetitive. I kinda assumed I would be able to do the following to keep things DRY, but turns out this is not possible:

<script type="speculationrules" src="file-with-speculation-rules.json"></script>

Hereby requesting to consider this feature request.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.5