Page 1 of 1

JSExtensionWithFunction with multi process not working

Posted: Mon Jan 27, 2020 4:17 pm
by dinko
I've take code from JSExtensionWithFunction and I have successfully created a project that get JS commands from html page.
It works perfect but only if SingleProcess = true. When the SingleProcess = false the Chromium1ProcessMessageReceived never receives any message.

Any idea?

Re: JSExtensionWithFunction with multi process not working

Posted: Mon Jan 27, 2020 4:28 pm
by dinko
Small correction:

I JSRTTIExtension example not JSExtensionWithFunction.

Re: JSExtensionWithFunction with multi process not working

Posted: Tue Jan 28, 2020 11:56 am
by salvadordf
Hi,

I just tested the JSRTTIExtension demo in the latest CEF4Delphi version available at GitHub with Delphi 10.3.3 and it works correctly.

The single process mode is not supported and may cause unexpected issues. Use it only for debugging purposes.

Re: JSExtensionWithFunction with multi process not working

Posted: Tue Jan 28, 2020 1:41 pm
by dinko
That's what I am telling

Single process: works properly
Multi process: not working

So I can't rely on Single process.
I would try with latest version and let you know asap.

Re: JSExtensionWithFunction with multi process not working

Posted: Tue Jan 28, 2020 2:24 pm
by salvadordf
I forgot to add that Delphi can only debug one process and any breakpoint set while debugging the main browser process will not seem to work if it's set on a procedure that it's only executed in the render process.

In reality, it is executed but Delphi is debugging a different process.

Re: JSExtensionWithFunction with multi process not working

Posted: Wed Jan 29, 2020 2:22 pm
by dinko
You mean while you have "Integrated debugger" set to on, right?
Because I am trying with debugger off using build platform Release and, still doesnt work.
Didnt tried the latest version yet.

Re: JSExtensionWithFunction with multi process not working

Posted: Wed Jan 29, 2020 2:43 pm
by salvadordf
Yes, you need to build the demo with the Debug configuration and also run with the integrated debugger (F9).

The JSRTTIExtension demo is a slightly less complicated version of the JSExtension demo that uses RTTI.

Please, try the JSExtension demo in the latest CEF4Delphi version and read this for more details about debugging and how to make JavaScript extensions work :
https://www.briskbard.com/index.php?lan ... #debugging
https://www.briskbard.com/forum/viewtop ... 4084#p4084