Bug 140198

Summary: WKWebViewConfiguration should provide public API to enable private browsing
Product: WebKit Reporter: Eugene But <eugenebut>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, ap, bdakin, dieter, sam, stuartmorgan
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: iPhone / iPad   
OS: All   
Attachments:
Description Flags
Patch bdakin: review-

Description Eugene But 2015-01-07 13:24:23 PST
WKWebView does not support custom protocol handlers, so there is no way to implement Private browsing for a Web Browser app. Private Browsing is very important privacy feature and it is supported by Safari.

This change shows an example of Private Browsing implementation, but it uses private API:
https://github.com/WebKit/webkit/commit/512bc88e867086713820d4eb86d736586c20586f
Comment 1 Eugene But 2015-01-07 16:00:52 PST
Radar ID: 17238307
Comment 2 Eugene But 2015-01-13 11:23:21 PST
Created attachment 244524 [details]
Patch
Comment 3 Beth Dakin 2015-01-13 13:07:19 PST
Comment on attachment 244524 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=244524&action=review

Sorry, meant to r-! The name _privateBrowsingEnabled is not good.

> Tools/MiniBrowser/mac/AppDelegate.m:-106
> -    privateConfiguraton._websiteDataStore = [_WKWebsiteDataStore nonPersistentDataStore];

Why is the removed?
Comment 4 Eugene But 2015-01-13 13:11:23 PST
Comment on attachment 244524 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=244524&action=review

>> Tools/MiniBrowser/mac/AppDelegate.m:-106
>> -    privateConfiguraton._websiteDataStore = [_WKWebsiteDataStore nonPersistentDataStore];
> 
> Why is the removed?

privateConfiguraton._privateBrowsingEnabled = YES; code will substitute internal data store with nonPersistentDataStore. So this change should have no functional effect.
Comment 5 Eugene But 2015-01-13 13:13:47 PST
>>> The name _privateBrowsingEnabled is not good.
The name follows the same patten as [WKWebViewConfiguration _featureCounterEnabled]. Please let me know if you don't like presence of leading underscore or using "privateBrowsing" term? Would appreciate if you can suggest a name which is better from your perspective.
Comment 6 Sam Weinig 2015-01-13 13:15:14 PST
Instead of using a property, I think the direction we will be going is exposing WKWebsiteDataStore as API and allowing setting a non persistent data store on the configuration.
Comment 7 Eugene But 2015-01-13 13:29:03 PST
Thank you for reply. In case if there already exists a private API which solves the problem, would it be useful to submit a patch which makes that API public?
Comment 8 Sam Weinig 2015-01-13 15:31:33 PST
(In reply to comment #7)
> Thank you for reply. In case if there already exists a private API which
> solves the problem, would it be useful to submit a patch which makes that
> API public?

No, we will make it public when we feel it is ready from prime time. No need for a patch.
Comment 9 Anders Carlsson 2015-04-24 13:57:15 PDT
This has been done now.