Esempio n. 1
0
        public WebDriverDownloader(Browser browser, int webDriverWaitTime = 200, LoginHandler loginHandler = null, Option option = null)
        {
            _webDriverWaitTime = webDriverWaitTime;
            _browser           = browser;
            _option            = option ?? new Option();
            Login = loginHandler;

            if (browser == Browser.Firefox && RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                Task.Factory.StartNew(() =>
                {
                    while (!_isDisposed)
                    {
                        IntPtr maindHwnd = WindowsFormUtils.FindWindow(null, "plugin-container.exe - 应用程序错误");
                        if (maindHwnd != IntPtr.Zero)
                        {
                            WindowsFormUtils.SendMessage(maindHwnd, WindowsFormUtils.WmClose, 0, 0);
                        }
                        Thread.Sleep(500);
                    }
                });
            }
        }
Esempio n. 2
0
 public WebDriverDownloader(Browser browser, LoginHandler loginHandler) : this(browser, 200, loginHandler, null)
 {
 }