Bug 140208 - WKUIDelegate should provide a hook for page-specific location prompts
Summary: WKUIDelegate should provide a hook for page-specific location prompts
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: iPhone / iPad All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-01-07 14:18 PST by Eugene But
Modified: 2022-09-22 09:25 PDT (History)
3 users (show)

See Also:


Attachments
123 (104.23 KB, patch)
2022-09-22 07:18 PDT, ANDY
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene But 2015-01-07 14:18:26 PST
Summary:
The WKUIDelegate methods for alerts are very useful, as it finally allows a non-hacky way of doing things like off-screen rendering (e.g., for pre-rendering a page). However, a page can still throw a page-specific location permission prompt without any hook, which means a page the user can't see might prompt them.

For all the same reasons that the alert delegation exists, WKUIDelegate should also have a hook of some kind for controlling whether to show location permission prompts from individual pages.

Steps to Reproduce:
1) Make a WKWebView that shouldn't display any prompts (e.g., because it's offscreen).
2) Navigate it to maps.google.com

Expected Results:
A location prompt that can't be prevented/handled in native code.

Actual Results:
Making the following WKUIDelegateMethod public is perfect solution for us:
+- (bool)_webView:(WKWebView *)webView shouldRequestGeolocationAuthorizationForURL:(NSURL *)url isMainFrame:(BOOL)isMainFrame mainFrameURL:(NSURL *)mainFrameURL;
Comment 1 Eugene But 2015-01-07 16:08:14 PST
Radar ID: 17486671
Comment 2 Stefan Arentz 2015-05-12 07:22:46 PDT
+1 This would be wonderful to have for Firefox for iOS.
Comment 3 Stuart Morgan 2015-06-08 14:32:31 PDT
Note that this is a security issue, as described in rdar://21289208
Comment 4 ANDY 2022-09-22 07:18:03 PDT
Created attachment 462540 [details]
123
Comment 5 Stefan Arentz 2022-09-22 09:25:22 PDT
The attachment that just was posted got my hopes up but unfortunately it is spam or maybe something malicious. Beware.