TWebView vs. TWebView2

TWebView vs. TWebView2

Postby Ruth » Wed Oct 09, 2024 2:21 pm

Dear friends,

I have a project where this is working fine
Code: Select all  Expand view  RUN
oWebView := TWebView():New(, hWnd)


Now I wanted to go further and use
Code: Select all  Expand view  RUN
oWebView = TWebView2():New( oWnd )


but then it doesnt compile properly any more.... please could anyone be so kind as to point me to the missing components etc.

Also maybe someone is kind enough to tell me if this is even a good idea ... am I missing a lot if i keep on using
Code: Select all  Expand view  RUN
oWebView := TWebView():New(, hWnd)


Kind regards to all and thank you very much in advance,
Ruth
User avatar
Ruth
 
Posts: 172
Joined: Fri Dec 07, 2007 1:26 pm

Re: TWebView vs. TWebView2

Postby leandro » Wed Oct 09, 2024 6:58 pm

Ruth buenas tardes, como estas?

Desde nuestro punto de vista deberías esperar un poco a que webview2 este mas estable , nosotros también lo usamos en nuestra aplicación, hemos intentado migrar, pero hasta ahora sin éxito. Antonio, nos esta apoyando para resolver ese tema lo mas pronto que se pueda.

Por otro lado según lo que entiendo, la principal diferencia es que no necesita las librerías webview.dll y WebView2Loader.dll para funcionar.

Algo que hemos notado es que el Metodo Bind ya no esta, y la función SendToFWH viene integrada por defecto.

Como te digo es mejor esperar un poco; pero si la webview2, promete mejorar en la forma en que nos comunicamos con el navegador, ya que permite inyectar código html y evaluarlo del lado de la app.

oWebView:InjectJavascript( cJavascript() )

Ruth, good afternoon, how are you?

From our point of view you should wait a bit for webview2 to be more stable, we also use it in our application, we have tried to migrate, but so far without success. Antonio, is supporting us to resolve this issue as soon as possible.

On the other hand, from what I understand, the main difference is that it does not need the webview.dll and WebView2Loader.dll libraries to work.

Something we have noticed is that the Bind Method is no longer there, and the SendToFWH function is integrated by default.

As I say, it is better to wait a little; But webview2 promises to improve the way we communicate with the browser, since it allows html code to be injected and evaluated on the app's side.

oWebView:InjectJavascript( cJavascript() )
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
leandro
 
Posts: 1688
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia

Re: TWebView vs. TWebView2

Postby Lailton » Thu Oct 10, 2024 12:34 am

Hi Ruth,

your code is correct:


Code: Select all  Expand view  RUN
oWebView = TWebView2():New( oWnd )



do you have any error with it?

Ruth wrote:Dear friends,

I have a project where this is working fine
Code: Select all  Expand view  RUN
oWebView := TWebView():New(, hWnd)


Now I wanted to go further and use
Code: Select all  Expand view  RUN
oWebView = TWebView2():New( oWnd )


but then it doesnt compile properly any more.... please could anyone be so kind as to point me to the missing components etc.

Also maybe someone is kind enough to tell me if this is even a good idea ... am I missing a lot if i keep on using
Code: Select all  Expand view  RUN
oWebView := TWebView():New(, hWnd)


Kind regards to all and thank you very much in advance,
Ruth
Regards,
Lailton Fernando Mariano
User avatar
Lailton
 
Posts: 156
Joined: Fri Jul 20, 2012 1:49 am
Location: Brazil

Re: TWebView vs. TWebView2

Postby Lailton » Thu Oct 10, 2024 12:38 am

Hola Leandro,

Que limitacion tiene en lo webview2?
tiene algun recurso que te falta? avisame que lo voy a revisar y implementar-lo.

Nota:
El
Code: Select all  Expand view  RUN
method bOnBind
ja esta implementado.



leandro wrote:Ruth buenas tardes, como estas?

