本文由 资源共享网 – ziyuan 发布,转载请注明出处,如有问题请联系我们![免费]electron框架开启远程调试
收藏app.commandLine.appendSwitch('remote-debugging-port', '9222');//开启远程调试 app.commandLine.appendSwitch('remote-allow-origins', '*');//允许所有源访问
在main.loader.js加上上面的代就可以
如:
require('bytenode');const path = require('node:path'); const arch = process.arch;const { app } = require('electron'); app.commandLine.appendSwitch('remote-debugging-port', '9222');//开启远程调试 app.commandLine.appendSwitch('remote-allow-origins', '*');//允许所有源访问 require(path.join(__dirname, './bin/main-darwin-' + arch + '.jsc'));