Skip to content

Commit

Permalink
fix(cookies): check isEnabled before setting cookieHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsChaceD authored Apr 6, 2023
1 parent 42d2eb3 commit 24a28cb
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ public class CapacitorCookies extends Plugin {
@Override
public void load() {
this.bridge.getWebView().addJavascriptInterface(this, "CapacitorCookiesAndroidInterface");
this.cookieManager = new CapacitorCookieManager(null, java.net.CookiePolicy.ACCEPT_ALL, this.bridge);
CookieHandler.setDefault(cookieManager);
if (isEnabled()) {
this.cookieManager = new CapacitorCookieManager(null, java.net.CookiePolicy.ACCEPT_ALL, this.bridge);
CookieHandler.setDefault(cookieManager);
}
super.load();
}

Expand Down

0 comments on commit 24a28cb

Please sign in to comment.