Page 1 of 2

Browser Behavior

Posted: Tue Apr 26, 2022 10:59 am
by dilfich
This didn't seem to happen before, I noticed by chance. With each new transition, something like a new initialization.
(it's also visible on the windows cursor, it reacts to the opening of links every time)

For example we alternate... MiniBrowser
  • data:text/html;charset=utf-8;base64,CjxodG1sPjxib2R5IGJnY29sb3I9IndoaXRlIj48aDI+Q0xSPC9oMj48L2JvZHk+PC9odG1sPg==
    https://www.google.com/
    https://ya.ru/
I checked in the official example, there is no such thing noticeable, everything is smooth as a normal browser.
cef_binary_100.0.24+g0783cf8+chromium-100.0.4896.127_windows32_client

Re: Browser Behavior

Posted: Tue Apr 26, 2022 5:19 pm
by dilfich
Image

Here is an example, changed in MiniBrowser to follow links to Enter for similarity.
In the screenshot, I highlighted what was meant.
And the video shows that cefclient.exe does not have a similar phenomenon

https://drive.google.com/file/d/1aat5OWJZ2ND50dGriDXTSC0ClDBqtKGC/view

And if you open something in several instances of the browser, it's just a disaster, just because of one cursor, it's not possible to work on a PC. :?

Re: Browser Behavior

Posted: Wed Apr 27, 2022 9:04 am
by salvadordf
MiniBrowser now uses TChromium.OnCursorChange to update the cursor.

Please, download CEF4Delphi again from GitHub and check if that problem is now fixed.

Re: Browser Behavior

Posted: Sat Apr 29, 2023 10:04 pm
by dilfich
I forgot to answer, no, nothing has changed.

A simple test

Code: Select all

procedure TMiniBrowserFrm.Button1Click(Sender: TObject);
begin
  TThread.CreateAnonymousThread(
    procedure
    var
      T: Integer;
    begin
     for T:= 0 to 99 do begin
      Chromium1.LoadURL('about:blank');
      Sleep(500);
      Chromium1.LoadURL('https://www.google.com');
      Sleep(1000);
     end;
    end).Start;
end;

Re: Browser Behavior

Posted: Tue May 02, 2023 7:45 pm
by salvadordf
Hi,

Every sleep call freezes the main application thread and this should be avoided because the application can't handle new windows messages.

Use asynchronous methods and events instead. Don't run CPU intensive code in CEF events and also avoid calling sleep in any CEF event to improve performance and responsiveness.

Re: Browser Behavior

Posted: Thu May 04, 2023 5:41 am
by dilfich
Apparently you misunderstood me.
Please watch the minute-long video where the mini browser and the official client are shown.

https://workupload.com/file/FNV8CaxTjt7

Pay attention to the cursor when I click on the link or go back.

This is really a problem. If the application is automated and follows the links at this time it is not possible to work at the computer because the cursor is constantly flashing and it does not matter whether it is fast to make a transition from one link or fast.

And the video shows that this manifests itself even with normal navigation, unlike the official client.

Re: Browser Behavior

Posted: Sat May 06, 2023 9:37 am
by salvadordf
I've searched for any code that sets the cursor to crAppStart, CT_PROGRESS or IDC_APPSTARTING and I couldn't find anything on CEF or CEF4Delphi.

I also did a quick search in Delphi's source code and I couldn't find anything relevant.

I tested the official CEF sample application with some of the command line switches that CEF4Delphi uses and I could reproduce this issue with cefclient.

Try using this and you will see the crAppStart cursor when you click some links:

Code: Select all

cefclient.exe --no-sandbox
Delphi and Lazarus can't use Chromium's sandbox and the only way to avoid this issue is to use a browser in OSR mode where you have absolute control of the cursor.

Re: Browser Behavior

Posted: Sat May 06, 2023 8:58 pm
by dilfich
This is the point that in OSR the same thing is so the cursor flashes not only over the browser program but everywhere.
For example, you can use a timer and click on two different links in turn.
At the same time, this is not observed in the SingleProcess mode, but it would be better on the contrary ((

Re: Browser Behavior

Posted: Mon May 08, 2023 6:47 am
by dilfich
I noticed that this behavior is similar if you work with a Google site, but there is no such thing with another :shock:

good
Chromium.LoadURL('https://www.briskbard.com/');
bad
Chromium.LoadURL('https://www.google.com/');

So the problem is in the content, but how to avoid this? :?

Re: Browser Behavior

Posted: Tue May 09, 2023 8:55 am
by salvadordf
dilfich wrote: Mon May 08, 2023 6:47 am So the problem is in the content, but how to avoid this? :?
This is caused by some internal code change in Chromium. I don't know why this is happening.