C# ChromimunFX: How to create multiTab browsing, and isolate between each tab?

I’m trying to use an embedded browser into my WinForms application. I used CefSharp ChromiumWebBrowser, it work perfectly. However, CEFSharp requires the Visual C++ 2013, or the Visual C++ 2008….I ...

I’m trying to use an embedded browser into my WinForms application. I used CefSharp ChromiumWebBrowser, it work perfectly. However, CEFSharp requires the Visual C++ 2013, or the Visual C++ 2008….I think it is a complicated dependency. I'm creating a portable application without the dependency envirenment.

I have found another library, similar CefSharp, also use Chrominum, called ChromiumFX (visit: https://bitbucket.org/chromiumfx/chromiumfx ). The library uses the .Net Framework 3.5 (Default available in Windows 7) , no need to install Visual C++. And it is suitable for my application.

But I don’t find any way to create multi tabs application with this library. Here is what I tried to do:

private void LifeSpanHandler_OnBeforePopup(object sender, CfxOnBeforePopupEventArgs e)
 {
     e.SetReturnValue(true);
     tabPage2.InvokeOnUiThreadIfRequired(() =>
     {
         ChromiumWebBrowser b = new ChromiumWebBrowser(e.TargetUrl);
         b.Dock = DockStyle.Fill;
         tabPage2.Controls.Add(b);
     });
}

InvokeOnUiThreadIfRequired is an extension method:

public static void InvokeOnUiThreadIfRequired(this Control control, Action action)
 {
     if (control.InvokeRequired)
     {
         control.BeginInvoke(action);
     }
     else
     {
         action.Invoke();
     }
}

But the application error and the program has crashed.

Another thing, when I created a new instance of ChromiumWebBrowser, I want it isolated with another instance, it means do not use the same cookies, sessions with any instance (private browser). In CefSharp, just create a new RequestContext for new instance:

webbrowser.RequestContext = new RequestContext();

But in ChromiumFX, I dont find any way to do that!

Somebody help me? Thank for you help!

Translating... 0%