在Electron中创建新的浏览器窗口时,将节点集成设置为false有什么结果? [英] What's the outcome of setting node-integration to false when creating a new browser window in Electron?

查看:207
本文介绍了在Electron中创建新的浏览器窗口时,将节点集成设置为false有什么结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了使jQuery在我在Electron(以前称为Atom Shell)中打开的HTML页面中正确加载和运行,我必须在创建 BrowserWindow 在我的 main.js 文件中。

In order to get jQuery to load and function correctly in a HTML page I was opening in Electron (formerly Atom Shell), I had to disable Node integration when creating the BrowserWindow in my main.js file.

有人可以告诉我 node的设置是什么-integration:false 将使我无法执行我通常不会禁用的功能?

Can someone please tell me what setting node-integration: false will keep me from being able to do that I would normally be able to do had I not disabled it?

推荐答案

将node-integration设置为false将在渲染器进程中禁用node.js-即,您的应用程序只能 进行网络浏览器的操作。不用执行此操作,而使用与Electron兼容并且具有相同API的Zepto.js。

Setting node-integration to false will disable node.js in the renderer process - i.e. your app can only do what a web browser will do. Instead of doing this, use Zepto.js which is compatible with Electron and has the same API.

这篇关于在Electron中创建新的浏览器窗口时,将节点集成设置为false有什么结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