I have a need for using GeoLocation in the HTML Executable 2024 version, using the Webview.rendering engine When the notification popup displays, “This file wants to know your location” to the user and the Allow button is clicked it doesn’t close the notification, the 2nd attempt does close. However, it does not allow GeoLocation services and the prompt will come up again when the page is reloaded. I have tried --disable-web-security argument along with --allow-file-access-from-files but it does not work.
I had tried geo some months back and never got it to work. Did not have time to deeply troubleshoot but can confirm there is issue.
I tried all kinds of flags from: WebView2 browser flags - Microsoft Edge Developer documentation | Microsoft Learn
Side note: the geo script works perfectly in Edge, Chrome and Opera browsers served from net but no go in HTMLExe
Can you please share the geo script you are using? If not, we’ll try to reproduce the issue on our end.
You bet. Very simple script that can even run from desktop. You will have to get free API key though: Geocoding and Reverse Geocoding APIs - LocationIQ
Geo Location Script - https://www.filemail.com/d/keqxgizvakybkri
Here is a simple example project and the included html file even works by viewing as a local file on desktop in Chrome and Edge but will not work inside HTML Executable projects.
Includes HTMLExecutable project source
Thank you both for your files. We’ll study the problem.
Still not working for me in 2024.2. Same behavior.
You have to give the authorization to the app too in Windows Settings. See the sample in the main demo: there are some instructions.
I am sorry, I do not know what you mean, I have never had to make any changes directly to Windows for geo to work. Always been in the browser.
In my test script (one you asked me to provide way back), I get the popup asking to allow / deny. I allow but shows I denied.
The htmlexe demo never even asked me. I recorded a mp4 but you do not allow here. I converted to gif, but it will not upload here, sticks at 100% then shows:
Best I can do is try at imgur: https://imgur.com/a/fNVD3CC
The general demo has security turned on so nothing but a black screen in gif. No way to screenshot it or show you what is happening.
Hope this clears it up. If my users have to go into windows setting to allow a geo, never work out for me anyway.
-
Click on the Start button and select Settings.
-
Navigate to Privacy & security > Location.
-
Toggle the Location services switch to On.
-
Under Privacy & security > Location, scroll down to Let apps access your location.
-
Toggle this setting to On.
Depending on these values, it may work or not.
Ok, thank you.
My user base would never go for that. I thought it was like browser based, learn something new everyday
But it is nice to know what the issue is.
Yes, the original problem reported was to fix the browser based notification popup not working, not a system wide change, that’s not the same.
There may be a confusion here: you can now disable the browser based notification popup thanks to the new OnPermissionRequested
HEScript event and automatically grants access. But end users can also have widely forbidden geolocation in their Windows system settings and, in that case, it will not work.