Skip to content

🐛 修复 early-start 事件分发失效#1490

Closed
CodFrm wants to merge 1 commit into
release/v1.4from
fix/early-start-performance-event
Closed

🐛 修复 early-start 事件分发失效#1490
CodFrm wants to merge 1 commit into
release/v1.4from
fix/early-start-performance-event

Conversation

@CodFrm
Copy link
Copy Markdown
Member

@CodFrm CodFrm commented Jun 5, 2026

错误的问题修复

@CodFrm CodFrm closed this Jun 5, 2026
@CodFrm CodFrm deleted the fix/early-start-performance-event branch June 5, 2026 06:44
@cyfung1031
Copy link
Copy Markdown
Collaborator

所以有方法修?应该没有吧。赌运游戏
(例如brave那些恶心scriptlet一定会比extension跑得更快。)
我觉得还是可以啦。不然你只能把VM那一套生成iframe抽出函式套用到SC

Rob Wu大佬们昨天开会了谈main world script 被污染这个问题。但目前未有定案

@CodFrm
Copy link
Copy Markdown
Member Author

CodFrm commented Jun 5, 2026

所以有方法修?应该没有吧。赌运游戏 (例如brave那些恶心scriptlet一定会比extension跑得更快。) 我觉得还是可以啦。不然你只能把VM那一套生成iframe抽出函式套用到SC

Rob Wu大佬们昨天开会了谈main world script 被污染这个问题。但目前未有定案

再观察一下,测试一下,准备发布下一个版本

let o = { cancelable: true, detail: { scriptFlag: '${flag}', scriptInfo: (${scriptInfoJSON}) } },
c = typeof cloneInto === "function" ? cloneInto(o, performance) : o,
f = () => performance.dispatchEvent(new CustomEvent('${evScriptLoad}', c)),
f = () => dispatchEvent.call(performance, new CustomEvent('${evScriptLoad}', c)),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当时我在写这个就意识到有被修改的问题,但我不觉得要处理。它不像window那样会失效。(没有沙盒替换) 假设能被改后也能正常执行吧。

如果你要仔细去想,Function.prototype的call和apply也可以被污染。

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.

2 participants