Electron - Not allowed to load local resource

后端 未结 10 1921
夕颜
夕颜 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:28

    I had the same problem. This worked for me

    // and load the index.html of the app.
      window.loadURL(url.format({
        pathname: path.join(__dirname, 'dist/index.html'), // important
        protocol: 'file:',
        slashes: true,
        // baseUrl: 'dist'
      }));
    

提交回复
热议问题