mobileFX WebKitX CEF3 ActiveX 4.x
WebKitXCEF3Lib ActiveX Control / WebKitXCEF3 Object / DebuggerAddBreakpoint Method

String, the Script ID or URL of the script to add the Break point.

Integer, the line number to add the Break point.

Integer, the column number to add the Break point.

In This Topic
    DebuggerAddBreakpoint Method
    In This Topic
    Description

    Adds a Break point to a Debugger. 

    Syntax
    Visual Basic
    Public Sub DebuggerAddBreakpoint( _
       ByVal Debugger As WEBKITX_DEBUGGER, _
       ByVal Script As String, _
       ByVal Line As Long, _
       ByVal Col As Long _
    ) 
    Parameters
    Debugger
    ValueDescription
    DEBUGGER_CHROMIUM

    Defines use of Chromium Debugger for WebKitX debugger commands and events.

    DEBUGGER_NODEJSDefines use of node.js Debugger for WebKitX debugger commands and events.
    Script

    String, the Script ID or URL of the script to add the Break point.

    Line

    Integer, the line number to add the Break point.

    Col

    Integer, the column number to add the Break point.

    Remarks

    Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads.

    This is intended for IDE developers with prior experience with Inspector Protocol. WebKitX offers debugging capabilities for both Chromium and Node.js. For more information please refer to these guides:

    https://nodejs.org/en/docs/guides/debugging-getting-started/

    https://chromedevtools.github.io/devtools-protocol/1-2/

    Example
    Private Sub WebKitX_OnCreate(ByVal Settings As WebKitXCEF3Lib.ISettings, CommandLineSwitches As String)
        
        On Error Resume Next
        
        With Settings
            
            .app_path = App.Path
            .accept_language_list = "es-CL,en-GB"
            .remote_debugging_port = 9999
            .persist_session_cookies = 0
            .persist_user_preferences = 0
            
            .nodejs_auto_start = False
            .nodejs_debug_port = 9998
            .nodejs_debugger_protocol = "inspector"
            .nodejs_executable = App.Path + "\etc\config\server\node.exe"
            .nodejs_modules_path = App.Path + "\etc\config\server\node_modules"
            .nodejs_command_line_arguments = " --stack-trace-limit=25 --interactive --report-compact --insecure-http-parser "
            .nodejs_terminate_on_debug_end = True
            
        End With
        
        CommandLineSwitches = CommandLineSwitches + " --no-proxy-server --disable-cache --disable-gpu-program-cache --disable-gpu-shader-disk-cache"
        CommandLineSwitches = CommandLineSwitches + " --disable-background-networking --disable-background-timer-throttling --disable-backgrounding-occluded-windows"
        CommandLineSwitches = CommandLineSwitches + " --disable-breakpad --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage "
        CommandLineSwitches = CommandLineSwitches + " --disable-renderer-backgrounding --disable-sync --metrics-recording-only --no-first-run --no-default-browser-check"
        
    End Sub
    
    Public Sub LoadBreakPoints(Debugger As WEBKITX_DEBUGGER)
    
        On Error Resume Next
        
        If XDOM Is Nothing Then Exit Sub
        
        Dim URL As String
        Dim BreakPoint As IXMLDOMElement
        
        If Debugger = DEBUGGER_CHROMIUM Then
                    
            ' Load client breakpoints
            URL = XDOM.selectSingleNode("JSON/CLIENT_SCRIPT_URL").Text
            For Each BreakPoint In XDOM.selectNodes("JSON/CLIENT_BREAKPOINTS/item")
                WebKitX.DebuggerAddBreakpoint DEBUGGER_CHROMIUM, URL, CLng(BreakPoint.Text) - 1, 0
            Next
        
        End If
        
        If Debugger = DEBUGGER_NODEJS Then
                
            ' Load server breakpoints
            URL = XDOM.selectSingleNode("JSON/SERVER_SCRIPT_URL").Text
            For Each BreakPoint In XDOM.selectNodes("JSON/SERVER_BREAKPOINTS/item")
                WebKitX.DebuggerAddBreakpoint DEBUGGER_NODEJS, URL, CLng(BreakPoint.Text) - 1, 0
            Next
            
            WebKitX.DebuggerContinue DEBUGGER_NODEJS
                
        End If
        
        UpdateDebuggerStatus
        
    End Sub
    See Also