Exemplo n.º 1
0
        public IpcService(BrowserHostService hostService)
        {
            _hostService = hostService;

            StartIpcServer();
            OnDisconnected().RunAsync();
        }
Exemplo n.º 2
0
        /// <summary>
        ///   This process will be instantiated by the browser.
        /// </summary>
        /// <param name="args"></param>
        private static async Task Main(string[] args)
        {
            if (args.Length < 1)
            {
                PrintUsage();
                return;
            }

            string ext;

            if (args[0].StartsWith("chrome-extension://", StringComparison.InvariantCultureIgnoreCase))
            {
                ext = args[0];
            }

            else if (args.Length >= 2 && args[1].Length == 38 &&
                     args[1].StartsWith("{", StringComparison.InvariantCultureIgnoreCase) &&
                     args[1].EndsWith("}", StringComparison.InvariantCultureIgnoreCase))
            {
                ext = args[1];
            }

            else
            {
                PrintUsage();
                return;
            }

            SetupLogger(ext);

            var nativeMessaging = new BrowserHostService(ext);

            await nativeMessaging.Run();

            _sentry.Dispose();
            _logger.Shutdown();
        }