[pmwiki-users-fr] script type="speculationrules"

ABClf languefrancaise at gmail.com
Mar 10 Nov 05:18:36 PST 2026


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.

Gilles.



Plus d'informations sur la liste de diffusion pmwiki-users-fr