Class: Debugger

    Process: Main
    This class is not exported from the 'electron' module. It is only available as a return value of other methods in the Electron API.

    Chrome Developer Tools has a available at JavaScript runtime that allows interacting with pages and instrumenting them.

    Event: ‘detach’

    Returns:

    • event Event
    • reason String - Reason for detaching debugger.

    Event: ‘message’

    Returns:

    • method String - Method name.
    • params any - Event parameters defined by the ‘parameters’ attribute in the remote debugging protocol.
    • sessionId String - Unique identifier of attached debugging session, will match the value sent from debugger.sendCommand.

    Emitted whenever the debugging target issues an instrumentation event.

    Instance Methods

    debugger.attach([protocolVersion])

    • protocolVersion String (optional) - Requested debugging protocol version.

    Attaches the debugger to the webContents.

    debugger.isAttached()

    debugger.detach()

    Detaches the debugger from the webContents.

    debugger.sendCommand(method[, commandParams, sessionId])

    • method String - Method name, should be one of the methods defined by the .
    • sessionId String (optional) - send command to the target with associated debugging session id. The initial value can be obtained by sending Target.attachToTarget message.

    Returns Promise<any> - A promise that resolves with the response defined by the ‘returns’ attribute of the command description in the remote debugging protocol or is rejected indicating the failure of the command.

    Send given command to the debugging target.