首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >@electron/remote的getCurrentWindow不返回完整的窗口对象

@electron/remote的getCurrentWindow不返回完整的窗口对象
EN

Stack Overflow用户
提问于 2022-06-16 21:46:43
回答 1查看 70关注 0票数 0

当使用@electron/remote时,remote.getCurrentWindow()的结果缺少窗口的所有附加属性/方法,这些属性/方法可以从main进程访问,而在使用remote.getCurrentWindow()与内置remote一起使用时,这些属性/方法也是可以访问的。例如:

@electron/remote

代码语言:javascript
运行
复制
  const remote = require('@electron/remote');
  console.log(remote.getCurrentWindow().isFullScreen); // undefined

原始远程模块

代码语言:javascript
运行
复制
  const { remote } = require('electron');
  console.log(remote.getCurrentWindow().isFullScreen); // true/false

行为差异的原因是什么?我能找到的任何地方都没有记录。

EN

Stack Overflow用户

发布于 2022-06-17 08:04:12

nodeIntegration: true contextIsolation: false放在webPreferences of mainWindow中。也许这就是问题所在。

票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72652218

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档