Im using CefSharp1 and implementing support for window.open in JS, so i implmentent
ILifeSpanHandler in my class like this:
#region Implementation of ILifeSpanHandler
public bool OnBeforePopup(IWebBrowser browser, string url, ref int x, ref int y, ref int width, ref int height)
{
if (url.StartsWith("chrome")) return false; Messenger.Default.Send(new ApplicationMessage { Action = ApplicationActions.ShowExtendedView, ActionParameter = url,Tag=browser});
return true;
}
public void OnBeforeClose(IWebBrowser browser)
{
throw new NotImplementedException();
}
#endregion
Then with the application message i handle it in another class with
var myNewForm = new Form();
myNewForm.Load += (s, e) =>
{
var view = browser as WebView;
myNewForm.Controls.Add(view);
view.Dock = DockStyle.Fill;
};
myNewForm.Show();
But it render the original view (i mean the parent view).
Im doing something wrong, i Know CefSharp 1 support it because if i dont use the handler it renders a new window with the new view. but i want to render the new window in my own form. Is that possible??