Skip to content
New issue

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

在electron内置浏览器中, isType('Window')没有判断出是浏览器环境 #59

Open
kscript opened this issue Feb 24, 2022 · 1 comment

Comments

@kscript
Copy link

kscript commented Feb 24, 2022

Describe the bug
在electron中不能正常使用

Expected behavior
希望在electorn中也能正常使用

Information
由于 electron 内置浏览器中调用 Object.prototype.toString.call(window) 返回 '[object global]' 而非 '[object Window]',
因此 @zyf2e/monitor-utils 模块的 isType 函数没有正确判断出来是浏览器环境

@WuChenDi
Copy link

提供个思路,electron有global(就是node环境内的global),浏览器内没有global

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

No branches or pull requests

2 participants