[pmwiki-users-fr] script type="speculationrules"
Petko Yotov
5ko at 5ko.fr
Mar 10 Nov 07:54:31 PST 2026
Thanks!
For reference, here is the documentation for this feature:
https://developer.mozilla.org/en-US/docs/Web/API/Speculation_Rules_API
Comparison of this and similar features, and their browser support:
https://developer.mozilla.org/en-US/docs/Web/Performance/Guides/Speculative_loading
Petko
On 10/11/2026 14:18, ABClf wrote:
> Hello,
>
> I want to share this little thing (not a revolution though) :
> I have added this snippet in my config :
>
> $HTMLHeaderFmt['speculation'] = '<script type="speculationrules">
> {
> "prerender": [{
> "where": { "and": [
> { "href_matches": "/*" },
> { "not": { "selector_matches": "a[href*=\"action=\"]" } },
> { "not": { "selector_matches": "[rel~=nofollow]" } },
> { "not": { "selector_matches": ".no-prerender, .no-prerender a" }
> }
> ]},
> "eagerness": "moderate"
> }]
> }
> </script>';
>
> and it looks like it's working (Chrome, Edge and Opera only) : get the
> mouse pointer on any internal link (and stay 200ms), to get the page
> loaded in the background for fast loading if clicked.
>
> I believe it's quite moderate.
Plus d'informations sur la liste de diffusion pmwiki-users-fr