How to include Chrome DevTools in Electron?

前端 未结 7 1236
小鲜肉
小鲜肉 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:24

    To enable opening dev tools via key strokes, I added this to my index.html:

    
    

    Be aware that this allows any user of the production electron app to access dev tools with the common keyboard shortcuts (function: F12 or ctrl + shift + I on PC, cmd + option + i on Mac).

    One thing that did not work for me was passing this to the BrowserWindow constructor:

    webPreferences: {
        devTools: true
    }
    

提交回复
热议问题