private void WebBrowserCore_RemoteBrowserCreated(object sender, RemoteBrowserCreatedEventArgs e) { formV8Handler = new FormV8Handler(this); #if XP CfrRuntime.RegisterExtension("chromefxui/form", ChromFXUI.XP.Properties.Resources.chromefxui_formExtension, formV8Handler); #else CfrRuntime.RegisterExtension("chromefxui/form", ChromFXUI.Properties.Resources.chromefxui_formExtension, formV8Handler); #endif }
public WebBrowserFormImplement(Form form, BrowserCore browser) { parentForm = form; browserCore = browser; browser.RemoteBrowserCreated += (_, e) => { formV8Handler = new FormV8Handler(parentForm); #if XP CfrRuntime.RegisterExtension("chromefxui/form", ChromFXUI.XP.Properties.Resources.chromefxui_formExtension, formV8Handler); #else CfrRuntime.RegisterExtension("chromefxui/form", ChromFXUI.Properties.Resources.chromefxui_formExtension, formV8Handler); #endif }; browser.LoadHandler.OnLoadEnd += (_, e) => { if (e.Frame.IsMain) { foreach (var script in delayedScripts) { browserCore.ExecuteJavascript(script.Value); } } }; form.Move += (_, e) => { if (browserCore != null && browserCore.BrowserHost != null) { browserCore.BrowserHost.NotifyMoveOrResizeStarted(); } }; RegisterActivatedStateChangedHandler(); RegisterSizeChangedEventHandler(); }