Skip to content

Commit

Permalink
only support http(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenghongyao committed Feb 2, 2022
1 parent bc4b4ea commit 9eb1aa2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ node_modules
data.json
main.js
main.js.LICENSE.txt
release
deploy.bat



4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 9eb1aa2

Please sign in to comment.