Bug 222861 - Geolocation API does not work in WKWebView with custom URL scheme handler
Summary: Geolocation API does not work in WKWebView with custom URL scheme handler
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Safari 14
Hardware: Mac (Intel) macOS 11
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-06 07:47 PST by Ashley Gullen
Modified: 2021-03-18 01:25 PDT (History)
12 users (show)

See Also:


Attachments
Patch (9.33 KB, patch)
2021-03-17 02:01 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (12.06 KB, patch)
2021-03-17 03:11 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ashley Gullen 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.
Comment 1 Radar WebKit Bug Importer 2021-03-13 07:48:13 PST
<rdar://problem/75394695>
Comment 2 youenn fablet 2021-03-17 02:01:46 PDT
Created attachment 423456 [details]
Patch
Comment 3 youenn fablet 2021-03-17 03:11:32 PDT
Created attachment 423464 [details]
Patch
Comment 4 EWS 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].