Geolocation Permission Denied, how to enable?

1,223 views
Skip to first unread message

gpm...@gmail.com

unread,
Oct 6, 2016, 9:10:24 AM10/6/16
to PHP Desktop
I have an application that uses geolocation and I cannot get it to work in PHP Desktop. Using a basic navigator.geolocation.getCurrentPosition(showPosition) call results in a Code 1, User Denied Geolocation. I have attempted the following:

Using PHP Desktop Chrome 47.5 release I added a batch file to set the google apis at runtime. No change.

I built CEF (CEF 3.2526.1366.g8617e7c) binary, and 47.5 from source. No Change.

I tested cefclient application from above build. Without my batch file I get the same results, Code 1 User Denied Geolocation. When I call the program using the batch file to set the api keys, the cefclient works for geolocation.

I built CEF from source (not binary) release branch 2526 "baking in" my api keys. Again, the cefclient application works as expected but PHP Desktop does not.

I have tried a page on the local server (my code) and external websites through the PHP Desktop browser and the result is always the same. When launching in an external browser from context menu within PHP Desktop the functionality works as expected.

Tested on Windows 7 and Windows 10.

Am I missing something or is this expected behavior/feature not supported. Any help is greatly appreciated.

Czarek Tomczak

unread,
Oct 6, 2016, 9:27:45 AM10/6/16
to PHP Desktop

gpm...@gmail.com

unread,
Oct 6, 2016, 9:34:13 AM10/6/16
to PHP Desktop
Thanks for the quick reply. I had reviewed that and every other incarnation of the issue I could find. I have created my api keys, I am using a .bat file to set my api keys at runtime and I've even baked my api keys into my cef build. At no point can I get it to work within PHP Desktop.
Message has been deleted

Czarek Tomczak

unread,
Oct 6, 2016, 12:49:47 PM10/6/16
to PHP Desktop
Ignore my previous post with the ideas. For geolocation to work it is required to implement CefGeoLocationHandler: https://bitbucket.org/chromiumembedded/cef/src/b660893c6e800374d2b908a0b56ca47441ea2135/include/cef_geolocation_handler.h?at=2526&fileviewer=file-view-default#cef_geolocation_handler.h-67

We could allow to configure this through settings.json, but as it requires setting google API keys, we could as well set Access permission by default. Pull requests are welcome. Implementing this should be straightforward, just see how other handlers and its callbacks are implemented in phpdesktop/cef/client_handler.h and client_handler.cpp. Example implementation is available in upstream cefclient.

Czarek Tomczak

unread,
Oct 6, 2016, 12:54:13 PM10/6/16
to PHP Desktop
Created Issue #195 to track this: https://github.com/cztomczak/phpdesktop/issues/195
Reply all
Reply to author
Forward
0 new messages