instantpage / instant.page

Make your site’s pages instant in 1 minute and improve your conversion rate by 1%
https://instant.page
MIT License
6.07k stars 206 forks source link

Make it possible to enable for specific links #2

Closed david-a-wheeler closed 5 years ago

david-a-wheeler commented 5 years ago

On a site I manage many of the links have "?" - and some should be preloaded, while others must not. Adding data-instant-allow-query-string is difficult; then I have to look at every link that might be on the page in any possible circumstance.

It'd be far better to have a simple way to say "please enable instant.page for THIS link". E.g., support a new class "preload-on-hover" on "a". If that class is present, then preload on hover. Then I can add it to just the important links that I know are safe, and slowly add them over time.

Thanks!

leesalminen commented 5 years ago

I second this! I'm going to give it a go and submit a PR next week.

In my use case, I only want to enable preloading for <a> tags within the main navigation bar. Would be easier to have an "opt in" vs an "opt out".

dieulot commented 5 years ago

I reckon this would be easier. I’m going to add it. Thanks for detailing the use cases.

dieulot commented 5 years ago

Version 1.1.0 is now shipped which addresses this. https://instant.page/blacklist

david-a-wheeler commented 5 years ago

Awesome! Thanks for data-instant!