1

ublock 用 :has 选择器来屏蔽指定类别帖子

 1 year ago
source link: https://www.v2ex.com/t/925409
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  分享创造

ublock 用 :has 选择器来屏蔽指定类别帖子

  vsitebon · Quorafind · 4 小时 43 分钟前 · 497 次点击

例如屏蔽所有的推广帖子:

! 2023-03-19 https://v2ex.com
v2ex.com##div.item.cell:has(a[href^="/go/promotions"])
6 条回复    2023-03-20 10:41:25 +08:00
Mithril

Mithril      4 小时 17 分钟前   ❤️ 2

也可以用 has-text 屏蔽主题中包含特定关键词的帖子,比如狗屁通
v2ex.com##div.item.cell:has(a:has-text(/ChatGPT/i))
vsitebon

vsitebon      4 小时 12 分钟前

@Mithril #1 谢谢分享!我才知道
yfugibr

yfugibr      4 小时 10 分钟前 via Android

pc 端网页可以忽略节点
Pipecraft

Pipecraft      2 小时 57 分钟前

感谢楼主和 1 楼分享,学到了。
类似方式用 stylus 也可以。
```css
div.item.cell:has(a[href^="/go/promotions"]) {
display: none;
}
div.item.cell:has(a[href^="/go/openai"]) {
opacity: 20%;
}
```
Pipecraft

Pipecraft      2 小时 55 分钟前

我的一个油猴脚本,也可以快速屏蔽某个节点。https://www.v2ex.com/t/924103

给节点添加 block 标签,可以快速隐藏所有该节点的帖子。

vbNqNPQ.png

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK