We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在子应用通过 url import 代码并执行,打印 window,拿到的是真实 window,而不是代理 window(子应用)。 这种情况是 remote import 的代码逃逸沙箱了吗?该怎么处理,从而拿到子应用的 window 变量。
1、say-window.js 文件 console.log('~~~~from remote url', { window })
2、子应用 import import('http://xxx/say-window.js')
3、查看打印内容 真实 window,而不是代理 window
The text was updated successfully, but these errors were encountered:
你通过 dynamic import 加载的脚本内访问 的 window 就是全局的 window,而非子应用代理的 window。因为 es module 的模块作用域都是独立。
如果你想拿到子应用的 fake-window,可以通过 window.proxy
fake-window
window.proxy
Sorry, something went wrong.
No branches or pull requests
提问之前强烈建立您能先阅读一下《如何正确的提出一个 Issue》
What happens?
在子应用通过 url import 代码并执行,打印 window,拿到的是真实 window,而不是代理 window(子应用)。
这种情况是 remote import 的代码逃逸沙箱了吗?该怎么处理,从而拿到子应用的 window 变量。
最小可复现仓库
1、say-window.js 文件
console.log('~~~~from remote url', { window })
2、子应用 import
import('http://xxx/say-window.js')
3、查看打印内容
真实 window,而不是代理 window
相关环境信息
The text was updated successfully, but these errors were encountered: