Lazarus

Programming => Networking and Web Programming => Topic started by: alaa123456789 on October 21, 2020, 09:11:42 pm

Title: edgebrowser package
Post by: alaa123456789 on October 21, 2020, 09:11:42 pm
Hi all,

Delphi,implemented edge browser as new component 

https://blogs.embarcadero.com/new-vcl-tedgebrowser-component-rad-studio-10-4/ (https://blogs.embarcadero.com/new-vcl-tedgebrowser-component-rad-studio-10-4/)

is there anyone can make it available for lazarus users? it will be great add-on to Lazarus IDE.

thanks
Title: Re: edgebrowser package
Post by: winni on October 21, 2020, 11:29:49 pm
Hi all,

it will be great add-on to Lazarus IDE.


Hi!

No - it wont be a great add-on.

As Embarcado writes the component relies on two M$-packages.
So it is Windows only.

This is against  the Lazarus idea "write once compile anywhere".

And I don't need another Chromium-/Chrome-copy on my system.

Winni
Title: Re: edgebrowser package
Post by: alaa123456789 on October 23, 2020, 08:45:18 am
click on that option and you might see WEB CONTROLS or something like that, select it and have it build a activexcontainer and component, it should install on the axtivex tab
thanks for your kind reply, i have tried this way ,please see what i got , it didnt find edge ,also it didnt come in activex tab

thanks
Title: Re: edgebrowser package
Post by: alaa123456789 on October 30, 2020, 07:27:32 am
hey guys,

i think lazarus have shortage in this , there is no component for web files , i really need it
please someone help with good component.

thanks
Title: Re: edgebrowser package
Post by: Thaddy on October 30, 2020, 09:01:51 am
Edge = chromium and we have chromium support.
Older versions of edge, based on MS own engine are deprecated by Microsoft.
If your Windows 10 is up-to-date, you can simply use the CEF package.
Title: Re: edgebrowser package
Post by: Soner on November 05, 2020, 03:22:44 pm
Webview2(Edge Browser as library) in Lazarus would be fine. You could use updated browser without delivering big files.
I imported type library for webview2 and i tried to do same as with ie-activexbrowser with no luck. I will look it later.
But if someone wants to try here example project with imported type library and download links.
Title: Re: edgebrowser package
Post by: alaa123456789 on November 05, 2020, 05:37:00 pm
Webview2(Edge Browser as library) in Lazarus would be fine. You could use updated browser without delivering big files.
I imported type library for webview2 and i tried to do same as with ie-activexbrowser with no luck. I will look it later.
But if someone wants to try here example project with imported type library and download links.
yeah this why i suggest it , but we need experts in this forum to help with that so everyone can benefit from it .

thanks 
Title: Re: edgebrowser package
Post by: MISV on March 30, 2021, 09:43:52 am
I hope someone will implement support for webview2 - big advantage not having to ship big packages with exe (and using built-in Windows  browser also ensure your app always uses fully patched browser)
Title: Re: edgebrowser package
Post by: alaa123456789 on March 30, 2021, 06:41:45 pm
I hope someone will implement support for webview2 - big advantage not having to ship big packages with exe (and using built-in Windows  browser also ensure your app always uses fully patched browser)
i hope so ,we urge experts to help with this

thanks in advance
Title: Re: edgebrowser package
Post by: lainz on March 30, 2021, 07:26:57 pm
I agree this can be very handy. If I remember correctly there is a native browser for macos done by Phill. Now is missing Windows.

If not supported on Linux something is wrong (with Linux) but maybe in the end it will add some package that does the same... Maybe with Firefox...
Title: Re: edgebrowser package
Post by: MISV on April 08, 2021, 09:37:52 pm
Besides embarcadero for their newest Delphi I found these commercial solutions and/or mentions of solutions

- https://winsoft.sk/webview.htm
- https://www.tmssoftware.com/site/blog.asp?post=702
- https://github.com/MicrosoftEdge/WebView2Feedback/issues/155
- https://www.briskbard.com/forum/viewtopic.php?t=1147

