Skip to content

feat(知乎增强): 添加“选中文字加入屏蔽词”菜单入口 - #583

Merged
XIU2 merged 1 commit into
XIU2:masterfrom
ocean-sudo:feat/zhihu-selected-keyword-menu
Mar 18, 2026
Merged

feat(知乎增强): 添加“选中文字加入屏蔽词”菜单入口#583
XIU2 merged 1 commit into
XIU2:masterfrom
ocean-sudo:feat/zhihu-selected-keyword-menu

Conversation

@ocean-sudo

@ocean-sudo ocean-sudo commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

变更说明

这个 PR 为 Zhihu-Enhanced.user.js 增加了一个 Tampermonkey 菜单项,用于将当前选中的文字直接追加到现有的屏蔽关键词列表中。

具体改动

  • 新增菜单项:添加选中文字到屏蔽词
  • 缓存最近一次选中的文字,避免脚本菜单回调里取不到当前选区
  • 写入前会对首尾空格和连续空白做基础归一化
  • 对重复关键词做大小写无关去重
  • 保持现有关键词匹配范围不变,仍然只匹配标题和评论
  • 不自动刷新页面
  • 不强制对当前已加载内容立即重跑过滤

验证

  • node --check Zhihu-Enhanced.user.js

Closes #582

@ocean-sudo ocean-sudo changed the title feat(zhihu): add selected-text keyword menu action feat(知乎增强): 添加“选中文字加入屏蔽词”菜单入口 Mar 18, 2026
@XIU2
XIU2 merged commit 7cc4bdf into XIU2:master Mar 18, 2026
@XIU2

XIU2 commented Mar 18, 2026

Copy link
Copy Markdown
Owner

我调整了一下菜单中选项的位置(以及相关代码的位置),别的看了下好像也没什么可调整的了,很全面。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[知乎增强] 希望增加“选中文字加入屏蔽词”的 Tampermonkey 菜单入口

2 participants