We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
nav.connection
1 parent 84a0468 commit 34e9718Copy full SHA for 34e9718
1 file changed
src/prefetch.mjs
@@ -116,14 +116,8 @@ function prefetcher(url, isPriority) {
116
}
117
118
if ('connection' in navigator) {
119
- // Don't prefetch if the user is on 2G..
120
- if ((navigator.connection.effectiveType || '').includes('2g')) {
121
- return;
122
- }
123
- // Don't prefetch if Save-Data is enabled..
124
- if (navigator.connection.saveData) {
125
126
+ // Don't prefetch if the user is on 2G or if Save-Data is enabled...
+ if ((navigator.connection.effectiveType || '').includes('2g') || navigator.connection.saveData) return;
127
128
129
// Wanna do something on catch()?
0 commit comments