mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +08:00
fix: accept file cookies only if AndroidInsecureFileModeEnabled (#1449)
This commit is contained in:
parent
26b21219f7
commit
2d2ad4cb81
@ -19,8 +19,6 @@
|
||||
|
||||
package org.apache.cordova.engine;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.os.Build;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.WebView;
|
||||
|
||||
@ -35,10 +33,14 @@ class SystemCookieManager implements ICordovaCookieManager {
|
||||
webView = webview;
|
||||
cookieManager = CookieManager.getInstance();
|
||||
|
||||
cookieManager.setAcceptFileSchemeCookies(true);
|
||||
cookieManager.setAcceptThirdPartyCookies(webView, true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void setAcceptFileSchemeCookies() {
|
||||
cookieManager.setAcceptFileSchemeCookies(true);
|
||||
}
|
||||
|
||||
public void setCookiesEnabled(boolean accept) {
|
||||
cookieManager.setAcceptCookie(accept);
|
||||
}
|
||||
|
@ -165,6 +165,7 @@ public class SystemWebViewEngine implements CordovaWebViewEngine {
|
||||
LOG.d(TAG, "Enabled insecure file access");
|
||||
settings.setAllowFileAccess(true);
|
||||
settings.setAllowUniversalAccessFromFileURLs(true);
|
||||
cookieManager.setAcceptFileSchemeCookies();
|
||||
}
|
||||
|
||||
settings.setMediaPlaybackRequiresUserGesture(false);
|
||||
|
Loading…
Reference in New Issue
Block a user