public PluginControl(PluginManager pluginManager, Plugin plugin) : this() { this.pluginManager = pluginManager; this.plugin = plugin; this.isConfigurable = pluginManager.IsPluginConfigurable(plugin); float dpiScale = this.GetDPIScale(); if (dpiScale > 1F) { Size = MaximumSize = new Size(MaximumSize.Width, MaximumSize.Height + 3); } this.labelName.Text = plugin.Name; this.labelDescription.Text = plugin.CanRun ? plugin.Description : $"This plugin requires TweetDuck {plugin.RequiredVersion} or newer."; this.labelAuthor.Text = string.IsNullOrWhiteSpace(plugin.Author) ? string.Empty : $"by {plugin.Author}"; this.labelWebsite.Text = plugin.Website; this.labelVersion.Text = plugin.Version; this.labelType.LineHeight = BrowserUtils.Scale(11, dpiScale); UpdatePluginState(); if (labelDescription.Text.Length == 0) { labelDescription.Visible = false; } panelDescription_Resize(panelDescription, EventArgs.Empty); }
public void BeginSilentDownload() { if (DownloadStatus == UpdateDownloadStatus.None || DownloadStatus == UpdateDownloadStatus.Failed) { DownloadStatus = UpdateDownloadStatus.InProgress; try{ Directory.CreateDirectory(installerFolder); }catch (Exception e) { DownloadError = e; DownloadStatus = UpdateDownloadStatus.Failed; return; } if (string.IsNullOrEmpty(downloadUrl)) { DownloadError = new UriFormatException("Could not determine URL of the update installer"); DownloadStatus = UpdateDownloadStatus.Failed; return; } currentDownload = BrowserUtils.DownloadFileAsync(downloadUrl, InstallerPath, () => { DownloadStatus = UpdateDownloadStatus.Done; currentDownload = null; }, e => { DownloadError = e; DownloadStatus = UpdateDownloadStatus.Failed; currentDownload = null; }); } }
private static int OpenBlazorDocs() { var browser = BrowserUtils.OpenUrl("https://bionicframework.github.io/Documentation/live-reload/"); browser?.WaitForExit(); return(browser?.ExitCode ?? 1); }
public Task <UpdateInfo> Check() { TaskCompletionSource <UpdateInfo> result = new TaskCompletionSource <UpdateInfo>(); WebClient client = BrowserUtils.CreateWebClient(); client.Headers[HttpRequestHeader.Accept] = "application/vnd.github.v3+json"; client.DownloadStringTaskAsync(ApiLatestRelease).ContinueWith(task => { if (task.IsCanceled) { result.SetCanceled(); } else if (task.IsFaulted) { result.SetException(ExpandWebException(task.Exception.InnerException)); } else { try{ result.SetResult(ParseFromJson(task.Result)); }catch (Exception e) { result.SetException(e); } } }); return(result.Task); }
private void process_Exited(object sender, EventArgs e) { int exitCode = currentProcess.ExitCode; currentProcess.Dispose(); currentProcess = null; currentPipe.Dispose(); currentPipe = null; switch (exitCode) { case 3: // CODE_LAUNCH_FAIL if (FormMessage.Error("Video Playback Error", "Error launching video player, this may be caused by missing Windows Media Player. Do you want to open the video in your browser?", FormMessage.Yes, FormMessage.No)) { BrowserUtils.OpenExternalBrowser(lastUrl); } break; case 4: // CODE_MEDIA_ERROR if (FormMessage.Error("Video Playback Error", "The video could not be loaded, most likely due to unknown format. Do you want to open the video in your browser?", FormMessage.Yes, FormMessage.No)) { BrowserUtils.OpenExternalBrowser(lastUrl); } break; } owner.InvokeAsyncSafe(TriggerProcessExitEventUnsafe); }
private FormGuide(string url, Form owner) { InitializeComponent(); Text = Program.BrandName + " Guide"; Size = new Size(owner.Size.Width * 3 / 4, owner.Size.Height * 3 / 4); VisibleChanged += (sender, args) => this.MoveToCenter(owner); browser = new ChromiumWebBrowser(url) { KeyboardHandler = new CustomKeyboardHandler(null) }; browser.BrowserSettings.BackgroundColor = (uint)BackColor.ToArgb(); var browserComponent = new CefBrowserComponent(browser); var browserImpl = new BaseBrowser(browserComponent); BrowserUtils.SetupDockOnLoad(browserComponent, browser); Controls.Add(browser); Disposed += (sender, args) => { browserImpl.Dispose(); browser.Dispose(); }; }
public FormNotificationScreenshotable(Action callback, FormBrowser owner, PluginManager pluginManager, string html, int width) : base(owner, false) { this.plugins = pluginManager; int realWidth = BrowserUtils.Scale(width, DpiScale); browser.RegisterJsBridge("$TD_NotificationScreenshot", new ScreenshotBridge(this, SetScreenshotHeight, callback)); browser.LoadingStateChanged += (sender, args) => { if (args.IsLoading) { return; } string script = Program.Resources.LoadSilent("screenshot.js"); if (script == null) { this.InvokeAsyncSafe(callback); return; } using IFrame frame = args.Browser.MainFrame; CefScriptExecutor.RunScript(frame, script.Replace("{width}", realWidth.ToString()).Replace("{frames}", TweetScreenshotManager.WaitFrames.ToString()), "gen:screenshot"); }; SetNotificationSize(realWidth, 1024); LoadTweet(new DesktopNotification(string.Empty, string.Empty, string.Empty, html, 0, string.Empty, string.Empty)); }
private static int OpenBlazorDocs() { var browser = BrowserUtils.OpenUrl("https://blazor.net"); browser?.WaitForExit(); return(browser?.ExitCode ?? 1); }
bool IJsDialogHandler.OnJSDialog(IWebBrowser browserControl, IBrowser browser, string originUrl, CefJsDialogType dialogType, string messageText, string defaultPromptText, IJsDialogCallback callback, ref bool suppressMessage) { browserControl.AsControl().InvokeSafe(() => { FormMessage form; TextBox input = null; if (dialogType == CefJsDialogType.Alert) { form = CreateMessageForm("Browser Message", messageText); form.AddButton(FormMessage.OK, ControlType.Accept | ControlType.Focused); } else if (dialogType == CefJsDialogType.Confirm) { form = CreateMessageForm("Browser Confirmation", messageText); form.AddButton(FormMessage.No, DialogResult.No, ControlType.Cancel); form.AddButton(FormMessage.Yes, ControlType.Focused); } else if (dialogType == CefJsDialogType.Prompt) { form = CreateMessageForm("Browser Prompt", messageText); form.AddButton(FormMessage.Cancel, DialogResult.Cancel, ControlType.Cancel); form.AddButton(FormMessage.OK, ControlType.Accept | ControlType.Focused); float dpiScale = form.GetDPIScale(); int inputPad = form.HasIcon ? 43 : 0; input = new TextBox { Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom, Font = SystemFonts.MessageBoxFont, Location = new Point(BrowserUtils.Scale(22 + inputPad, dpiScale), form.ActionPanelY - BrowserUtils.Scale(46, dpiScale)), Size = new Size(form.ClientSize.Width - BrowserUtils.Scale(44 + inputPad, dpiScale), BrowserUtils.Scale(23, dpiScale)) }; form.Controls.Add(input); form.ActiveControl = input; form.Height += input.Size.Height + input.Margin.Vertical; } else { callback.Continue(false); return; } bool success = form.ShowDialog() == DialogResult.OK; if (input == null) { callback.Continue(success); } else { callback.Continue(success, input.Text); input.Dispose(); } form.Dispose(); }); return(true); }
private void labelWebsite_Click(object sender, EventArgs e) { if (labelWebsite.Text.Length > 0) { BrowserUtils.OpenExternalBrowser(labelWebsite.Text); } }
private void webClient_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e) { this.InvokeSafe(() => { if (e.Cancelled) { if (UpdateStatus == Status.Waiting) { UpdateStatus = Status.Cancelled; } } else if (e.Error != null) { Program.Reporter.Log(e.Error.ToString()); if (MessageBox.Show("Could not download the update: " + e.Error.Message + "\r\n\r\nDo you want to open the website and try downloading the update manually?", "Update Has Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { BrowserUtils.OpenExternalBrowserUnsafe(Program.Website); UpdateStatus = Status.Manual; } else { UpdateStatus = Status.Failed; } } else { UpdateStatus = Status.Succeeded; } Close(); }); }
/// <summary> /// Authenticate the sessionToken to retrieve F1TV authorization /// </summary> /// <param name="sessionToken">Session token provided by the AuthenticateResponse</param> /// <param name="identityProvider">IdentityProvider (defaults to normal provider)</param> /// <returns></returns> public async Task <AuthenticationToken> AuthenticateF1TVTokenAsync(string sessionToken, string identityProvider = default) { #if DEBUG _logger.LogTrace("Creating new page for F1TV token authentication"); #endif IPage page = await BrowserUtils.NewPageAsync(_browser, _random) .ConfigureAwait(false); #if DEBUG _logger.LogTrace("Created new page for F1TV token authentication"); #endif AuthenticationToken response; try { response = await AuthenticateF1TVTokenAsync(page, sessionToken, identityProvider) .ConfigureAwait(false); } finally { #if DEBUG _logger.LogTrace("Closing single-use page after authentication"); #endif await page.CloseAsync() .ConfigureAwait(false); #if DEBUG _logger.LogTrace("Closed single-use page after authentication"); #endif } return(response); }
private void browser_FrameLoadStart(object sender, FrameLoadStartEventArgs e) { if (e.Frame.IsMain && BrowserUtils.IsTwitterWebsite(e.Frame)) { ScriptLoader.ExecuteFile(e.Frame, "twitter.js"); } }
public void TestIsValidUrl() { Assert.IsTrue(BrowserUtils.IsValidUrl("http://google.com")); // base Assert.IsTrue(BrowserUtils.IsValidUrl("http://www.google.com")); // www. Assert.IsTrue(BrowserUtils.IsValidUrl("http://google.co.uk")); // co.uk Assert.IsTrue(BrowserUtils.IsValidUrl("https://google.com")); // https Assert.IsTrue(BrowserUtils.IsValidUrl("ftp://google.com")); // ftp Assert.IsTrue(BrowserUtils.IsValidUrl("mailto:[email protected]")); // mailto Assert.IsTrue(BrowserUtils.IsValidUrl("http://google.com/")); // trailing slash Assert.IsTrue(BrowserUtils.IsValidUrl("http://google.com/?")); // trailing question mark Assert.IsTrue(BrowserUtils.IsValidUrl("http://google.com/?a=5&b=x")); // parameters Assert.IsTrue(BrowserUtils.IsValidUrl("http://google.com/#hash")); // parameters + hash Assert.IsTrue(BrowserUtils.IsValidUrl("http://google.com/?a=5&b=x#hash")); // parameters + hash foreach (string tld in new string[] { "accountants", "blackfriday", "cancerresearch", "coffee", "cool", "foo", "travelersinsurance" }) { Assert.IsTrue(BrowserUtils.IsValidUrl("http://test." + tld)); // long and unusual TLDs } Assert.IsFalse(BrowserUtils.IsValidUrl("explorer")); // file Assert.IsFalse(BrowserUtils.IsValidUrl("explorer.exe")); // file Assert.IsFalse(BrowserUtils.IsValidUrl("://explorer.exe")); // file-sorta Assert.IsFalse(BrowserUtils.IsValidUrl("file://explorer.exe")); // file-proper Assert.IsFalse(BrowserUtils.IsValidUrl("")); // empty Assert.IsFalse(BrowserUtils.IsValidUrl("lol")); // random Assert.IsFalse(BrowserUtils.IsValidUrl("gopher://nobody.cares")); // lmao rekt }
/// <summary> /// Authenticate against the F1 login page. /// </summary> /// <param name="login">Username/Email to authenticate with</param> /// <param name="password">Password to authenticate with</param> /// <param name="cancellationToken">Possible cancellation request token</param> /// <returns>Authentication response values</returns> /// <exception cref="AuthenticationException">Authentication failure exception</exception> public async Task <AuthenticationResponse> AuthenticateAsync(string login, string password, CancellationToken cancellationToken = default) { #if DEBUG _logger.LogTrace("Creating new page for authentication"); #endif IPage page = await BrowserUtils.NewPageAsync(_browser, _random); #if DEBUG _logger.LogDebug("Created new page for authentication"); #endif AuthenticationResponse response; try { response = await AuthenticateAsync(page, login, password, cancellationToken) .ConfigureAwait(false); } finally { #if DEBUG _logger.LogTrace("Closing single-use page after authentication"); #endif await page.CloseAsync() .ConfigureAwait(false); #if DEBUG _logger.LogDebug("Closed single-use page after authentication"); #endif } return(response); }
private void browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e) { if (e.Frame.IsMain && BrowserUtils.IsTweetDeckWebsite(e.Frame)) { ScriptLoader.ExecuteFile(e.Frame, "update.js"); Check(false); } }
public virtual bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags) { switch ((int)commandId) { case MenuOpenLinkUrl: BrowserUtils.OpenExternalBrowser(parameters.LinkUrl); break; case MenuCopyLinkUrl: SetClipboardText(string.IsNullOrEmpty(TweetDeckBridge.LastRightClickedLink) ? parameters.UnfilteredLinkUrl : TweetDeckBridge.LastRightClickedLink); break; case MenuOpenImage: BrowserUtils.OpenExternalBrowser(parameters.SourceUrl); break; case MenuSaveImage: string fileName = GetImageFileName(parameters.SourceUrl); string extension = Path.GetExtension(fileName); string saveTarget; using (SaveFileDialog dialog = new SaveFileDialog { AutoUpgradeEnabled = true, OverwritePrompt = true, Title = "Save image", FileName = fileName, Filter = "Image (" + (string.IsNullOrEmpty(extension) ? "unknown" : extension) + ")|*.*" }){ saveTarget = dialog.ShowDialog() == DialogResult.OK ? dialog.FileName : null; } if (saveTarget != null) { BrowserUtils.DownloadFileAsync(parameters.SourceUrl, saveTarget, null, ex => { MessageBox.Show("An error occurred while downloading the image: " + ex.Message, Program.BrandName + " Has Failed :(", MessageBoxButtons.OK, MessageBoxIcon.Error); }); } break; case MenuCopyImageUrl: SetClipboardText(parameters.SourceUrl); break; case MenuCopyUsername: Match match = RegexTwitterAccount.Match(parameters.UnfilteredLinkUrl); SetClipboardText(match.Success ? match.Groups[1].Value : parameters.UnfilteredLinkUrl); break; #if DEBUG case MenuOpenDevTools: browserControl.ShowDevTools(); break; #endif } return(false); }
public void TestConvertPascalCaseToScreamingSnakeCase() { Assert.AreEqual("HELP", BrowserUtils.ConvertPascalCaseToScreamingSnakeCase("Help")); Assert.AreEqual("HELP_ME", BrowserUtils.ConvertPascalCaseToScreamingSnakeCase("HelpMe")); Assert.AreEqual("HELP_ME_PLEASE", BrowserUtils.ConvertPascalCaseToScreamingSnakeCase("HelpMePlease")); Assert.AreEqual("HTML_CODE", BrowserUtils.ConvertPascalCaseToScreamingSnakeCase("HTMLCode")); Assert.AreEqual("CHECK_OUT_MY_HTML_CODE", BrowserUtils.ConvertPascalCaseToScreamingSnakeCase("CheckOutMyHTMLCode")); }
private void updateBridge_UpdateAccepted(object sender, UpdateInfo update) { FormManager.CloseAllDialogs(); if (!string.IsNullOrEmpty(Config.DismissedUpdate)) { Config.DismissedUpdate = null; Config.Save(); } void OnFinished() { UpdateDownloadStatus status = update.DownloadStatus; if (status == UpdateDownloadStatus.Done) { UpdateInstallerPath = update.InstallerPath; ForceClose(); } else if (status != UpdateDownloadStatus.Canceled && FormMessage.Error("Update Has Failed", "Could not automatically download the update: " + (update.DownloadError?.Message ?? "unknown error") + "\n\nWould you like to open the website and try downloading the update manually?", FormMessage.Yes, FormMessage.No)) { BrowserUtils.OpenExternalBrowser(Program.Website); ForceClose(); } else { Show(); } } if (update.DownloadStatus.IsFinished(true)) { OnFinished(); } else { FormUpdateDownload downloadForm = new FormUpdateDownload(update); downloadForm.VisibleChanged += (sender2, args2) => { downloadForm.MoveToCenter(this); Hide(); }; downloadForm.FormClosed += (sender2, args2) => { if (downloadForm.DialogResult != DialogResult.OK) { update.CancelDownload(); } downloadForm.Dispose(); OnFinished(); }; downloadForm.Show(); } }
public override bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags) { if (base.OnContextMenuCommand(browserControl, browser, frame, parameters, commandId, eventFlags)) { return(true); } switch ((int)commandId) { case (int)CefMenuCommand.Reload: frame.ExecuteJavaScriptAsync("window.location.href = 'https://tweetdeck.twitter.com'"); return(true); case MenuSettings: form.InvokeSafe(form.OpenSettings); return(true); case MenuAbout: form.InvokeSafe(form.OpenAbout); return(true); case MenuPlugins: form.InvokeSafe(form.OpenPlugins); return(true); case MenuMute: form.InvokeSafe(() => { Program.UserConfig.MuteNotifications = !Program.UserConfig.MuteNotifications; Program.UserConfig.Save(); }); return(true); case MenuOpenTweetUrl: BrowserUtils.OpenExternalBrowser(lastHighlightedTweet); return(true); case MenuCopyTweetUrl: SetClipboardText(lastHighlightedTweet); return(true); case MenuScreenshotTweet: form.InvokeSafe(form.TriggerTweetScreenshot); return(true); case MenuOpenQuotedTweetUrl: BrowserUtils.OpenExternalBrowser(lastHighlightedQuotedTweet); return(true); case MenuCopyQuotedTweetUrl: SetClipboardText(lastHighlightedQuotedTweet); return(true); } return(false); }
public ApproveAProductCommentTest() { browser = new BrowserUtils(); driverPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); WebDriver = browser.SetupChromeDriver(driverPath); basePage = new BasePage(WebDriver); mainPage = new MainPage(WebDriver); productPage = new ProductPage(WebDriver); productDetailsPage = new ProductDetailsPage(WebDriver); }
public void TestGetFileNameFromUrl() { Assert.AreEqual("index.html", BrowserUtils.GetFileNameFromUrl("http://test.com/index.html")); Assert.AreEqual("index.html", BrowserUtils.GetFileNameFromUrl("http://test.com/index.html?")); Assert.AreEqual("index.html", BrowserUtils.GetFileNameFromUrl("http://test.com/index.html?param1=abc¶m2=false")); Assert.AreEqual("index", BrowserUtils.GetFileNameFromUrl("http://test.com/index")); Assert.AreEqual("index.", BrowserUtils.GetFileNameFromUrl("http://test.com/index.")); Assert.IsNull(BrowserUtils.GetFileNameFromUrl("http://test.com/")); }
private void panelDescription_Resize(object sender, EventArgs e) { if (labelDescription.Text.Length == 0) { Height = MinimumSize.Height; } else { labelDescription.MaximumSize = new Size(panelDescription.Width - SystemInformation.VerticalScrollBarWidth, 0); Height = Math.Min(MinimumSize.Height + BrowserUtils.Scale(9, dpiScale) + labelDescription.Height, MaximumSize.Height); } }
public override bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags) { if (base.OnContextMenuCommand(browserControl, browser, frame, parameters, commandId, eventFlags)) { return(true); } switch ((int)commandId) { case (int)CefMenuCommand.Reload: form.InvokeAsyncSafe(form.ReloadToTweetDeck); return(true); case MenuSettings: form.InvokeAsyncSafe(form.OpenSettings); return(true); case MenuAbout: form.InvokeAsyncSafe(form.OpenAbout); return(true); case MenuPlugins: form.InvokeAsyncSafe(form.OpenPlugins); return(true); case MenuMute: form.InvokeAsyncSafe(ToggleMuteNotifications); return(true); case MenuOpenTweetUrl: BrowserUtils.OpenExternalBrowser(lastHighlightedTweet); return(true); case MenuCopyTweetUrl: SetClipboardText(lastHighlightedTweet); return(true); case MenuScreenshotTweet: form.InvokeAsyncSafe(form.TriggerTweetScreenshot); return(true); case MenuOpenQuotedTweetUrl: BrowserUtils.OpenExternalBrowser(lastHighlightedQuotedTweet); return(true); case MenuCopyQuotedTweetUrl: SetClipboardText(lastHighlightedQuotedTweet); return(true); } return(false); }
public void MssSetupLocalBrowserFromZip(int ssBrowserRevision, byte[] ssZip) { RevisionInfo revision = BrowserUtils.RevisionInfo(ssBrowserRevision); /* * Avoid two concurrent requests setting up the browser at the same time, * which could cause clashes in the filesystem and file corruption. */ lock (browserSetupLock) { BrowserUtils.ExtractRevision(revision, ssZip); } }
public async Task <Uri> GetAuthenticationCodeAsync(Uri authorizationUri, Uri redirectUri, CancellationToken ct) { if (!redirectUri.IsLoopback) { throw new ArgumentException("Only localhost is supported as a redirect URI.", nameof(redirectUri)); } Task <Uri> interceptTask = InterceptRequestsAsync(redirectUri, ct); BrowserUtils.OpenDefaultBrowser(_environment, authorizationUri); return(await interceptTask); }
public void MssSetupLocalBrowser(int ssBrowserRevision) { RevisionInfo revision = BrowserUtils.RevisionInfo(ssBrowserRevision); /* * Avoid two concurrent requests setting up the browser at the same time, * which could cause clashes in the filesystem and file corruption. */ lock (browserSetupLock) { RunAsync(() => BrowserUtils.DownloadRevision(revision)); } }
private void browser_FrameLoadStart(object sender, FrameLoadStartEventArgs e) { if (e.Frame.IsMain) { if (Config.ZoomLevel != 100) { BrowserUtils.SetZoomLevel(browser.GetBrowser(), Config.ZoomLevel); } if (BrowserUtils.IsTwitterWebsite(e.Frame)) { ScriptLoader.ExecuteFile(e.Frame, "twitter.js"); } } }
public static bool HandleLinkClick(IWebBrowser browserControl, WindowOpenDisposition targetDisposition, string targetUrl) { switch (targetDisposition) { case WindowOpenDisposition.NewBackgroundTab: case WindowOpenDisposition.NewForegroundTab: case WindowOpenDisposition.NewPopup when !IsPopupAllowed(targetUrl): case WindowOpenDisposition.NewWindow: browserControl.AsControl().InvokeAsyncSafe(() => BrowserUtils.OpenExternalBrowser(targetUrl)); return(true); default: return(false); } }
public void Launch(ResourceCache resourceCache, PluginManager pluginManager) { string storagePath = App.StoragePath; BrowserCache.RefreshTimer(); CefSharpSettings.WcfEnabled = false; CefSharpSettings.SubprocessExitIfParentProcessClosed = false; CefSettings settings = new CefSettings { UserAgent = BrowserUtils.UserAgentChrome, BrowserSubprocessPath = Path.Combine(App.ProgramPath, BrandName + ".Browser.exe"), CachePath = storagePath, UserDataPath = Path.Combine(storagePath, CefDataFolder), LogFile = Path.Combine(storagePath, ConsoleLogFile), #if !DEBUG LogSeverity = Arguments.HasFlag(Arguments.ArgLogging) ? LogSeverity.Info : LogSeverity.Disable #endif }; CefSchemeHandlerFactory.Register(settings, new TweetDuckSchemeHandler(resourceCache)); CefSchemeHandlerFactory.Register(settings, new PluginSchemeHandler(resourceCache, pluginManager)); CefUtils.ParseCommandLineArguments(Config.User.CustomCefArgs).ToDictionary(settings.CefCommandLineArgs); BrowserUtils.SetupCefArgs(settings.CefCommandLineArgs); Cef.Initialize(settings, false, new BrowserProcessHandler()); Win.Application.ApplicationExit += (sender, args) => ExitCleanup(); var updateCheckClient = new UpdateCheckClient(Path.Combine(storagePath, InstallerFolder)); var mainForm = new FormBrowser(resourceCache, pluginManager, updateCheckClient, lockManager.WindowRestoreMessage); Win.Application.Run(mainForm); if (mainForm.UpdateInstaller != null) { ExitCleanup(); if (mainForm.UpdateInstaller.Launch()) { Win.Application.Exit(); } else { RestartWithArgsInternal(Arguments.GetCurrentClean()); } } }