当前位置:网站首页>Electron使用romote报错 : Uncaught TypeError: Cannot read property ‘BrowserWindow‘ of undefined
Electron使用romote报错 : Uncaught TypeError: Cannot read property ‘BrowserWindow‘ of undefined
2022-07-30 05:50:00 【HW-Header】
今天在学习electron当中的remote模块时,遇到了一个巨坑:remote模块不存在。在国内的问答网站中皆未找到解决办法,最后在stack overflow中找到了解决办法,在此留下足迹,帮助其他伙伴。
原因很简单,在Electron 10.x中,enableRemoteModule的默认值为false,也就是默认情况下是不支持使用remote模块的,因此使用remote模块的应用程序需要将enableRemoteModule显式设置为true。
mainWindow = new BrowserWindow({
width:400,
height:400,
webPreferences: {
nodeIntegration: true, // 集成node环境
enableRemoteModule: true // 使用remote模块
}
}) //设置打开的窗口大小
边栏推荐
- prometheus-Federation机制配置
- What happens when @Bean and @Component are used on the same class?
- The terminal connection tools, rolling Xshell
- DHCP原理与配置
- Is it possible to use the same port for UDP and TCP?
- Test Development Engineer Growth Diary 015 - Top 20 Test Interview Questions
- export , export default, import complete usage
- Test the basics 02
- MySQL主从复制配置搭建,一步到位
- 空间平面相交的直线的计算及其源码
猜你喜欢

RAID disk array

Station B collapsed, what would you do if you were the developer in charge that night?

prometheus监控minio

空间直线到平面上的交点的计算证明及其源码

VR机器人教你如何正确打乒乓球

Rodrigues: vector representation of rotation matrices

如何理解普吕克坐标(几何理解)

Test and Development Engineer Growth Diary 009 - Environment Pai Pai Station: Development Environment, Test Environment, Production Environment, UAT Environment, Simulation Environment

B站崩了,如果是你是那晚负责的开发人员你会怎么做?

MYSQL-GROUP BY 用法 全网最精,通熟易懂的话解释
随机推荐
Linx common directory & file management commands & VI editor usage introduction
STL源码剖析:class template explicit specialization代码测试和理解
Let the "label" content in Baidu map generator expand--solution
限塑令下的新材料——聚乳酸(PLA)
Test Development Engineer Growth Diary 001 - Some Introduction to Agile Testing, CI/CD/CT, DecOps
matlab机器学习_01
SE_01
删除openstack中的僵尸实例
彻底删除openstack中镜像的记录
Advanced multi-threading (lock strategy, spin+CAS, Synchronized, JUC, semaphore)
Data types of Redis6
Selenium01
UDP和TCP使用同一个端口,可行吗?
Network Protocol 01 - Basic Concepts
Process and Scheduled Task Management
The calculation and source code of the straight line intersecting the space plane
Test development engineer growth diary 016 - those things about the test
debian vsftpd + ssl
window.open()的用法,js打开新窗体
MySQL什么时候用表锁,什么时候用行锁?