private void OnBrowserDisconnected() { LogTo.Debug("Browser disconnected"); if (PluginSvc == null) { return; } try { PluginSvc.Disconnect(_extensionId); } catch (RemotingException) { } }
private async Task ProcessMessage(BrowserMessage msg) { try { using (await _pluginSvcLock.LockAsync()) { if (PluginSvc == null) { await _host.Write(new RespError(MessageType.ImportTabs, "Plugin not connected")); return; } switch (msg.Type) { case MessageType.ImportTabs: PluginSvc.ImportUrls(msg.GetData <ReqImportUrls>()); break; case MessageType.ImportHtml: break; case MessageType.GetTabs: SetBrowserResp(msg); break; default: LogTo.Error($"Received unknown MessageType {msg.Type}"); break; } } } catch (ArgumentNullException ex) { LogTo.Error(ex, "Argument Null Exception caught in ProcessMessage"); } catch (RemotingException) { } }