Bug 222861

Summary: Geolocation API does not work in WKWebView with custom URL scheme handler
Product: WebKit Reporter: Ashley Gullen <ashley>
Component: WebKit Misc.Assignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, benjamin, cdumez, dvpdiner2, eric.carlson, ews-watchlist, glenn, jer.noble, philipj, sergio, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: Mac (Intel)   
OS: macOS 11   
See Also: https://bugs.webkit.org/show_bug.cgi?id=219020
https://bugs.webkit.org/show_bug.cgi?id=192595
Attachments:
Description Flags
Patch
none
Patch none

Ashley Gullen
Reported 2021-03-06 07:47:56 PST
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.
Attachments
Patch (9.33 KB, patch)
2021-03-17 02:01 PDT, youenn fablet
no flags
Patch (12.06 KB, patch)
2021-03-17 03:11 PDT, youenn fablet
no flags
Radar WebKit Bug Importer
Comment 1 2021-03-13 07:48:13 PST
youenn fablet
Comment 2 2021-03-17 02:01:46 PDT
youenn fablet
Comment 3 2021-03-17 03:11:32 PDT
EWS
Comment 4 2021-03-18 01:25:48 PDT
Committed r274622: <https://commits.webkit.org/r274622> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423464 [details].
Note You need to log in before you can comment on or make changes to this bug.