File tree 1 file changed +6
-5
lines changed
android/capacitor/src/main/java/com/getcapacitor/plugin
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -20,17 +20,18 @@ public class CapacitorCookies extends Plugin {
20
20
@ Override
21
21
public void load () {
22
22
this .bridge .getWebView ().addJavascriptInterface (this , "CapacitorCookiesAndroidInterface" );
23
- if (isEnabled ()) {
24
- this .cookieManager = new CapacitorCookieManager (null , java .net .CookiePolicy .ACCEPT_ALL , this .bridge );
25
- CookieHandler .setDefault (cookieManager );
26
- }
27
23
super .load ();
28
24
}
29
25
30
26
@ JavascriptInterface
31
27
public boolean isEnabled () {
32
28
PluginConfig pluginConfig = getBridge ().getConfig ().getPluginConfiguration ("CapacitorCookies" );
33
- return pluginConfig .getBoolean ("enabled" , false );
29
+ boolean isEnabled = pluginConfig .getBoolean ("enabled" , false );
30
+ if (isEnabled ) {
31
+ this .cookieManager = new CapacitorCookieManager (null , java .net .CookiePolicy .ACCEPT_ALL , this .bridge );
32
+ CookieHandler .setDefault (cookieManager );
33
+ }
34
+ return isEnabled ;
34
35
}
35
36
36
37
/**
You can’t perform that action at this time.
0 commit comments