I am using CefSharp. I have a RequestHandler which read data from a multiple databases. I would like to pass a context object which will contain a service instance which is bound to a specific database connection. I wonder what is the best way to do that using CefSharp. So far I was using global instance that is shared between the browser and the client code but I dont like that approach. Is there a way to set a "context" object per browser instance and use that context from the ResourceHandler?
Asked
Active
Viewed 386 times
0
-
Are you using a custom scheme? – amaitland May 28 '18 at 09:19
-
yes I am using custom scheme – ekalchev May 28 '18 at 15:34
-
1You can separate your browsers using a RequestContext and pass a different instance of the scheme handler factory to different context, http://cefsharp.github.io/api/63.0.0/html/M_CefSharp_RequestContext_RegisterSchemeHandlerFactory.htm https://github.com/cefsharp/CefSharp/wiki/General-Usage#request-context-browser-isolation – amaitland May 28 '18 at 22:30