Cefsharp OffScreen set RequestContext

1.2k Views Asked by At

I want to define a new RequestContext when using CefSharp OffScreen to prevent multiple browser instances sharing the same information (e.g. cookies).

I can simply do that with CefSharp WinForms like that:

RequestContextSettings requestContextSettings = new RequestContextSettings();

requestContextSettings.PersistSessionCookies = false;
requestContextSettings.PersistUserPreferences = false;

WebBrowser.RequestContext = new RequestContext(requestContextSettings);

But the RequestContext is readonly in the offscreen variant. See http://cefsharp.github.io/api/57.0.0/html/P_CefSharp_OffScreen_ChromiumWebBrowser_RequestContext.htm Why is that so? And are there other ways to accomplish it?

0

There are 0 best solutions below