respect reduced data settings for rel=preload
assets
#2387
ryanflorence
started this conversation in
Proposals
Replies: 1 comment 4 replies
-
Bump. It's almost 3 years later and global support is at 75%. This should be a simple boolean check to implement along with a few lines of docs. PR welcome? https://caniuse.com/mdn-api_networkinformation_savedata function usePrefetchBehavior<T extends HTMLAnchorElement>(
...
return [
// @ts-expect-error connection is still experimental
shouldPrefetch && !navigator.connection?.saveData,
... |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
(prefers-reduced-data)
doesn't have great support yet, but we can start using it anyway.We can also add a check to
navigator.connection.saveData
before rendering the links on script transitions until the media query has more support.This post has lots of practical stuff about browser support/APIs etc. https://polypane.app/blog/creating-websites-with-prefers-reduced-data/
Beta Was this translation helpful? Give feedback.
All reactions