From b0b7ef9a6e1f474ac93a0a3ea6209efa16259e2b Mon Sep 17 00:00:00 2001 From: vhvy Date: Mon, 6 Dec 2021 15:35:52 +0800 Subject: [PATCH] fix unable to load third-party libraries. --- htmlpreview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htmlpreview.js b/htmlpreview.js index a38e616..e9cb569 100644 --- a/htmlpreview.js +++ b/htmlpreview.js @@ -44,7 +44,7 @@ script = document.querySelectorAll('script[type="text/htmlpreview"]'); for (i = 0; i < script.length; ++i) { src = script[i].src; //Get absolute URL - if (src.indexOf('//raw.githubusercontent.com') > 0 || src.indexOf('//bitbucket.org') > 0) { //Check if it's from raw.github.com or bitbucket.org + if (script[i].hasAttribute("src")) { //Check if it's has src attribute scripts.push(fetchProxy(src, null, 0)); //Then add it to scripts queue and fetch using CORS proxy } else { script[i].removeAttribute('type');