Page 2 of 2

Re: CEF ChromeRuntime

Posted: Sun Sep 19, 2021 10:59 am
by salvadordf
I couldn't reproduce that issue with the TinyBrowser2 demo.

However, if a download doesn't trigger those events it might be due to a missing feature in the Chrome Runtime mode.

Edit : I added the TChromium.OnBeforeDownload event to that demo to test other normal downloads and they work.

Re: CEF ChromeRuntime

Posted: Sun Sep 19, 2021 12:35 pm
by mike2k
salvadordf wrote: Sun Sep 19, 2021 10:59 am I couldn't reproduce that issue with the TinyBrowser2 demo.
If you press ALT key and click on a link (doesn't need to be pdf, exe) it will download the html file if it'a page.
Just tested it with TinyBrowser2 too and it downloads the html page.

Same when running

Code: Select all

cefclient.exe --use-views --enable-chrome-runtime

Re: CEF ChromeRuntime

Posted: Sun Sep 19, 2021 1:28 pm
by salvadordf
I tested again in a real PC (outside my virtual machine) and now I can reproduce it.
The callbacks in the download handler are never executed. cefclient has the same issue.

I checked again the CEF issue about the Chrome runtime :
https://bitbucket.org/chromiumembedded/cef/issues/2969/support-chrome-windows-with-cef-callbacks

The Download tests are included in the list of "not yet supported" features.

Re: CEF ChromeRuntime

Posted: Sun Sep 19, 2021 6:40 pm
by mike2k
I've added an issue report for ALT+click, as adviced by magreenblatt:
https://bitbucket.org/chromiumembedded/cef/issues/3183/windows-cef-chrome-runtime-prevent-alt

I use SetWindowsHookEx with mouse hook as workaround :)

Re: CEF ChromeRuntime

Posted: Sun Sep 19, 2021 7:39 pm
by mike2k
I'm trying to change the Tinybrowser application ICON at runtime, because in Chrome Rutime mode it's an exclamation point.

I've tried to save a PNG to stream and after that use CEFWindowComponent.WindowAppIcon.AddPng but just gives access violations.

Code: Select all

 stream:=TMemoryStream.Create;
 png.SaveToStream(stream);
 stream.Position:=0;
 FCEFWindowComponent.WindowAppIcon.AddPng(1,@stream,sizeof(stream))
Any idea what's wrong?

Re: CEF ChromeRuntime

Posted: Sun Sep 26, 2021 8:06 am
by mike2k
Hi again,

I'm trying to prevent multiple launch on Tinybrowser with chrome runtime, I've tried to use Mutex but don't know where to put it, as it blocks the multi process of chromium.
Any hint how to allow only one instance of the main application?

Thanks!

Re: CEF ChromeRuntime

Posted: Mon Sep 27, 2021 10:25 am
by salvadordf
mike2k wrote: Sun Sep 19, 2021 7:39 pm I'm trying to change the Tinybrowser application ICON at runtime, because in Chrome Rutime mode it's an exclamation point.

I've tried to save a PNG to stream and after that use CEFWindowComponent.WindowAppIcon.AddPng but just gives access violations.

Code: Select all

 stream:=TMemoryStream.Create;
 png.SaveToStream(stream);
 stream.Position:=0;
 FCEFWindowComponent.WindowAppIcon.AddPng(1,@stream,sizeof(stream))
Any idea what's wrong?
There are many untested features in this new mode and I probably did something wrong in that function, sorry. I just uploaded an alternative way to set that icon in TinyBrowser.
mike2k wrote: Sun Sep 26, 2021 8:06 am I'm trying to prevent multiple launch on Tinybrowser with chrome runtime, I've tried to use Mutex but don't know where to put it, as it blocks the multi process of chromium.
Any hint how to allow only one instance of the main application?
Check the command line arguments in DPR file before the GlobalCEFApp initialization. Search for some "--type=" parameter and try to use a mutex when "--type=" is not present.

Re: CEF ChromeRuntime

Posted: Mon Sep 27, 2021 1:13 pm
by mike2k
Thanks.

Found other workarounds, but yours are cleaner :)

Re: CEF ChromeRuntime

Posted: Tue Sep 28, 2021 7:58 am
by mike2k
salvadordf wrote: Sun Sep 19, 2021 1:28 pm I tested again in a real PC (outside my virtual machine) and now I can reproduce it.
The callbacks in the download handler are never executed. cefclient has the same issue.
Were this tests only for ALT+click ? or the download events are not triggered for normal downloads too?
Because for me on CEF 92 they don't even trigger.

Thanks.

Re: CEF ChromeRuntime

Posted: Tue Sep 28, 2021 2:50 pm
by salvadordf
I was testing the latest CEF version at that time but it's an incomplete CEF feature and we need to wait until the CEF project implements it completely.

I'll test it again to see what happens with normal downloads.