Quellcode durchsuchen

Fix HTTP links not being preloaded

The first part of the condition returned true in that case, making the overall condition true.
Alexandre Dieulot vor 6 Jahren
Ursprung
Commit
454f9b5558
1 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
  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
   }