|
@@ -328,6 +328,23 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
|
328
|
328
|
public void setMessagingEnabled(WebView view, boolean enabled) {
|
329
|
329
|
((RNCWebView) view).setMessagingEnabled(enabled);
|
330
|
330
|
}
|
|
331
|
+
|
|
332
|
+ @ReactProp(name = "incognito")
|
|
333
|
+ public void setIncognito(WebView view, boolean enabled) {
|
|
334
|
+ // Remove all previous cookies
|
|
335
|
+ CookieManager.getInstance().removeAllCookies(null);
|
|
336
|
+
|
|
337
|
+ // Disable caching
|
|
338
|
+ view.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
|
|
339
|
+ view.getSettings().setAppCacheEnabled(!enabled);
|
|
340
|
+ view.clearHistory();
|
|
341
|
+ view.clearCache(enabled);
|
|
342
|
+
|
|
343
|
+ // No form data or autofill enabled
|
|
344
|
+ view.clearFormData();
|
|
345
|
+ view.getSettings().setSavePassword(!enabled);
|
|
346
|
+ view.getSettings().setSaveFormData(!enabled);
|
|
347
|
+ }
|
331
|
348
|
|
332
|
349
|
@ReactProp(name = "source")
|
333
|
350
|
public void setSource(WebView view, @Nullable ReadableMap source) {
|