Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VB6: RunAnonymousFunctionSync to retrieve the height of page
#2
Hi Przemek,

The following works for me:
Code:
  Set myDocumentHTML = New AntViewDocument
  myDocumentHTML.BrowserDispatch EdgeWebBrowser.IDispatchPointer

  Dim strRes As String
  Dim intRes As Integer

  intRes = myDocumentHTML.RunAnonymousFunctionSync(1, "", "() => {return window.innerHeight;}", strRes)

  Debug.Print "Result: " & intRes '22 functon timeout
  Debug.Print "Data result: " & strRes 'String is empty

IOW, you did not write a function.
Sadly it does not completely behave like the javascript console.

The returned error 22 is confusing. I will raise a ticket for that and see if it can be improved somehow.
--
Wil
Reply


Messages In This Thread
RE: VB6: RunAnonymousFunctionSync to retrieve the height of page - by wila - 2023-10-01, 16:16:24

Forum Jump:


Users browsing this thread: 1 Guest(s)