GoogleChromeLabs/quicklink

Do not prefetch links with `download` attribute

Open

#181 建立於 2020年5月15日

在 GitHub 查看
 (1 留言) (1 反應) (0 負責人)JavaScript (10,861 star) (431 fork)batch import
enhancementgood first issue

描述

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 :)

貢獻者指南