Преглед изворни кода

Fix HTTP links not being preloaded

The first part of the condition returned true in that case, making the overall condition true.
Alexandre Dieulot пре 6 година
родитељ
комит
454f9b5558
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      instantpage.js

+ 5 - 1
instantpage.js

@@ -99,7 +99,11 @@ function isPreloadable(linkElement) {
     return
   }
 
-  if (urlObject.protocol != 'https:' || (urlObject.protocol == 'http:' && location.protocol == 'https:')) {
+  if (!['http:', 'https:'].includes(urlObject.protocol)) {
+    return
+  }
+
+  if (urlObject.protocol == 'http:' && location.protocol == 'https:') {
     return
   }