edgebrowser package lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- alaa123456789 · 2020-10-21 19:11 Hi all, Delphi,implemented edge browser as new component  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 ---------------------------------------------------------------------- winni · 2020-10-21 21:29 Quote from: alaa123456789 on October 21, 2020, 09:11:42 pmHi 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 ---------------------------------------------------------------------- alaa123456789 · 2020-10-23 06:45 Quote from: jamie on October 21, 2020, 11:36:00 pmclick 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 ---------------------------------------------------------------------- alaa123456789 · 2020-10-30 06:27 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 ---------------------------------------------------------------------- Thaddy · 2020-10-30 08:01 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. ---------------------------------------------------------------------- Soner · 2020-11-05 14:22 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. ---------------------------------------------------------------------- alaa123456789 · 2020-11-05 16:37 Quote from: Soner on November 05, 2020, 03:22:44 pmWebview2(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 ---------------------------------------------------------------------- MISV · 2021-03-30 07:43 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) ---------------------------------------------------------------------- alaa123456789 · 2021-03-30 16:41 Quote from: MISV on March 30, 2021, 09:43:52 amI 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 ---------------------------------------------------------------------- lainz · 2021-03-30 17:26 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... ---------------------------------------------------------------------- MISV · 2021-04-08 19:37 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 ---------------------------------------------------------------------- lainz · 2021-04-08 20:07 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. ---------------------------------------------------------------------- PierceNg · 2021-04-09 00:38 Quote from: lainz on April 08, 2021, 10:07:38 pmThis 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. ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-04-09 07:44 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 ---------------------------------------------------------------------- MISV · 2021-05-21 08:59 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 ---------------------------------------------------------------------- Vingadero · 2021-05-26 17:03 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, ---------------------------------------------------------------------- alaa123456789 · 2021-05-26 18:25 Quote from: Vingadero on May 26, 2021, 07:03:17 pmHi 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 ---------------------------------------------------------------------- FLLSilva · 2024-01-24 20:33 Quote from: winni on October 21, 2020, 11:29:49 pmQuote from: alaa123456789 on October 21, 2020, 09:11:42 pmHi 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. ---------------------------------------------------------------------- Fibonacci · 2024-01-24 21:18 Quote from: FLLSilva on January 24, 2024, 09:33:55 pmQuote from: winni on October 21, 2020, 11:29:49 pmQuote from: alaa123456789 on October 21, 2020, 09:11:42 pmit 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 ---------------------------------------------------------------------- KodeZwerg · 2024-01-25 02:26 Besides that ... {$IfDef MSWindows} WebView2 check, use this or fall back ... etc Like many basic units are using. ---------------------------------------------------------------------- Thaddy · 2024-01-25 11:57 Quote from: FLLSilva on January 24, 2024, 09:33:55 pmTEdgeBrowser 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. ---------------------------------------------------------------------- salvadordf · 2024-01-25 20:05 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 ---------------------------------------------------------------------- KodeZwerg · 2024-01-25 21:23 @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? ---------------------------------------------------------------------- PierceNg · 2024-01-26 01:24 Take a look at fpwebview, an FPC FFI to 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. ---------------------------------------------------------------------- salvadordf · 2024-01-26 08:15 Quote from: 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? Add this code line before the GlobalWebView2Loader.StartWebView2 call : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i GlobalWebView2Loader.BlinkSettings  := 'forceDarkModeEnabled'; ---------------------------------------------------------------------- KodeZwerg · 2024-01-26 14:22 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