YousList
YousList copied to clipboard
나무위키 하단 파워링크
나무위키 개별 항목 하단 파워링크 광고가 언제인가부터 차단이 안되고 있습니다. 차단 지원 해주시면 좋을 것 같습니다.
예제: https://namu.wiki/w/uBlock%20Origin
제보 감사합니다. #198 이슈 대응 이후에 차단하기 까다롭게 업데이트 되어 방법을 고민 중입니다.
aac6f9f 커밋에서 업데이트했습니다. 자리까지 없어지진 않지만 실제 광고는 나오지 않습니다.
추가로 아이디가 있는 경우 스킨을 변경하면 광고가 나오지 않는다는 정보가 있습니다. https://board.namu.wiki/b/free/2768161
확인해보니 또 사이트가 업데이트되어 광고가 보이는 상태입니다.
2022-01-22 오후 5:39 광고 안나오네요. 적용 감사드립니다
개발자도구를 열어보니 "https://namu.wiki/i/" + 무작위 문자열
로 시작하는 URL을 차단하던데, 이 때문에 오류가 발생하는 것으로 보입니다..
파이어폭스에서는 가만히 있으면 다시 정상적인 페이지로 이동하는데, 크롬에선 안 되네요.
문제가 생기는 부분은 되돌렸습니다.
namu.wiki#?#article div[id]:-abp-has(.wiki-macro-toc:not(#toc))
제가 방금 만든 필터인데(AdBlock 기준), 이렇게 해보시면 어떨까요?
-
나무위키의 광고영역에는 "fakewiki"라고 하는[^1], 화면상에는 안보이지만 마치 문서 내용같이
.wikik-paragraph
나.wiki-link-internal
등이 들어있는 요소가 있는데요. 얘가 왜 존재하는 지는 확실치는 않으나, 이걸 이용해서 광고영역을 구분하는 게 먹히더라구요. -
나무위키의 목차는
<div class="wiki-macro-toc" id="toc"> ... </div>
처럼 생겼고, id가toc
로 되어있으나 저 fakewiki 영역의 경우엔 id가 없습니다. 웹 표준상 같은 아이디를 두 번이상 사용하는 걸 허용하지 않으므로, 문서에서 사용하는 목차인지 아닌지를 구분할 수 있을거 같습니다.
[^1]: 나무위키의 전역변수 webpackJsonp
내부에 있습니다.
@gaeulbyul 감사합니다. 지금도 .wiki-macro-toc
항목이 보이시나요? 지금은 #toc
외에는 안 잡히는 것 같습니다.
어... 이번엔 저 요소가 없어졌네요... 예상보다 금방 대응하는 걸 보면 이쪽을 모니터링이라도 하는거 같습니다... 😅 다른 방법을 강구해봐야겠네요..
이런 식으로 해볼 수는 있을 것 같습니다.
namu.wiki#?#article div[id]:-abp-has(img[src*="//searchad-phinf.pstatic.net/"])
다만 가끔가다 이미지가 없는 광고가 있더라구요. 이 점을 감안하면 다른 방법도 연구해봐야겠습니다..
namu.wiki##article div[id]:empty + div[id]:empty + div[id]:not(:empty) + div[id]:not(:empty)
광고영역 주변에 내용없이 비어있는 <div>
태그가 있다는 점을 이용하여 작성한 규칙입니다. (솔직히, 이것도 오래 못가서 금방 우회할거 같긴 합니다만...)
searchad-phinf.pstatic.net은 최근에 추가해서 이미지와 같이 있는 광고인데 텍스트만 보이는 중입니다.
PR을 남기고 싶었는데 방법을 잘 모르겠어서 댓글로 남깁니다.
namu.wiki##:xpath(//article//div[div[count(.//div/img[starts-with(@src, '//w.namu.la/s/')]) > 2]/following-sibling::div[count(.//div[2]/span[starts-with(text(), 'http')]) = 3]])
div>span>img
형태로 사이트가 변경되었네요.
namu.wiki##:xpath(//article//div[count(div) = 2][count(div[1]//img[starts-with(@src, '//w.namu.la/s/')]) > 2][count(div[2]//div[starts-with(text(), 'http')]) = 3])
바뀐 디자인에도 대응 가능한 버전입니다
어느 순간 다시 나오기 시작했습니다.
광고 텍스트에서 프로토콜을 뺐네요.
@item4 이런 건 어떤가요?
namu.wiki##:xpath(//article//div[count(div)=2][count(div[1]//img[starts-with(@src,'//w.namu.la/s/')])>2][div[2][count(div)=3]/div/div[last()][count(div)=3]])
프로토콜 검사를 넣었던게 오작동 방지목적이었는데 프로토콜이 없는 URL 패턴을 xpath로 검사하는 건 매우 비현실적인듯하니 그냥 저게 나아보입니다.
하단 div에 빈 div가 추가되었네요.
이번엔 상위 div에 빈 div가 추가되었네요.
@yous Umanle S.R.L. updated their website to prevent List-KR Script and Youslist blocking their PowerLink advertisement.
Accidentally closed in ac876de (#212), re-opening for future issues.
Note that namu.wiki site owner updated their structure, so we need an update to the filter.
Please, update to following filter as simply removing [id]
condition from div
works:
##article>p+div div[id]:has(div[id]:has(div>ul>li,div>a[href*="/w/%EB%B6%84%EB%A5%98:"]))~div:has(img[src*="//w.namu.la/s/"],img[src^="data:image/png;base64,"])
div[id]>ul>li
to div>ul>li
Namuwiki removed <p/>
tag inside article
tag and rule update is required.
Here is another rule that works:
##article div:has(a[href*="/w/%EB%B6%84%EB%A5%98:"]) ~ div:has(td > img[src*="w.namu.la"], td > img[src^="data:image/png;base64,"])
Using td
to detect the image is bit dangerous as we can make false-positive case when namuwiki updates their website to use td
tag in content area.

Namuwiki updated their site structure again. Also, changed the image host to ww.namu.la
.
namu.wiki##article div:has(a[href*="/w/%EB%B6%84%EB%A5%98:"]) ~ div:has(tr > td img[src^="//ww.namu.la"])
Update 1
Fixes invalid blocking
##article div:has(a[href*="/w/%EB%B6%84%EB%A5%98:"]) ~ div:has(tr > td img[src^="//ww.namu.la"] + div[class] + div[class])
Update 2
Found new edge case
##article div:has(a[href*="/w/%EB%B6%84%EB%A5%98:"]) ~ div:has(div.wiki-paragraph) ~ div:has(tr > td img[src^="//ww.namu.la"])
Update 3
Found yet another edge case that DOM structure was completely different
namu.wiki##article div:has(a[href*="/w/%EB%B6%84%EB%A5%98:"]) ~ div:has(div.wiki-paragraph) ~ div:has(img[src*="w.namu.la"])
@yous Someone has dom structure that doesn't include table
related tag on their view. Also, their image links that shown on dom started with //w.namu.la
. Please, consider the edge case. I don't know why but the structure was really different.
From @Bananamilk452