How to include Chrome DevTools in Electron?

前端 未结 7 1219
小鲜肉
小鲜肉 2020-12-09 04:52

I\'m still new to Electron which I\'m currently following here.

I\'ve read this page regarding on how to include the Chrome DevTools so that I can debug my applicati

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-09 05:18

    So, after you've required the following:

    var app = require('app');
    

    You can use the following code (I use it in my app):

    app.commandLine.appendSwitch('remote-debugging-port', '8315');
    app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1');
    

    Accessing the following address allows me to debug the application in Chrome:

    http://127.0.0.1:8315
    

    I hope this helps you out. I'm also new to Electron!

    If you also need to do some configurations to the underlying browser engine, please, refer to the docs.

提交回复
热议问题