Skip to content

Commit

Permalink
breakage: entire elements are invisible if an user is banned
Browse files Browse the repository at this point in the history
  • Loading branch information
piquark6046 committed Dec 12, 2024
1 parent 78fbf9d commit c7fb358
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@list-kr/namulink",
"version": "4.1.0",
"version": "4.1.1",
"description": "",
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion sources/banner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// @downloadURL https://cdn.jsdelivr.net/npm/@list-kr/namulink@latest/dist/NamuLink.user.js
// @license MIT
//
// @version 4.1.0
// @version 4.1.1
// @author PiQuark6046 and contributors
//
// @match https://namu.wiki/*
Expand Down
4 changes: 4 additions & 0 deletions sources/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ const RemovePowerLinkAdWorker = (SearchedElements: HTMLElement[]): HTMLElement[]
|| //.test(getComputedStyle(HTMLInElement, '::before').getPropertyValue('content')))
)
})
TargetedElements = TargetedElements.filter(SearchedElement => {
return !SearchedElement.textContent.includes('https://board.namu.wiki/b/')
})
return TargetedElements
}

Expand All @@ -64,6 +67,7 @@ const RemovePowerLinkAd = async () => {
ElementsInArticle.push(...Array.from(Win.document.querySelectorAll('div[class] div[class*=" "]:has(span ~ ul li) ~ div div[class] > div[class] div[class] ~ *[class]')))
ElementsInArticle.push(...Array.from(Win.document.querySelectorAll('div:not([class*=" "]) div[class] *[class*=" "]:not(:has(svg[viewBox="0 0 20 20"]))')))
ElementsInArticle.push(...Array.from(Win.document.querySelectorAll('div[class*=" "] > div[class*=" "]:has(span ~ ul li) ~ div[class*=" "] > div[class]')))
ElementsInArticle.push(...Array.from(Win.document.querySelectorAll('div[onmouseover][onmouseout] ~ div[class*=" "] > div[style]')))
let TargetedElements: HTMLElement[] = []
const PLimitInstance = PLimit((navigator.hardwareConcurrency ?? 4) < 4 ? 4 : navigator.hardwareConcurrency)
const PLimitJobs: Promise<HTMLElement[]>[] = []
Expand Down

0 comments on commit c7fb358

Please sign in to comment.