private static void LoadBrowsers() { browsers = BrowserRegistrationManager.GetRegisteredBrowsers(); //Edge quirk Browser edge = GetBrowserByName("Edge"); if (edge != null) { edge.ExePath = "microsoft-edge:"; } }
private void CheckIfDefault() { if (!BrowserRegistrationManager.IsAppSetAsDefault) { if (MessageBox.Show("Browser Selector is not currently your default browser, would you like to set it as default?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { BrowserRegistrationManager.RegisterOrUnregisterAsAdmin(true); BrowserRegistrationManager.SetAsDefault(); } } }
private void CheckIfDefault() { if (!BrowserRegistrationManager.IsAppSetAsDefault) { if (MessageBox.Show("BrowserSelector가 기본 웹 브라우저로 설정되어 있지 않습니다.\n기본 앱에서 기본 웹 브라우저로 설정하시겠습니까?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { BrowserRegistrationManager.RegisterOrUnregisterAsAdmin(true); BrowserRegistrationManager.SetAsDefault(); } } }
static void HandleArgs(string[] args) { foreach (string arg in args) { if (string.Equals(arg, "--register", StringComparison.OrdinalIgnoreCase)) { BrowserRegistrationManager.RegisterBrowser(); } else if (string.Equals(arg, "--unregister", StringComparison.OrdinalIgnoreCase)) { BrowserRegistrationManager.UnregisterBrowser(); /*} else if (arg.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || arg.StartsWith("https://", StringComparison.OrdinalIgnoreCase) || arg.StartsWith("ftp://", StringComparison.OrdinalIgnoreCase)) { || BrowserManager.LaunchUrl(arg);*/ } else { BrowserManager.LaunchUrl(arg); } } }
private void btnDefault_Click(object sender, EventArgs e) { BrowserRegistrationManager.SetAsDefault(); }
private void btnUnregister_Click(object sender, EventArgs e) { BrowserRegistrationManager.RegisterOrUnregisterAsAdmin(false); }