Electron - Not allowed to load local resource

后端 未结 10 1955
夕颜
夕颜 2020-12-28 14:05

Evening,
I\'m looking into using electron to package an existing angular2 build. I thought I had a dry run working but the actual packaging seems to be failing (see fina

10条回答
  •  我在风中等你
    2020-12-28 14:34

    this works for me on linux

     newWindow.loadFile(`${__dirname}/index.html`);
    

    you can add this to view the directory of your main.js and from there navigate to the index.html. console.log(__dirname)

提交回复
热议问题