From 9eb1aa2869f1173d1a313f1380782af95532ccd4 Mon Sep 17 00:00:00 2001 From: chenghongyao <1253146300@qq.com> Date: Wed, 2 Feb 2022 21:33:54 +0800 Subject: [PATCH] only support http(s) --- .gitignore | 4 ++++ src/main.ts | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 67b9620..ae0f955 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,8 @@ node_modules data.json main.js main.js.LICENSE.txt +release +deploy.bat + + diff --git a/src/main.ts b/src/main.ts index b31c30c..c306e19 100644 --- a/src/main.ts +++ b/src/main.ts @@ -79,8 +79,8 @@ export default class URLBlockPlugin extends Plugin { if (p.parentElement.tagName !== "DIV" || p.children.length !== 1)continue; const ael = p.children[0] as HTMLAnchorElement; if (ael.tagName == "A" && ael.className === "external-link" && p.textContent === ael.textContent ) { - const href = ael.href; - const g = r.exec(href) + const g = r.exec(ael.href) + if (!g) continue; let icon = ""; if (g) { icon = g[1] + "/favicon.ico";