美文网首页
electron 中使用 nightmare

electron 中使用 nightmare

作者: w_w_wei | 来源:发表于2021-01-16 16:03 被阅读0次

参考资料:
https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/648629/

当前遇到的问题

  1. node版本过高可能导致编译失败
    推荐使用 v10.16.0

  2. 代码中重写 onbeforeunload 事件,可能导致异常
    修改文件, node_modules\eramthgin\lib\preload.js
    将其中 writable 修改为true

  // prevent 'onunload' and 'onbeforeunload' from being set
  Object.defineProperties(window, {
    onunload: {
      enumerable: true,
      writable: false,
      value: null
    },
    onbeforeunload: {
      enumerable: true,
      writable: true,
      value: null
    }
  });

通信

https://ithelp.ithome.com.tw/articles/10235110?sc=iThomeR

electron-vue

https://simulatedgreg.gitbooks.io/electron-vue/content/cn/

相关文章

网友评论

      本文标题:electron 中使用 nightmare

      本文链接:https://www.haomeiwen.com/subject/kzvnaktx.html