Skip to content

Conversation

@threethan
Copy link

This PR removes the modified request context from desktop webviews.

The modified request context was previously used only to apply WebSettings.customUserAgentString, but had the unintended side-effect of delegating all cookies to the modified CefRequestContext's cookie manager.

  • Since a new request context was being created every time a WebView was created, cookies were effectively transient
  • Since WebViewState.getCookieManager() uses the global cookie manager, it was unable to access cookies within modified request context

--

This PR instead applies the user agent by adding a CefRequestHandler, which does not separate cookies.

This approach still applies the user agent without any apparent downsides.

  • The global cookie manager is used, and WebViewState.getCookieManager() works as expected.
  • Cookies are now persistent and shared between WebViews on desktop. This seems to be consistent with other platforms.

Resolves #395, #152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Webview Desktop - CookieManager is not used by the actual webview

1 participant