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.

setting GlobalCEFApp.SingleProcess to false

PioPio
Posts: 42
Joined: Sun Nov 05, 2017 10:25 pm

Re: setting GlobalCEFApp.SingleProcess to false

Post by PioPio »

Hello,

Here is an MCVE in case anybody is willing to look into it.
Lines 171, 172, and 173 have to be changed based on where your CEF4Delphi\bin\ is

The program does not trigger the procedure SimpleNodeSearch that scans the DOM. If I remove the comment from GlobalCEFApp.SingleProcess := True; the software triggers SimpleNodeSearch correctly.

I am sure I am missing out on something obvious but I cannot see it.

Many thanks
Alberto
You do not have the required permissions to view the files attached to this post.
zaqaz
Posts: 15
Joined: Wed Nov 30, 2022 8:59 pm

Re: setting GlobalCEFApp.SingleProcess to false

Post by zaqaz »

// GlobalCEFApp.SingleProcess := True;

Code: Select all

04:55:19 : Chromium1LoadEnd //  1
04:55:19 : Chromium1LoadEnd //  False
04:55:19 : Logging Enabled
04:55:21 : Chromium1LoadEnd //  1
04:55:21 : Chromium1LoadEnd //  True
04:55:21 : Timer4Timer //  1
04:55:21 : Form4.Handle 592008
04:55:21 : PID_BROWSER 0
04:55:21 : VisitDOMMsg //  1
04:55:21 : VisitDOMMsg //  2
04:55:21 : Chromium1ProcessMessageReceived //  1
GlobalCEFApp.SingleProcess := True;

Code: Select all

04:57:01 : Chromium1LoadEnd //  1
04:57:01 : Chromium1LoadEnd //  False
04:57:02 : Logging Enabled
04:57:02 : Chromium1LoadEnd //  1
04:57:02 : Chromium1LoadEnd //  True
04:57:02 : Timer4Timer //  1
04:57:03 : Form4.Handle 591726
04:57:03 : PID_BROWSER 0
04:57:03 : VisitDOMMsg //  1
04:57:03 : VisitDOMMsg //  2
04:57:03 : GlobalCEFApp_OnProcessMessageReceived //  1
04:57:04 : DOMVisitor_OnDocAvailable //  1
04:57:05 : SimpleNodeSearch // start
04:57:06 : SimpleNodeSearch // 2
04:57:06 : DOMVisitor_OnDocAvailable //  2
04:57:06 : Chromium1ProcessMessageReceived //  1
04:57:06 : GlobalCEFApp_OnProcessMessageReceived //  2
GlobalCEFApp_OnProcessMessageReceived
not run

= >

if
GlobalCEFApp.SingleProcess = false
then
GlobalCEFApp.HWND <> form4.hwnd

=>

1. you must send message to GlobalCEFApp
2. move code to Chromium1ProcessMessageReceived
3. stop use asynk, and make wait procedure
Post Reply