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 4, 2024
1 parent 483a163 commit 6509b2d
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 @@ -253,6 +253,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 6509b2d

Please sign in to comment.