Skip to content

Commit

Permalink
Jelly: Inform CookieManager about cookie policy on create
Browse files Browse the repository at this point in the history
In some cases, calling loadUrl() before the cookie manager was
informed if it's allowed to accept/use cookies would cause an incognito
page to use the old session cookies.

Change-Id: I96ebd89f1492086dc247f73cac35d4826c97851b
  • Loading branch information
luca020400 authored and luk1337 committed May 5, 2024
1 parent cfd5e0f commit ccbdf78
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/src/main/java/org/lineageos/jelly/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ class MainActivity : WebViewExtActivity(), SharedPreferences.OnSharedPreferenceC
menuDialog.showAsDropdownMenu(urlBarLayout, sharedPreferencesExt.reachModeEnabled)
}

CookieManager.getInstance()
.setAcceptCookie(!incognito && sharedPreferencesExt.cookiesEnabled)

webView.init(this, urlBarLayout, incognito)
webView.isDesktopMode = desktopMode
webView.loadUrl(url ?: sharedPreferencesExt.homePage)
Expand Down

0 comments on commit ccbdf78

Please sign in to comment.