Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using document rules for simplicity #1

Open
domenic opened this issue Jul 20, 2023 · 0 comments
Open

Consider using document rules for simplicity #1

domenic opened this issue Jul 20, 2023 · 0 comments

Comments

@domenic
Copy link

domenic commented Jul 20, 2023

Right now this prerenders all .clickable links on mouse up.

You could instead prerender them on mouse down, with less code. Just add the following to your HTML (not JS):

<script type=speculationrules>
{
  "prerender": [{
    "source": "document",
    "selector_matches": ".clickable",
  }]
}
</script>

Then Chrome will do the work for you!

Note that for now, doing so would require signing up for the corresponding origin trial and adding the <meta http-equiv="origin-trial"> to your document's <head>. But we need more feedback from partners to graduate this from origin trial, so, maybe this is a good idea anyway?

/cc @jeremyroman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant