Hi,
I want to do a service program, its function is to execute the JavaScript script and return the result. Because the service program does not have an UI interface, how can I directly call the kernel's JavaScript engine without loading the browser interface? If this can be done, can one or more external JavaScript files be executed by CEF4Delphi? Thank you.
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.
How to execute JavaScript without interface UI
-
- Posts: 18
- Joined: Sun Jan 07, 2018 1:08 am
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How to execute JavaScript without interface UI
Hi,
I've never created a Windows service with Delphi but you might have a problem with the initialization and shutdown of the CEF libraries.
All CEF3 based applications can only be initialized and shutdown once per process.
In the case of CEF4Delphi, the initialization is done inside the GlobalCEFApp.StartMainProcess function and it is shutdown when you free GlobalCEFApp.
If you find a way to call GlobalCEFApp.StartMainProcess and GlobalCEFApp.Free only once, then the rest is easy. You would only have to use a TChromium in OSR mode for your JavaScript functions.
I've never created a Windows service with Delphi but you might have a problem with the initialization and shutdown of the CEF libraries.
All CEF3 based applications can only be initialized and shutdown once per process.
In the case of CEF4Delphi, the initialization is done inside the GlobalCEFApp.StartMainProcess function and it is shutdown when you free GlobalCEFApp.
If you find a way to call GlobalCEFApp.StartMainProcess and GlobalCEFApp.Free only once, then the rest is easy. You would only have to use a TChromium in OSR mode for your JavaScript functions.