mirror of
https://github.com/status-im/react-native-webview.git
synced 2026-08-31 03:31:05 +00:00
fix(android): webview crash with incognito in Android Lollipop (#799)
This commit is contained in:
committed by
Thibault Malbranche
parent
39e5373d3e
commit
47e9a0b97d
@@ -367,7 +367,11 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
|
||||
@ReactProp(name = "incognito")
|
||||
public void setIncognito(WebView view, boolean enabled) {
|
||||
// Remove all previous cookies
|
||||
CookieManager.getInstance().removeAllCookies(null);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
CookieManager.getInstance().removeAllCookies(null);
|
||||
} else {
|
||||
CookieManager.getInstance().removeAllCookie();
|
||||
}
|
||||
|
||||
// Disable caching
|
||||
view.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
|
||||
|
||||
Reference in New Issue
Block a user