Skip to content

Commit

Permalink
Add saveData handling
Browse files Browse the repository at this point in the history
  • Loading branch information
addyosmani committed Nov 23, 2018
1 parent 47dbaf5 commit 32902a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export default function quicklink(options) {
if (navigator.connection.effectiveType && /\slow-2g|2g/.test(navigator.connection.effectiveType)) {
return;
}
// Don't prefetch if Save-Data is enabled..
if (navigator.connection.saveData) {
return;
}
}
// Prefetch an array of URLs if supplied (as an override)
if (options.urls !== undefined && options.urls.length > 0) {
Expand Down

0 comments on commit 32902a7

Please sign in to comment.