Title: Re: edgebrowser package
Post by: lainz on April 08, 2021, 10:07:38 pm
This is already working in Rust language:

https://github.com/Boscop/web-view

Windows   MSHTML or EdgeHTML
Linux   Gtk-webkit2
OSX   Cocoa/WebKit

I don't know how to do it for FPC but they have this cross platform browser solution for native applications. On Windows the final executable plus required libraries is less than 30 mb.
Title: Re: edgebrowser package
Post by: PierceNg on April 09, 2021, 02:38:05 am
This is already working in Rust language:

https://github.com/Boscop/web-view

Windows   MSHTML or EdgeHTML
Linux   Gtk-webkit2
OSX   Cocoa/WebKit


Interesting... Implementing the FPC FFI to the underlying C library should not be difficult.

I played with CEF FPC/Delphi a while back. Results weren't encouraging.
Title: Re: edgebrowser package
Post by: Gustavo 'Gus' Carreno on April 09, 2021, 09:44:18 am
Hey all,

This is something that has intrigued me for quite a while and I've never had the courage to ask:

If the default widgetset is GTK, and GTK has had webkit for ages, why have we no bindings for it?

Am I missing something? If so please direct me somewhere I can be schooled about it :)

Cheers,
Gus
Title: Re: edgebrowser package
Post by: MISV on May 21, 2021, 10:59:14 am
I have taken a look at these URLs:

check if runtime installed
https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution

some sample code assuming newer Delphi
https://stackoverflow.com/questions/52766249/using-webview-edgehtml-in-delphi-c-builder

some sample code assuming newer Delphi
https://stackoverflow.com/questions/66676662/webview2-tedgebrowser-updated-delphi-interface-e-g-icorewebview2controller2

Yet even those seem to assume a newer Delphi version... So not fully compatible with e.g. Lazarus... But it is a start. I love being able to use "newest available patched system browser" (evergreen) which is why I am not jumping on https://github.com/salvadordf/CEF4Delphi albeit it may end up being the final solution.

Is there anyone else who has begun the undertaking of implementing webview2? It seems like too big a task for a single person. For me at least I would need a lot of time to refresh myself with everything COM and really... Ton of stuff if I need to implement something as big as webview from scratch
Title: Re: edgebrowser package
Post by: Vingadero on May 26, 2021, 07:03:17 pm
Hi guys,

That would be amazing to have a port for Lazarus...
Meanwhile I found a port to Delphi Community Edition at https://torry.net/authorsmore.php?id=7915

Maybe this can be used for a Lazarus port too...

Best regards,
Title: Re: edgebrowser package
Post by: alaa123456789 on May 26, 2021, 08:25:30 pm
Hi guys,

That would be amazing to have a port for Lazarus...
Meanwhile I found a port to Delphi Community Edition at https://torry.net/authorsmore.php?id=7915

Maybe this can be used for a Lazarus port too...

Best regards,
need someone who can help with it
Regards
Title: Re: edgebrowser package
Post by: FLLSilva on January 24, 2024, 09:33:55 pm
Hi all,

it will be great add-on to Lazarus IDE.


Hi!

No - it wont be a great add-on.

As Embarcado writes the component relies on two M$-packages.
So it is Windows only.

This is against  the Lazarus idea "write once compile anywhere".


TEdgeBrowser can be linked to Microsoft technology, but in Lazaruz not everything that is created is meant to be compiled everywhere, each project has its particularities and exclusivity.

In Lazaruz the counterpart to EdgeBrowser would be CEF, but it also links everything to a series of external dependencies. While Edge links to a single DLL, CEF links to more than 20 files that need to be distributed together.

I believe that a component using technology A or B is not a demerit for anyone, and if something is only good if it is compatible with all types of systems, it ends up limiting the language because it cannot exploit 100% of the resources of any platform. .

Code portability between different platforms should be a goal, but never a rule.

