FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Help about TWebView class. reading something from website.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Help about TWebView class. reading something from website.
Posted: Tue Jul 05, 2022 07:52 AM
Already asked to Steffen,

https://github.com/webview/webview/issues/796

Lets see what he says...
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Help about TWebView class. reading something from website.
Posted: Tue Jul 05, 2022 08:43 AM
The WebView2 COM API exposes ICoreWebView2::ExecuteScript and is accessible via webview::eval (C++) and webview_eval (C).


So it is our Class TWebView Method Eval() :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: Help about TWebView class. reading something from website.
Posted: Tue Jul 05, 2022 01:26 PM
Antonio Linares wrote:Morning Hakan,

This is the code:
Code (fw): Select all Collapse
#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

   local oWebView := TWebView():New(), aaa

   oWebView:bOnBind = { | cJson, nCalls | MsgInfo( cJson, nCalls ) }
   oWebView:Bind( "SendToFWH" )
   oWebView:Navigate( "https://datatables.net/examples/data_sources/js_array" )
   Sleep( 200 )
   oWebView:Eval( 'window.onload = function () { SendToFWH( document.getElementById("example").innerHTML ) }' )
   oWebView:Run()
   oWebView:Destroy()

return nil


Going to check your await command...


In order to Eval like "Window.onload", should written before oWebview.Run() command.

Here's my procedure.

1. User should login a website from main menü. (so .Run() command is must be here)
2. User press Go button in records to go in opened website.
3. User close the app. (so. .Destroy() command)

Is this procedure wrong for TWebView? any comment?

Secondly, How Can I transfer cJson variable to my app? I use public variable, but it does not worked.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Help about TWebView class. reading something from website.
Posted: Tue Jul 05, 2022 02:21 PM

Hakan,

> Is this procedure wrong for TWebView? any comment?

The example I posted is working fine

> Secondly, How Can I transfer cJson variable to my app? I use public variable, but it does not worked.

Please post an example of how you are doing it

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion