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.
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.
Geolocation
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Geolocation
Try using the TChromiumCore.OnRequestMediaAccessPermission event.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?
Please, provide a step by step guide to reproduce that issue.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.
Re: Geolocation
Almost but a little differentsalvadordf wrote: Tue Feb 04, 2025 2:44 pm Try using the TChromiumCore.OnRequestMediaAccessPermission event.

Code: Select all
OnShowPermissionPrompt
aResult := True;
callback.cont(CEF_PERMISSION_RESULT_ACCEPT);
https://postimg.cc/VdVktcvWsalvadordf wrote: Tue Feb 04, 2025 2:44 pm Please, provide a step by step guide to reproduce that issue.
There are no steps, we run the demo SimpleOSRBrowser and the request does not always appear.
Re: Geolocation
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?
CEF_PERMISSION_RESULT_DENY
and
CEF_PERMISSION_RESULT_DISMISS
If I forbid it, what should I specify?
Re: Geolocation
By the way, it also works on older versions!
Tested for 126.
Plus emulation
https://postimg.cc/Fk1BqsdP
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);
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Geolocation
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.

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