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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

UserAgentAndMetadata Source

dilfich
Posts: 368
Joined: Thu Nov 30, 2017 1:17 am

Re: UserAgentAndMetadata Source

Post by dilfich »

sodlf159 wrote: Wed Feb 05, 2025 5:50 pm https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmitTouchEventsForMouse
So what? :)
It doesn't work in OSR, there's still a regular cursor, that's what I was talking about.

Code: Select all

procedure TChrom.CursorChange(      Sender           : TObject;
                                     const browser          : ICefBrowser;
                                           cursor_          : TCefCursorHandle;
                                           cursorType       : TCefCursorType;
                                     const customCursorInfo : PCefCursorInfo;
                                     var   aResult          : boolean);
begin
   Form1.BufferPanel.Cursor := CefCursorToWindowsCursor(cursorType);
  aResult       := True;
end;
TCefCursorType - there is no touchpad
dilfich
Posts: 368
Joined: Thu Nov 30, 2017 1:17 am

Re: UserAgentAndMetadata Source

Post by dilfich »

And yes, we forgot about the parameter in setUserAgentOverride.

Code: Select all

TempParams.SetString('platform', 'Linux armv81');
Navigator Object
https://browserleaks.com/javascript
If not specified, it will show
platform Win32
sodlf159
Posts: 90
Joined: Thu Nov 09, 2023 1:55 pm

Re: UserAgentAndMetadata Source

Post by sodlf159 »

dilfich wrote: Fri Feb 07, 2025 6:33 am
sodlf159 wrote: Wed Feb 05, 2025 5:50 pm https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmitTouchEventsForMouse
So what? :)
It doesn't work in OSR, there's still a regular cursor, that's what I was talking about.

Code: Select all

procedure TChrom.CursorChange(      Sender           : TObject;
                                     const browser          : ICefBrowser;
                                           cursor_          : TCefCursorHandle;
                                           cursorType       : TCefCursorType;
                                     const customCursorInfo : PCefCursorInfo;
                                     var   aResult          : boolean);
begin
   Form1.BufferPanel.Cursor := CefCursorToWindowsCursor(cursorType);
  aResult       := True;
end;
TCefCursorType - there is no touchpad
TempParams := TCefDictionaryValueRef.New;
TempParams.SetDouble('configuration', mobile);
TempParams.SetDouble('enabled', True);
Chromium1.ExecuteDevToolsMethod(0, 'Emulation.setEmitTouchEventsForMouse', TempParams);
dilfich
Posts: 368
Joined: Thu Nov 30, 2017 1:17 am

Re: UserAgentAndMetadata Source

Post by dilfich »

sodlf159 wrote: Mon Feb 10, 2025 11:29 pm TempParams := TCefDictionaryValueRef.New;
TempParams.SetDouble('configuration', mobile);
TempParams.SetDouble('enabled', True);
Chromium1.ExecuteDevToolsMethod(0, 'Emulation.setEmitTouchEventsForMouse', TempParams);
What's new here? :)

Try it yourself in the demo - SimpleOSRBrowser

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var
  TempParams : ICefDictionaryValue;
begin
  TempParams := TCefDictionaryValueRef.New;
  TempParams.SetBool('enabled', True);
  TempParams.SetString('configuration', 'mobile'); // desktop
  chrmosr.ExecuteDevToolsMethod(0, 'Emulation.setEmitTouchEventsForMouse', TempParams);
end;
Post Reply