Page 1 of 1

Geolocation

Posted: Tue Feb 04, 2025 12:37 pm
by dilfich
Hi, geolocation is almost working now and the question is, how do I get through the pop-up window where permission is asked?

There is also a problem with this resolution in the OSR browser, sometimes there is a window and sometimes there is not.

Re: Geolocation

Posted: Tue Feb 04, 2025 2:44 pm
by salvadordf
dilfich wrote: Tue Feb 04, 2025 12:37 pm Hi, geolocation is almost working now and the question is, how do I get through the pop-up window where permission is asked?
Try using the TChromiumCore.OnRequestMediaAccessPermission event.
dilfich wrote: Tue Feb 04, 2025 12:37 pm There is also a problem with this resolution in the OSR browser, sometimes there is a window and sometimes there is not.
Please, provide a step by step guide to reproduce that issue.

Re: Geolocation

Posted: Tue Feb 04, 2025 7:00 pm
by dilfich
salvadordf wrote: Tue Feb 04, 2025 2:44 pm Try using the TChromiumCore.OnRequestMediaAccessPermission event.
Almost but a little different :) Everything is working now!

Code: Select all

 OnShowPermissionPrompt
 aResult := True;
 callback.cont(CEF_PERMISSION_RESULT_ACCEPT);
salvadordf wrote: Tue Feb 04, 2025 2:44 pm Please, provide a step by step guide to reproduce that issue.
https://postimg.cc/VdVktcvW
There are no steps, we run the demo SimpleOSRBrowser and the request does not always appear.

Re: Geolocation

Posted: Wed Feb 05, 2025 9:02 am
by dilfich
There is another question, what is the difference?

CEF_PERMISSION_RESULT_DENY
and
CEF_PERMISSION_RESULT_DISMISS

If I forbid it, what should I specify?

Re: Geolocation

Posted: Sat Feb 08, 2025 3:44 am
by dilfich
By the way, it also works on older versions!
Tested for 126.
Plus emulation :)
https://postimg.cc/Fk1BqsdP

Code: Select all

   TempParams := TCefDictionaryValueRef.New;
   TempParams.SetDouble('latitude', 40.730610);
   TempParams.SetDouble('longitude', -73.935242);
   TempParams.SetDouble('accuracy', 11);
   Chromium1.ExecuteDevToolsMethod(0, 'Page.setGeolocationOverride', TempParams);

Re: Geolocation

Posted: Sun Feb 09, 2025 4:38 pm
by salvadordf
About the meaning of CEF_PERMISSION_RESULT_DENY and CEF_PERMISSION_RESULT_DISMISS I can only repeat what you see in the code comments, which is the official CEF documentation. :?

I haven't tested that feature intensively but perhaps the value to the permission request is cached for the duration of the session.