Recent

Author Topic: CEF component - the first step  (Read 1624 times)

Nicole

  • Hero Member
  • *****
  • Posts: 1205
CEF component - the first step
« on: June 16, 2025, 05:32:02 pm »
I read a lot and found hundreds of links. They shoot me, but do not help me.

in this tread
https://forum.lazarus.freepascal.org/index.php?topic=70684.0
it is spoken about "demo minibrowser", - whcih i cannot find.

At them moment I have installed CEF from the OPm, created a button doing:
Code: Pascal  [Select][+][-]
  1.  if not ChromiumWindow1.Initialized then
  2.    ChromiumWindow1.CreateBrowser;
  3.  
  4.  if Assigned(ChromiumWindow1.ChromiumBrowser) then
  5.    ChromiumWindow1.LoadURL('https://www.google.com');  

all four lines are jumped to, but I cannot see anything. Not even a window, where a browser could be.

I am sure, I miss the most important thing. Please can anybody tell me, what it is?
Those tutorials offer loads of options and frameworks and things.
I think, it can be done without it. In my old Delphi version, there just was a click and the browser was there. No other stuff needed. I am sure, there is a way Lazarus does this too.


n7800

  • Sr. Member
  • ****
  • Posts: 394
Re: CEF component - the first step
« Reply #1 on: June 16, 2025, 08:38:09 pm »
it is spoken about "demo minibrowser", - whcih i cannot find.

The demo projects are in the "CEF4Delphi" folder that you downloaded from OPM. You can also download them directly from the original repository CEF4Delphi, here is the direct link to "MiniBrowser".

The version in the repository may differ slightly from the version in OPM.

Nicole

  • Hero Member
  • *****
  • Posts: 1205
Re: CEF component - the first step
« Reply #2 on: June 17, 2025, 10:33:45 am »
Thank you so much. I found it all.
Even the explanation I understood partly.

The demos I started claimed dlls. These dll I found, but - they are that huge! All in all more than 1 GB.
Is there a small count of binaries, that I can copy? Or must I give my VM more space? (I want to avoid that).


loaded

  • Hero Member
  • *****
  • Posts: 866
Re: CEF component - the first step
« Reply #3 on: June 17, 2025, 10:49:28 am »
Cef needs at least these folders and files to run. (~306 MB)

Folders;
-locales
-swiftshader

Files;
-snapshot_blob.bin
-v8_context_snapshot.bin
-icudtl.dat
-vk_swiftshader_icd.json
-cef_sandbox.lib
-libcef.lib
-chrome_100_percent.pak
-chrome_200_percent.pak
-resources.pak
-chrome_elf.dll
-d3dcompiler_47.dll
-libcef.dll
-libEGL.dll
-libGLESv2.dll
-vk_swiftshader.dll
-vulkan-1.dll
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

Nicole

  • Hero Member
  • *****
  • Posts: 1205
Re: CEF component - the first step
« Reply #4 on: June 17, 2025, 03:48:38 pm »
300 MB would just be one third and great.

However, I am not sure, if you are talking about the same folders as those which I have downloaded.
I make a snapshot of what I have. I got these by scrolling down for the binaries and downloading those for windows and unzipping


loaded

  • Hero Member
  • *****
  • Posts: 866
Re: CEF component - the first step
« Reply #5 on: June 17, 2025, 08:02:30 pm »
First of all, the CEF4 version I used was 98.2, and the current version is 137.0.17. So a lot of water has passed under the bridge. The CEF4 you downloaded is a complete project file. I downloaded it and took a look at it. You need to distribute the attached folders with your application exe at runtime. You may need to do some trial and error, or if you contact the developer of this project, salvadordf (who is a member of this forum), he will help you.
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

n7800

  • Sr. Member
  • ****
  • Posts: 394
Re: CEF component - the first step
« Reply #6 on: June 18, 2025, 12:37:13 am »
300 MB would just be one third and great.

However, I am not sure, if you are talking about the same folders as those which I have downloaded.
I make a snapshot of what I have. I got these by scrolling down for the binaries and downloading those for windows and unzipping

As you can see, you have "Release" and "Debug" subfolders that contain the corresponding copies of the DLL. To distribute your application, you only need "Release", and for debugging - "Debug" (theoretically, you can also develop with Release).

