Exemplo n.º 1
0
        private static void LoadBrowsers()
        {
            browsers = BrowserRegistrationManager.GetRegisteredBrowsers();

            //Edge quirk
            Browser edge = GetBrowserByName("Edge");

            if (edge != null)
            {
                edge.ExePath = "microsoft-edge:";
            }
        }
Exemplo n.º 2
0
 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();
         }
     }
 }
Exemplo n.º 3
0
 private void CheckIfDefault()
 {
     if (!BrowserRegistrationManager.IsAppSetAsDefault)
     {
         if (MessageBox.Show("BrowserSelector가 기본 웹 브라우저로 설정되어 있지 않습니다.\n기본 앱에서 기본 웹 브라우저로 설정하시겠습니까?",
                             Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             BrowserRegistrationManager.RegisterOrUnregisterAsAdmin(true);
             BrowserRegistrationManager.SetAsDefault();
         }
     }
 }
Exemplo n.º 4
0
        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);
                }
            }
        }
Exemplo n.º 5
0
 private void btnDefault_Click(object sender, EventArgs e)
 {
     BrowserRegistrationManager.SetAsDefault();
 }
Exemplo n.º 6
0
 private void btnUnregister_Click(object sender, EventArgs e)
 {
     BrowserRegistrationManager.RegisterOrUnregisterAsAdmin(false);
 }