mirror of
https://github.com/expo/react-native-webview.git
synced 2026-11-15 09:18:06 -10:00
fix(android): webview crash with incognito in Android Lollipop (#799)
This commit is contained in:
1 parent
39e5373d3e
commit
47e9a0b97d
1 file changed
+5
-1
@@ -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