Skip to content

Commit 32902a7

Browse files
committed
Add saveData handling
1 parent 47dbaf5 commit 32902a7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

index.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ export default function quicklink(options) {
4747
if (navigator.connection.effectiveType && /\slow-2g|2g/.test(navigator.connection.effectiveType)) {
4848
return;
4949
}
50+
// Don't prefetch if Save-Data is enabled..
51+
if (navigator.connection.saveData) {
52+
return;
53+
}
5054
}
5155
// Prefetch an array of URLs if supplied (as an override)
5256
if (options.urls !== undefined && options.urls.length > 0) {

0 commit comments

Comments
 (0)