GoogleChromeLabs/quicklink

Do not prefetch links with `download` attribute

Open

#181 aperta il 15 mag 2020

Vedi su GitHub
 (1 commento) (1 reazione) (0 assegnatari)JavaScript (431 fork)batch import
enhancementgood first issue

Metriche repository

Star
 (10.861 star)
Metriche merge PR
 (Merge medio 47g 12h) (4 PR mergiate in 30 g)

Descrizione

Is your feature request related to a problem? Please describe. Currently all links are prefetched including ones intended for downloadable assets. Since these links could point to large payloads (imagine multi megabyte PDFs or zip archives) that's quite a waste of bandwidth.

I'd argue excluding links which have the download attribute would be a sensible default.

Describe the solution you'd like

document.querySelectorAll('a:not([download])')

Thank you :)

Guida contributor