Ver Fonte

Fix HTTP links not being preloaded

The first part of the condition returned true in that case, making the overall condition true.
Alexandre Dieulot há 6 anos atrás
pai
commit
454f9b5558
1 ficheiros alterados com 5 adições e 1 exclusões
  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
   }