In fact, I had to write a function in my application so that depending on the build mode, the files from the right subfolder are used. It's a bit complicated ("$IFDEF", setting up build modes), but it makes debugging easier later.

Note that the DLL version (release/debug) and the build mode of your project (which can also have "release"/"debug") are different things.

Nicole

  • Hero Member
  • *****
  • Posts: 1205
Re: CEF component - the first step
« Reply #7 on: June 18, 2025, 08:55:54 am »
oups! I only understood half of what you said.

My situation: I only develop for myself. What I want: small files. As I err all day long I need many backups.
What do you advice me, how to work?

I never cared about those 2 kinds.

About the dlls: Those Demos give error-messages: .... missing. My plan was, that I will us this error messages to copy the needed dlls one by one.

And another question: My CEF is in the wrong directory. Is there a smart way to change the directory? And: Was it the best way to install from the OPM? Or shall I copy the files from the git? (I am at Windows 7 at the moment)

Thaddy

  • Hero Member
  • *****
  • Posts: 17362
  • Ceterum censeo Trump esse delendam
Re: CEF component - the first step
« Reply #8 on: June 18, 2025, 11:42:18 am »
Well, your files can be made small, but the dependencies will make the whole big.
And in the case of CEF there is no way around that.
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

salvadordf

  • Jr. Member
  • **
  • Posts: 59
    • BriskBard
Re: CEF component - the first step
« Reply #9 on: June 18, 2025, 12:40:53 pm »
Read this Wiki page :
https://github.com/salvadordf/CEF4Delphi/wiki/Before-you-run-the-demos

It has all the information needed to run the demos and instructions to copy the CEF binaries correctly.

Windows 7 is not supported by Chromium anymore. Read this :
https://github.com/salvadordf/CEF4Delphi/wiki/Frequently-asked-questions
Maintainer of the CEF4Delphi, WebView4Delphi, WebUI4Delphi and WebUI4CSharp projects

Nicole

  • Hero Member
  • *****
  • Posts: 1205
Re: CEF component - the first step
« Reply #10 on: June 18, 2025, 05:18:10 pm »
I am puzzled. I clicked link and link and link, - CEF DOES work with Win 7 still or doesn't it?

If the version is from 2022, I can live with it.

salvadordf

  • Jr. Member
  • **
  • Posts: 59
    • BriskBard
Re: CEF component - the first step
« Reply #11 on: June 18, 2025, 05:55:04 pm »
Please, read the last link.

Google decided to drop Windows 7 support in 2022. The last CEF version that worked in Windows 7 was CEF 109.

CEF 110 and newer require Windows 10 or 11.
Maintainer of the CEF4Delphi, WebView4Delphi, WebUI4Delphi and WebUI4CSharp projects

wp

  • Hero Member
  • *****
  • Posts: 12902
Re: CEF component - the first step
« Reply #12 on: June 18, 2025, 05:58:08 pm »
Thank you so much. I found it all.
Even the explanation I understood partly.

The demos I started claimed dlls. These dll I found, but - they are that huge! All in all more than 1 GB.
Is there a small count of binaries, that I can copy? Or must I give my VM more space? (I want to avoid that).
It it really necessary to have this dinosaur in your project? Of course it depends on your requirements, but if you just want to display some HTML pages and do not want to execute JavaScript, maybe the "HTMLViewer" (in OPM) in sufficient. (I am not mentioning the IpHTMLPanel which comes with Lazarus and is probably too buggy).

Nicole

  • Hero Member
  • *****
  • Posts: 1205
Re: CEF component - the first step
« Reply #13 on: June 18, 2025, 06:15:16 pm »
What I want to display is yahoo.com, the financial sites.
Not sure, if the small components do so.

However I am stuck:
It tried the "mini browser" demo and it gave me error messages, which dlls are missing. Well, there is a download link for them. Unfortunately, half of them are still missing.  :'(

All those browsers are that resource consuming! And whenever I tried a slime one (e.g. Pale Moon), - it did not really work in the sense, that sites were just part displayed.

Those slim components, do you know, if they display yahoo-charts?

wp

  • Hero Member
  • *****
  • Posts: 12902
Re: CEF component - the first step
« Reply #14 on: June 18, 2025, 08:21:11 pm »
What I want to display is yahoo.com, the financial sites.
Not sure, if the small components do so.
No chance with THTMLViewer here...

 

TinyPortal © 2005-2018