Forum > Networking and Web Programming

[SOLVED] Looking for a cross-platform webbrowser component for Lazarus

(1/3) > >>

maurobio:
Dear ALL,

Out of sheer curiosity, I would like to give a try to some of the existing webbrowser components for Lazarus.

I do understand that this can be a spiny question, as shown in this thread: https://forum.lazarus.freepascal.org/index.php/topic,26572.0.html

However, I feel like trying it myself!

I want a component which is cross-platform (at least supporting Linux and Windows). I would also prefer a component that is not based on Qt. So, I have been left with two choices: GeckoPort and fpCEF3. There are nice tutorials for for the former (https://lazplanet.blogspot.com/2013/10/browser-in-lazarus-with-gecko-pt1.html?m=1) and for the latter (https://lazplanet.blogspot.com/2015/09/create-web-browser-in-3-minutes-using.html?m=1).

First, I tried the GeckoPort component (which seems to be the nearest to my requirements). Following the tutorial from here (https://lazplanet.blogspot.com/2013/10/browser-in-lazarus-with-gecko-pt1.html?m=1), I downloaded version 1 of the component, as well as the required XULRunner runtime library. I had no problem in compiling and installing the package in the IDE, however when attempting to run the GBrowser demo, what I got was a sequence of blank screens (see the attached screenshot), instead of the Free Pascal home page as shown in the tutorial.

Second, I tried the fpCEF3 component, following the instructions from here: https://lazplanet.blogspot.com/2015/09/create-web-browser-in-3-minutes-using.html?m=1 (the "3-minutes solution"). In that case, the results were worse, because I could not even have the package compiled and installed in the IDE: it returned just a lot of compilation errors!

Could any of you wizards give me some hints on that matter?

Thanks in advance!

With warmest regards,

Zvoni:
?
https://github.com/salvadordf/CEF4Delphi

--- Quote ---CEF4Delphi was developed and tested on Delphi 11.3 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3, Delphi 10.4 and Lazarus 2.2.6/FPC 3.2.2. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.

CEF4Delphi demos have been tested in Windows 10, Windows 11, Linux Mint 20.3 and Raspberry Pi OS.
--- End quote ---

maurobio:
Hi, @Zvoni!


--- Quote ---https://github.com/salvadordf/CEF4Delphi
--- End quote ---

Ah, it seems to be an upgraded version of fpCEF3! I will give it a try.

Thank you very much!

With best regards,

maurobio:
Dear ALL,

In facrt, the CEF4Delphi component pointed out by Zvoni seems to be adequate to my needs, but I still have a (perhaps very lame) doubt: is there any way of loading a local file and/or a string list with HTML markup, as provided by the TWebBrowser component which comes with Lazarus?

Thanks in advance!

With best regards,

TRon:

--- Quote from: maurobio on July 13, 2023, 04:37:49 pm ---is there any way of loading a local file and/or a string list with HTML markup, as provided by the TWebBrowser component which comes with Lazarus?

--- End quote ---
I am not familiar with the component and the information I got is based on sysrpl's repository (probably outdated)

Any webbrowser should be able to load (html) files using the file protocol so give that a spin.

Also in sysrpl's version is a method named LoadHtml, exactly for that purpose. I take it you are able to load a html file into a string...

Navigation

[0] Message Index

[#] Next page

Go to full version