You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dim nodes AsDictionary: Set nodes = New Dictionary
790
790
Dim node AscdpDOMNode
@@ -796,27 +796,54 @@ Public Function getDomNodes(Optional ByVal nodeIds As Collection, Optional ByVal
796
796
key = getNodeIdOrName(node)
797
797
If key = vbNullString Or nodes.Exists(key) Then key = nodes.count
798
798
Set nodes(key) = node
799
+
Set node = Nothing
799
800
Next v
800
801
ElseIfNot backendNodeIds IsNothingThen
801
802
For Each v In backendNodeIds
802
803
Set node = getDomNode(backendNodeId:=v, depth:=depth, pierce:=pierce)
803
804
key = getNodeIdOrName(node)
804
805
If key = vbNullString Or nodes.Exists(key) Then key = nodes.count
805
806
Set nodes(key) = node
807
+
Set node = Nothing
806
808
Next v
807
-
Else' assume nodeIds is valid
809
+
ElseIfNotnodeIds IsNothingThen
808
810
For Each v In nodeIds
809
811
Set node = getDomNode(nodeId:=v, depth:=depth, pierce:=pierce)
810
812
key = getNodeIdOrName(node)
811
813
If key = vbNullString Or nodes.Exists(key) Then key = nodes.count
812
814
Set nodes(key) = node
815
+
Set node = Nothing
813
816
Next v
817
+
ElseIf remoteNodeList IsNothingThen
818
+
' using GetProperties we can actually retrieve the values in the NodeList
819
+
Dim nodeList AsDictionary, result AsCollection
820
+
Set nodeList = cdp.Runtime.GetProperties(remoteNodeList.objectId, ownProperties:=True) ' we just want the nodes so skip all properties that are inherited
821
+
Set result = nodeList("result")
822
+
For Each v In result
823
+
Dim propDesc AscdpRuntimePropertyDescriptor
824
+
Set propDesc = New cdpRuntimePropertyDescriptor
825
+
propDesc.init v
826
+
IfNot propDesc.Value IsNothingThen
827
+
If propDesc.Value.subtype = "node"Then
828
+
Set node = getDomNode(objectId:=propDesc.Value.objectId, depth:=depth, pierce:=pierce)
829
+
key = getNodeIdOrName(node)
830
+
If key = vbNullString Or nodes.Exists(key) Then key = nodes.count
831
+
Set nodes(key) = node
832
+
Set node = Nothing
833
+
End If
834
+
End If
835
+
Set propDesc = Nothing
836
+
Next v
837
+
Set result = Nothing
838
+
Set nodeList = Nothing
839
+
Else
840
+
Debug.Print"getDomNodes - No source of DOM nodes provided!"
0 commit comments