Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugger in compiled Electron App

I need the chrome debugger in a compiled Windows application(Electron App)

My main.js:

const electron = require('electron')
require('electron-debug')({showDevTools: true});
const app = electron.app
const BrowserWindow = electron.BrowserWindow

const path = require('path')
const url = require('url')

let mainWindow

function createWindow () {

  mainWindow = new BrowserWindow({width: 800, height: 800})
   mainWindow.loadURL('https://camservices.prointernet.com/client.html');

  mainWindow.on('closed', function () {

    mainWindow = null
  })
}
app.on('ready', createWindow)
app.on('window-all-closed', function () {

  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('activate', function () {

  if (mainWindow === null) {
    createWindow()
  }
})

But the Debugger don't show up on a compiled application.

like image 728
n00dle Avatar asked Feb 02 '26 02:02

n00dle


1 Answers

According to the documentation, you can force it to appear in a production app by adding the enabled property.

require('electron-debug')({showDevTools: true, enabled: true});
like image 77
Alex Warren Avatar answered Feb 04 '26 20:02

Alex Warren



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!