react-native-wkwebview icon indicating copy to clipboard operation
react-native-wkwebview copied to clipboard

Add a removeData function

Open markdaws opened this issue 8 years ago • 2 comments

This function will clear the specified data from the WKWebView. You call the function with an array of the types you want to remove:

this.webView.removeData([ WebsiteDataTypes.DiskCache, WebsiteDataTypes.OfflineWebApplicationCache, WebsiteDataTypes.MemoryCache, WebsiteDataTypes.LocalStorage, WebsiteDataTypes.Cookies, WebsiteDataTypes.SessionStorage, WebsiteDataTypes.IndexedDBDatabases, WebsiteDataTypes.WebSQLDatabases, ])

WebsiteDataTypes is now exported from the module, so you include:

import WKWebView, { WebsiteDataTypes } from 'react-native-wkwebview-reborn'

If you pass null for the array then all data types are removed.

markdaws avatar Apr 26 '17 18:04 markdaws

Any thoughts on merging this change? It would be great not to have a fork just for this one issue.

Thanks.

markdaws avatar Dec 08 '17 01:12 markdaws

Hey @markdaws, nice work!

Would love to see this merged as well. Such a great feature to have for us privacy minded users. 😇

reimertz avatar Apr 16 '18 10:04 reimertz