Closed bamsey2k1 closed 4 months ago
Are you using Delphi or Lazarus?
MacOS has several projects and the JS extension runs in the render process. Move the code in GlobalCEFApp.OnWebKitInitialized to the render project.
I would recommend creating a Windows demo with a different executable for the CEF subprocesses. Move the GlobalCEFApp.OnWebKitInitialized code to the subprocess project and check if it works in Windows.
I'm using Lazarus which is installed on Mac. I've modified ExternalPumpBrowser demo to show You how I made it. ExternalPumpBrowser.zip
In this example You will find both inconveniences I've mentioned above.
I just uploaded a new demo called JSExtensionSubProcess.
It has a JSExtension_sp project that creates the executable for the CEF subprocesses and I moved all the code from GlobalCEFApp.OnWebKitInitialized to that project.
In the case of MacOS, you should move the code in GlobalCEFApp.OnWebKitInitialized to the AppHelper project.
Also try calling Chromium1.ShowDevTools with a nil value for the aDevTools parameter. This will create the devtools in a new window handled by CEF.
So I have moved GlobalCEFApp.OnWebKitInitialized to AppHelper and it worked :) ShowDevTools with a nil value also worked which is fine, but shame it doesn't work like on Windows. Nevertheless thank for help in solving my issue :)
Greetings :) I have wrote platform app based on CEF4Delphi and I've noticed an issue on MacOS platform.
JS Extension doesn't work when property
GlobalCEFApp.SingleProcess := False;
it is working when
GlobalCEFApp.SingleProcess := True
.My extension is like below:
TempExtensionCode := 'var ui;' + 'if (!ui)' + ' ui = {};' + '(function() {';
(... some functions ... ); TempExtensionCode := TempExtensionCode + '})();';
Extension is working in each case on Windows.
There is minor problem with resizing DevTools (![Zrzut ekranu 2024-02-2 o 07 42 42](https://github.com/salvadordf/CEF4Delphi/assets/19989728/29f5fbcd-1780-4ae3-acba-0376ab02dd5c)
Align := alRight
) using splitter, it's not anchoring to the right side of the form.Tested on latest stable release: https://github.com/salvadordf/CEF4Delphi/releases/tag/120.0.6099.234