In WKWebView on macOS, the Geolocation API does not work when using a custom URL scheme handler (e.g. myapp://). Attempting to use it returns the error "Origin does not have permission to use Geolocation service". This appears to derive from Geolocation::startRequest() in Source/WebCore/Modules/geolocation/Geolocation.cpp. In this case window.isSecureContext is true, indicating it is a secure context, but the Geolocation API does not work. This appears to be similar to issue 220184: previously navigator.mediaDevices was only exposed on the HTTPS scheme, but a fix was made to allow it to be used on other schemes. Perhaps something similar should be done for Geolocation.
<rdar://problem/75394695>
Created attachment 423456 [details] Patch
Created attachment 423464 [details] Patch
Committed r274622: <https://commits.webkit.org/r274622> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423464 [details].