Execute a DevTools Command.
The method name to execute.
A JSON string of method parameters.
A Boolean indicating if the execution of the command is blocking or not.
Execute a DevTools Command.
The method name to execute.
A JSON string of method parameters.
A Boolean indicating if the execution of the command is blocking or not.
A JSON string containing the result of the DevTools method invoked.
The Chrome DevTools Protocol allows for tools to instrument, inspect, debug and profile Chromium, Chrome and other Blink-based browsers.
Instrumentation is divided into a number of domains (DOM, Debugger, Network etc.).
Each domain defines a number of commands it supports and events it generates.
Both commands and events are serialized JSON objects of a fixed structure.
More info can be found here:
Private Sub GetNodeStyles() Dim NodeID As String Dim JSON As String NodeID = WebKitX.GetNodeID("#mydiv") JSON = WebKitX.ExecDevToolsCommand("CSS.getMatchedStylesForNode", """nodeId"": " + NodeID, True) End Sub Private Sub WebKitX_OnDevToolsWebSocket(ByVal Data As String) On Error Resume Next If InStr(Data, "CSS.styleSheetAdded") > 0 Then Dim xDOM As Object Set xDOM = XML_DOM(JSONtoXML(Data)) StyleSheets.Add xDOM.selectSingleNode("//styleSheetId").Text, xDOM.selectSingleNode("//sourceURL").Text End If Err.Clear End Sub Public Function XML_DOM(Optional sAnyXML) As IXMLDOMDocument Dim xDOM As DOMDocument30 Set xDOM = New DOMDocument30 xDOM.Async = False xDOM.resolveExternals = False xDOM.validateOnParse = False If Not IsMissing(sAnyXML) Then If IsObject(sAnyXML) Then xDOM.Load sAnyXML ElseIf sAnyXML <> vbNullString Then If InStrB(sAnyXML, "<") Then xDOM.loadXML sAnyXML Else xDOM.Load sAnyXML End If End If End If xDOM.SetProperty "SelectionLanguage", "XPath" xDOM.SetProperty "SelectionNamespaces", vbNullString Set XML_DOM = xDOM End Function