fix: create_context 的空物件改为 Object.create(null)#1397
Open
cyfung1031 wants to merge 1 commit intomainfrom
Open
Conversation
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.
Checklist / 检查清单
Description / 描述
有点难重视。但我确实遇到了这个问题
当其他脚本先注入到环境,例如用了
@unwrap,又或者是其他 userscript manager, 又或者是其他 浏览器扩充直接插入 page script当它们进行以下的
Object.prototype骑劫后,这样的话,如果直接用
const desc = {}, 然后这样就会在 desc 里生成一个
testComplete: true最终
Object.create就会失败然后完全崩溃解決方法是把
{}改成Object.create(null)Screenshots / 截图