Already asked to Steffen,
https://github.com/webview/webview/issues/796
Lets see what he says...
Help about TWebView class. reading something from website.
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
Re: Help about TWebView class. reading something from website.
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()

Re: Help about TWebView class. reading something from website.
Antonio Linares wrote:Morning Hakan,
This is the code:Code: Select all | Expand
#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.04
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.04
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
Re: Help about TWebView class. reading something from website.
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
> 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