Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a non-tracking in-app web browser

I am trying to create a webview (as an exercise) that does not track or store any browsing history locally.
I have made it so that when the webview is closed, it calls the following

[[NSURLSession sharedSession]resetWithCompletionHandler:^{}];

but I am finding that things like google search history persists some how between sessions. I have also tried clearing cookies separately through

NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
    for (NSHTTPCookie *cookie in [storage cookies]) {
       [storage deleteCookie:cookie];
    }
[[NSUserDefaults standardUserDefaults] synchronize];

still to no avail. Google searches still show when a new web view is created.
Is anyone aware of a way to remove the identifier that google is using to match that search history back to me? I'm concerned it's something like the bundle identifier, which is probably a bit trickier to prevent being read.
Any ideas are appreciated.
Regards,
Luke

like image 350
mylogon Avatar asked Mar 24 '17 08:03

mylogon


People also ask

What is Do Not Track in browser?

On your computer, open Chrome. Settings. Cookies and other site data. Turn Send a "Do not track" request with your browsing traffic on or off.

Should I turn on Do Not Track?

Do Not Track is a great idea, but when it comes down it, the technology has no bite. Companies can---and usually do---choose to ignore it and face no consequences for doing so. Despite this, you should enable the setting for the few sites that honor the setting.

How do you stop websites from tracking you on Iphone?

Go to Settings > Safari, then below Privacy & Security, turn any of the following on or off: Prevent Cross-Site Tracking: Safari limits third-party cookies and data by default. Turn this option off to allow cross-site tracking. Hide IP address: Safari automatically protects your IP address from known trackers.

What is an in app browser?

“In App Browser” is nothing but a web view that provides limited browsing functionality as a sub process of the app that triggers the web view. This also facilitates the flow of information from the browser view to the parent app. Android.


1 Answers

Try setting nonPersistentDataStore for WKWebsiteDataStore of WKWebViewConfiguration

Here is a sample code snippet

let webVuConfiguration = WKWebViewConfiguration()
webVuConfiguration.websiteDataStore =WKWebsiteDataStore.nonPersistentDataStore()
let webView = WKWebView(frame: webviewRect, configuration: webVuConfiguration)
like image 58
Durai Amuthan.H Avatar answered Oct 29 '22 16:10

Durai Amuthan.H