[净化标题消息] 改用更稳定的实现方案#93
Merged
Merged
Conversation
Owner
|
不错欧~ 一开始我收到这个需求后,想不到什么更好的实现方法,尝试监控 一会我递增一下版本号~ |
XIU2
added a commit
that referenced
this pull request
Sep 17, 2021
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.
这一方案的优势之处在于:
defineProperty重新定义document.title属性,会使本脚本抛出异常停止工作。反之则使第三方无法正常工作。这也是本人所遇到的问题。document.title读取问题,其实已经影响到知乎官方代码的读取(在访问器里打个断点可以跟踪到,不过似乎并没有对官方代码执行造成实质性的不良影响)。<title>是底层机制,对标题修改的拦截性比document.title全面。defineProperty方案改动更麻烦。