Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Linux Console Application
-
- Posts: 9
- Joined: Tue Mar 12, 2024 1:21 pm
Linux Console Application
Is it possible to use CEF4Delphi in a Linux Console Application? Without using any forms?
- salvadordf
- Posts: 4304
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Linux Console Application
Hi,
I've never tried that but I guess it should be possible.
You can port the Lazarus_Windows/ConsoleBrowser2 demo to Linux.
You will probably have to replace some of its code with the code from the Lazarus_Linux_GTK3/OSRExternalPumpBrowser demo.
I've never tried that but I guess it should be possible.
You can port the Lazarus_Windows/ConsoleBrowser2 demo to Linux.
You will probably have to replace some of its code with the code from the Lazarus_Linux_GTK3/OSRExternalPumpBrowser demo.
-
- Posts: 9
- Joined: Tue Mar 12, 2024 1:21 pm
Re: Linux Console Application
Thank you. I can't believe how couldn't I see ConsoleBrowser2 demo.
I am trying to port it now. If I am successful, I will share here.
I am trying to port it now. If I am successful, I will share here.
- salvadordf
- Posts: 4304
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Linux Console Application
I'm also creating a new console demo that should work on Linux.
Your message made me realize that it was missing.
Your message made me realize that it was missing.
- salvadordf
- Posts: 4304
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Linux Console Application
I just uploaded the Lazarus_Linux_Console/ConsoleBrowser demo to GitHub.
It just takes a snapshot of the default URL and saves it as snapshot.png.
It uses a browser in OSR mode with a second executable for the CEF subprocesses.
It just takes a snapshot of the default URL and saves it as snapshot.png.
It uses a browser in OSR mode with a second executable for the CEF subprocesses.
-
- Posts: 9
- Joined: Tue Mar 12, 2024 1:21 pm
Re: Linux Console Application
Thank you. You are great.
-
- Posts: 6
- Joined: Tue Mar 26, 2024 4:30 am
Re: Linux Console Application
I also tried and it didn't workalfredapple wrote: ↑Tue Mar 12, 2024 1:23 pm Is it possible to use CEF4Delphi in a Linux Console Application? Without using any forms?
-
- Posts: 9
- Joined: Tue Mar 12, 2024 1:21 pm
Re: Linux Console Application
I am trying to use CefRegisterExtension function on the demo, but OnWebKitInitialized is not running. Can you help about this?salvadordf wrote: ↑Thu Mar 14, 2024 7:08 pm I just uploaded the Lazarus_Linux_Console/ConsoleBrowser demo to GitHub.
It just takes a snapshot of the default URL and saves it as snapshot.png.
It uses a browser in OSR mode with a second executable for the CEF subprocesses.
- salvadordf
- Posts: 4304
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Linux Console Application
That event is called on the render subprocess and Lazarus debugs the main browser process.
Read this document if you need to debug the code in that event :
https://www.briskbard.com/index.php?lang=en&pageid=cef#debugging
Edit :
The demos that use a different executable for the CEF subprocesses have to implement the events that run in CEF subprocesses in the subprocess project. For example, the Lazarus_Windows/JavaScript/JSWindowBindingSubProcess demo implements OnContextCreated in SubProcess.lpr
Read this document if you need to debug the code in that event :
https://www.briskbard.com/index.php?lang=en&pageid=cef#debugging
Edit :
The demos that use a different executable for the CEF subprocesses have to implement the events that run in CEF subprocesses in the subprocess project. For example, the Lazarus_Windows/JavaScript/JSWindowBindingSubProcess demo implements OnContextCreated in SubProcess.lpr
-
- Posts: 9
- Joined: Tue Mar 12, 2024 1:21 pm
Re: Linux Console Application
Hmm..
It seems like it's executing while I set GlobalCEFApp.SingleProcess := True;
but it's not executing when it's false.
Why is that?
It seems like it's executing while I set GlobalCEFApp.SingleProcess := True;
but it's not executing when it's false.
Why is that?