How to use the electron-debug.openDevTools function in electron-debug

To help you get started, we’ve selected a few electron-debug examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github witnet / sheikah / app / main / ui.ts View on Github external
mainWindow.webContents.on("did-finish-load", () => {
    if (mainWindow) {
      mainWindow.maximize()
      mainWindow.show()
      mainWindow.focus()
    }
  })

  mainWindow.on("closed", () => {
    mainWindow = undefined
  })

  if (inDevelopment) {
    const electronDebug = require("electron-debug")
    electronDebug()
    electronDebug.openDevTools(mainWindow)
    // eslint-disable-next-line  @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
    mainWindow.webContents.on("context-menu", (e: any, props: any) => {
      const { x, y } = props

      Menu.buildFromTemplate([{
        label: "Inspect element",
        click() {
          if (mainWindow) {
            mainWindow.webContents.inspectElement(x, y)
          }
        },
      }]).popup(props)
    })
  }

  if (inDarwin) {
github eyasliu / electron-startkit / src / main / libs / core / window.js View on Github external
create(config = {}) {
    this._currentWindow = new BrowserWindow({
      ...windowCurrentSetting,
      ...config,
    })

    this.instences.push(this._currentWindow)

    if (config.url) {
      this.loadURL(config.url)
    }

    if (process.env.NODE_ENV === 'development') {
      if (config.devtool) {
        require('electron-debug').openDevTools(this._currentWindow)
      }
    }

    return this._currentWindow
  }

electron-debug

Adds useful debug features to your Electron app

MIT
Latest version published 2 months ago

Package Health Score

78 / 100
Full package analysis