分类:探索发现

Electron 通信新思路

这里指主进程与渲染进程之间的通信。 就像官方文档说的那样:Electron Docs -> Best Practices -> Security Only load secure content Disable the Node.js integration in all renderers that display remote content Enable context is

都什么年代了,Node.js 支持 ES6 模块了吗?

结论能用,但是有限制: 要加开启实验性功能的参数 脚本必须使用 .mjs 作为后缀 一但用了 ES6 模块,就不要想着再用 CommonJs 模块了(不可混用) 证明截止到我写这篇文章,Node.js 的最新版本为 12.7.0,先写一段我们以前耳熟能详,现在看起来老眼昏花的代码: // commonjs/funs.jsexports.a = function a() { retur