Skip to content

Commit 179b711

Browse files
authored
🐛 修复window.parent嵌套iframe会接受不到postMessage的消息 (#1335)
1 parent 1295807 commit 179b711

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/runtime/content/utils.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export function proxyContext(
134134
if (global[name] === global.self) {
135135
return special.global || proxy;
136136
}
137-
return global.top;
137+
return global[name];
138138
default:
139139
break;
140140
}
@@ -192,12 +192,8 @@ export function proxyContext(
192192
case "window":
193193
case "self":
194194
case "globalThis":
195-
return true;
196195
case "top":
197196
case "parent":
198-
if (global[name] === global.self) {
199-
return true;
200-
}
201197
return true;
202198
default:
203199
break;

0 commit comments

Comments
 (0)