Desde nuestro punto de vista deberías esperar un poco a que webview2 este mas estable , nosotros también lo usamos en nuestra aplicación, hemos intentado migrar, pero hasta ahora sin éxito. Antonio, nos esta apoyando para resolver ese tema lo mas pronto que se pueda.

Por otro lado según lo que entiendo, la principal diferencia es que no necesita las librerías webview.dll y WebView2Loader.dll para funcionar.

Algo que hemos notado es que el Metodo Bind ya no esta, y la función SendToFWH viene integrada por defecto.

Como te digo es mejor esperar un poco; pero si la webview2, promete mejorar en la forma en que nos comunicamos con el navegador, ya que permite inyectar código html y evaluarlo del lado de la app.

oWebView:InjectJavascript( cJavascript() )

Ruth, good afternoon, how are you?

From our point of view you should wait a bit for webview2 to be more stable, we also use it in our application, we have tried to migrate, but so far without success. Antonio, is supporting us to resolve this issue as soon as possible.

On the other hand, from what I understand, the main difference is that it does not need the webview.dll and WebView2Loader.dll libraries to work.

Something we have noticed is that the Bind Method is no longer there, and the SendToFWH function is integrated by default.

As I say, it is better to wait a little; But webview2 promises to improve the way we communicate with the browser, since it allows html code to be injected and evaluated on the app's side.

oWebView:InjectJavascript( cJavascript() )
Regards,
Lailton Fernando Mariano
User avatar
Lailton
 
Posts: 156
Joined: Fri Jul 20, 2012 1:49 am
Location: Brazil

Re: TWebView vs. TWebView2

Postby Antonio Linares » Thu Oct 10, 2024 7:02 am

FWH Class TWebView2 is the way to go as we don't need any externals DLLs and we have full control over its source code! :-)

Class TWebView2 has been developed with the help of Bruno Cantero who provided us a full understanding about it. Master Bruno!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TWebView vs. TWebView2

Postby Ruth » Thu Oct 10, 2024 8:01 am

Dear friends,

thank you very, very much for being so helpful.

Something we have noticed is that the Bind Method is no longer there, and the SendToFWH function is integrated by default.

oWebView:InjectJavascript( cJavascript() )


This really cleared things up for me. No need to define SendToFWH in the javascript code because it is injected automatically by the webview...
Code: Select all  Expand view  RUN
<button onclick='SendToFWH( 123 )'>Call FWH app from web browser</button>


And bOnBind event handler lets my Harbour program process the data received from the HTML.... I hope I understood this correctly...

Thank you :-)

Thank you also for making it clear, dear Antonio, that TWebView2 is the way to go.

I only find c:\fwh2023\source\classes\twebview.prg and I think this is why this doesnt compile...
Code: Select all  Expand view  RUN
oWebView = TWebView2():New( oWnd )


Please can you point me to the download of the missing class?

What else would interest me...are there more functions injected by default like "sendtofwh"?

Again many, many thanks and kind regards,
Ruth
User avatar
Ruth
 
Posts: 172
Joined: Fri Dec 07, 2007 1:26 pm

Re: TWebView vs. TWebView2

Postby Antonio Linares » Thu Oct 10, 2024 8:29 am

Dear Ruth,

You have to download FWH 24.09. Your father has the credentials to download it. I can resend them to you if needed.

Just SendToFWH() is implemented. More functions could be implemented but for now we only provide this one by default.

You are correct as bOnBind is evaluated for SendToFWH(), in the same way as bOnEval is evaluated for Method Eval( cJavascript )

There is also a bOnNavigationCompleted when a URL has been completely loaded.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TWebView vs. TWebView2

Postby Ruth » Thu Oct 10, 2024 9:26 am

Dear Antonio,

thank you very much. I will organize the download from my father. Again...thank you :-)

...and kind regards,
Ruth
User avatar
Ruth
 
Posts: 172
Joined: Fri Dec 07, 2007 1:26 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 67 guests