public override void OnBrowserCreated(CefBrowserWrapper wrapper) { base.OnBrowserCreated(wrapper); using (Process me = Process.GetCurrentProcess()){ PostMessage(HWND_BROADCAST, RegisterWindowMessage("TweetDuckSubProcess"), new UIntPtr((uint)me.Id), new IntPtr(wrapper.BrowserId)); } }
public override void OnBrowserCreated(CefBrowserWrapper browser) { browsers.Add(browser); if (parentBrowserId == null) { parentBrowserId = browser.BrowserId; } if (ParentProcessId == null || parentBrowserId == null) { return; } var browserId = browser.IsPopup ? parentBrowserId.Value : browser.BrowserId; var serviceName = RenderprocessClientFactory.GetServiceName(ParentProcessId.Value, browserId); var binding = BrowserProcessServiceHost.CreateBinding(); var channelFactory = new DuplexChannelFactory <IBrowserProcess>( this, binding, new EndpointAddress(serviceName) ); channelFactory.Open(); var browserProcess = channelFactory.CreateChannel(); var clientChannel = ((IClientChannel)browserProcess); try { clientChannel.Open(); if (!browser.IsPopup) { browserProcess.Connect(); } var javascriptObject = browserProcess.GetRegisteredJavascriptObjects(); if (javascriptObject.MemberObjects.Count > 0) { browser.JavascriptRootObject = javascriptObject; } browser.ChannelFactory = channelFactory; browser.BrowserProcess = browserProcess; } catch (Exception) { } }
public override void OnBrowserCreated(CefBrowserWrapper browser) { browsers.Add(browser); if (parentBrowserId == null) { parentBrowserId = browser.BrowserId; } if (ParentProcessId == null || parentBrowserId == null) { return; } var browserId = browser.IsPopup ? parentBrowserId.Value : browser.BrowserId; var serviceName = RenderprocessClientFactory.GetServiceName(ParentProcessId.Value, browserId); var binding = BrowserProcessServiceHost.CreateBinding(); var channelFactory = new DuplexChannelFactory<IBrowserProcess>( this, binding, new EndpointAddress(serviceName) ); channelFactory.Open(); var browserProcess = channelFactory.CreateChannel(); var clientChannel = ((IClientChannel)browserProcess); try { clientChannel.Open(); if (!browser.IsPopup) { browserProcess.Connect(); } var javascriptObject = browserProcess.GetRegisteredJavascriptObjects(); if (javascriptObject.MemberObjects.Count > 0) { browser.JavascriptRootObject = javascriptObject; } browser.ChannelFactory = channelFactory; browser.BrowserProcess = browserProcess; } catch(Exception) { } }
public override void OnBrowserDestroyed(CefBrowserWrapper browser) { var channelFactory = browser.ChannelFactory; if (channelFactory.State == CommunicationState.Opened) { channelFactory.Close(); } var clientChannel = ((IClientChannel)browser.BrowserProcess); if (clientChannel.State == CommunicationState.Opened) { clientChannel.Close(); } browser.ChannelFactory = null; browser.BrowserProcess = null; }
public override void OnBrowserCreated(CefBrowserWrapper browser) { browsers.Add(browser); if (parentBrowserId == null) { parentBrowserId = browser.BrowserId; } if (parentProcessId == null || parentBrowserId == null) { return; } var browserId = browser.IsPopup ? parentBrowserId.Value : browser.BrowserId; var serviceName = RenderprocessClientFactory.GetServiceName(parentProcessId.Value, browserId); var binding = BrowserProcessServiceHost.CreateBinding(); var channelFactory = new ChannelFactory<IBrowserProcess>( binding, new EndpointAddress(serviceName) ); channelFactory.Open(); var browserProcess = channelFactory.CreateChannel(); var clientChannel = ((IClientChannel)browserProcess); try { clientChannel.Open(); browser.ChannelFactory = channelFactory; browser.BrowserProcess = browserProcess; } catch(Exception) { } }
public override void OnBrowserCreated(CefBrowserWrapper browser) { browsers.Add(browser); if (parentBrowserId == null) { parentBrowserId = browser.BrowserId; } if (ParentProcessId == null || parentBrowserId == null) { return; } var browserId = browser.IsPopup ? parentBrowserId.Value : browser.BrowserId; var serviceName = RenderprocessClientFactory.GetServiceName(ParentProcessId.Value, browserId); var binding = BrowserProcessServiceHost.CreateBinding(); var channelFactory = new ChannelFactory <IBrowserProcess>( binding, new EndpointAddress(serviceName) ); channelFactory.Open(); var browserProcess = channelFactory.CreateChannel(); var clientChannel = ((IClientChannel)browserProcess); try { clientChannel.Open(); browser.ChannelFactory = channelFactory; browser.BrowserProcess = browserProcess; } catch (Exception) { } }
public override void OnBrowserDestroyed(CefBrowserWrapper cefBrowserWrapper) { }
public override void OnBrowserCreated(CefBrowserWrapper cefBrowserWrapper) { }