角电子节点集成:“ iframe”不起作用(角7)

时间:2019-07-09 01:02:31

标签: angular iframe electron

我想创建一个浏览器窗口,该浏览器窗口支持带角度/电子应用程序的iframe。我看到在线发布的解决方案是

Win = new BrowserWindow({
  nodeIntegrations: "iframe"
})

这似乎仅在javascript中起作用,而在尝试使用打字稿时却给出了错误。

Argument of type '{ nodeIntegrations: string; width: number; height: 
number; maximizable: false; minimizable: false; fullscreen: false; 
show: false; webPreferences: { webSecurity: false; nodeIntegration: 
true; partition: string; }; }' is not assignable to parameter of type 
'BrowserWindowConstructorOptions'.
Object literal may only specify known properties, and 
'nodeIntegrations' does not exist in type 
'BrowserWindowConstructorOptions'

我已经在main.ts浏览器窗口中启用了nodeIntegration,如下所示:

webPreferences: {webSecurity: false, nodeIntegration : true}

但是,它似乎并没有以任何方式影响iframe。为什么会发生这种情况,并且有解决办法?

0 个答案:

没有答案