garfish
garfish copied to clipboard
Garfish vm sandbox support dom 0 event
Describe the bug
// 独立运行可以正常触发回调,在微前端环境无法正常触发
window.onmessage = function () {
// 可以正常获取微前端应用回调
}
暂时解决方案
将 dom 零级事件转换成,addEventListener
window.addEventListener('message',() => {
})
Reproduction
https://github.com/modern-js-dev/garfish/tree/main/dev
Used Package Manager
pnpm
System Info
System:
OS: macOS 11.6
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 310.52 MB / 32.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.18.3 - ~/.nvm/versions/node/v14.18.3/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 6.14.15 - ~/.nvm/versions/node/v14.18.3/bin/npm
Browsers:
Chrome: 100.0.4896.88
Safari: 14.1.2
npmPackages:
garfish: 1.5.2
Validations
- [X] Read the docs.
- [X] Read the common issues list.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Garfish issue and not a framework-specific issue.
- [X] The provided reproduction is a minimal reproducible example of the bug.