Skip to content

Commit 76e85b9

Browse files
committed
🐛 修复 @early-start 移除后脚本注入失败的问题 (scriptscat#871)
1 parent ae79e6a commit 76e85b9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/app/service/service_worker/runtime.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,14 @@ export class RuntimeService {
354354
// 如果是后台脚本, 在offscreen中进行处理
355355
// 脚本类别不会更改
356356
if (script.type === SCRIPT_TYPE_NORMAL) {
357+
const isCurrentEarlyStart = this.earlyScriptFlags.has(uuid);
357358
const isEarlyStart = isEarlyStartScript(script.metadata);
358359
if (isEarlyStart && enable) {
359360
this.earlyScriptFlags.add(uuid);
360361
} else {
361362
this.earlyScriptFlags.delete(uuid);
362363
}
363-
if (isEarlyStart) {
364+
if (isEarlyStart || isCurrentEarlyStart !== isEarlyStart) {
364365
needReRegisterInjectJS = true;
365366
}
366367
// 加载页面脚本

0 commit comments

Comments
 (0)