整理知乎美化脚本:移除越权剪贴板逻辑并保留界面兼容修复 - #619
Draft
andrew05060414 wants to merge 6 commits into
Draft
Conversation
中文:覆盖知乎问题页的全部回答路由。
中文:问题页正文容器改为填满宽屏外层,避免继承中间窄容器的宽度。
andrew05060414
marked this pull request as draft
July 29, 2026 05:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更
知乎美化中误加入的“复制为 Markdown”与剪贴板读写逻辑。归属说明
“复制全文为 Markdown”属于
知乎备份剪藏的功能,不属于本脚本。本 PR 不再读取或改写剪贴板,也不再申请GM_setClipboard,因此不会与备份剪藏的 Markdown 复制按钮互相干扰,也不会触发额外的剪贴板读取权限提示。根因
此前将两个脚本的职责混在一起:知乎美化通过全局点击监听、
navigator.clipboard.readText()轮询和GM_setClipboard试图修改另一个脚本生成的 Markdown。这样会造成重复处理、剪贴板权限提示和脚本间竞态。现在已将这部分逻辑从知乎美化移除,Markdown 标题和剪贴板写入由备份剪藏自身负责。验证
node --check Zhihu-Beautification.user.jsgit diff --checkZhihu-Beautification.user.js仍建议在知乎问题页、回答详情页、专栏文章页和图片查看器页面分别实测菜单与布局。