From 3fcbc17ab3f509b876a70d40324faa3046c9e565 Mon Sep 17 00:00:00 2001 From: limodou Date: Sun, 2 Oct 2016 17:49:18 +0800 Subject: [PATCH] Relative url compare is not right The href value from link tag will include the protocal and domain, so that the compare will be not right. So I add them if the url is relative path. --- import.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/import.js b/import.js index c2e9dee..696b2b8 100644 --- a/import.js +++ b/import.js @@ -119,6 +119,8 @@ function searchExists (type, url) { var attr = srcByType(type), list = document.getElementsByTagName(tagByType(type)); + if (url.indexOf('://') == -1) + url = window.location.protocol + '//' + window.location.host + url for (var i=0; i