But it's just my opinion.  ;)
Title: Re: edgebrowser package
Post by: Fibonacci on January 24, 2024, 10:18:46 pm
it will be great add-on to Lazarus IDE.
This is against  the Lazarus idea "write once compile anywhere".
Code portability between different platforms should be a goal, but never a rule.

Write once, COMPILE ANYWHERE, not RUN ANYWHERE 8)
Title: Re: edgebrowser package
Post by: KodeZwerg on January 25, 2024, 03:26:26 am
Besides that ... {$IfDef MSWindows} WebView2 check, use this or fall back ... etc
Like many basic units are using.
Title: Re: edgebrowser package
Post by: Thaddy on January 25, 2024, 12:57:45 pm
TEdgeBrowser can be linked to Microsoft technology,
Edge uses Google technology under windows 10/11 since 2020, so 4 years and a few days. Just make CEF work with Edge.
The latest Edge versions are based on Chromium..... So CEF should at least partially work.
See: https://support.microsoft.com/en-us/microsoft-edge/download-the-new-microsoft-edge-based-on-chromium-0f4a3dd7-55df-60f5-739f-00010dba52cf

And that is not opinion, but fact..

(fun fact: I updated one of my laptops - a sturdy hand that keeps chewing boring data -  this week to Windows 11... and it completely removed any traces of internet explorer automagically. Guess what? All my internet explorer code is screwed... Note this was done under a ms developers license, so may not apply to regular distributions)

[edit]
Microsoft did not change the core CEF interfaces.
Microsoft even states that you can use CEF with Edge. Of course Edge has additional features that are not exposed in CEF.
[edit some more]
I just tested CEF to Edge and that works, although I did not use a component for that.
Title: Re: edgebrowser package
Post by: salvadordf on January 25, 2024, 09:05:51 pm
If anyone needs to use WebView2 in Lazarus try WebView4Delphi :
https://github.com/salvadordf/WebView4Delphi

WebView2 only supports Windows at this moment but there are plans to add Linux and macOS support :
https://github.com/MicrosoftEdge/WebView2Feedback/issues/645
https://github.com/MicrosoftEdge/WebView2Feedback/issues/1314

If you need to embed a Chromium browser in Windows, Linux and macOS now then you can use CEF4Delphi :
https://github.com/salvadordf/CEF4Delphi
Title: Re: edgebrowser package
Post by: KodeZwerg on January 25, 2024, 10:23:25 pm
@salvadordf amazing, webview4delphi works straight out of the box, integrates wonderful into the palette and demos show beautiful how to use it
many many kudos <3

a question/request i do have, is it possible that i could switch to a dark mode style/theme?
Title: Re: edgebrowser package
Post by: PierceNg on January 26, 2024, 02:24:48 am
Take a look at fpwebview (https://github.com/PierceNg/fpwebview), an FPC FFI to webview (https://github.com/webview/webview), which is a wrapper for Cocoa/WebKit on macOS, gtk-webkit2 on Linux, and Edge on Windows.

Haven't implemented Lazarus component/control, meaning no point/click/drag/drop on a form from within Lazarus IDE, but the library is usable with Lazarus widget set. The demo lclembed embeds a webview in a Lazarus application.

The library works on Linux, macOS and Windows.
Title: Re: edgebrowser package
Post by: salvadordf on January 26, 2024, 09:15:52 am
@salvadordf amazing, webview4delphi works straight out of the box, integrates wonderful into the palette and demos show beautiful how to use it
many many kudos <3
a question/request i do have, is it possible that i could switch to a dark mode style/theme?

Add this code line before the GlobalWebView2Loader.StartWebView2 call :
Code: Pascal  [Select][+][-]
  1. GlobalWebView2Loader.BlinkSettings  := 'forceDarkModeEnabled';
Title: Re: edgebrowser package
Post by: KodeZwerg on January 26, 2024, 03:22:14 pm
That trick works perfect easy, again many many thanks for your hard work and sharing it!!!  :-* :-* :-*
To show, compared against my first image, now its dark  :D
TinyPortal © 2005-2018