How to change the default system browser?

Asked

Viewed 300 times

2

How do I change the default system browser? When opening a link, go to my browser with the link already open?

I’ve already made him recognize the links when launching the browser:

Public Overrides Sub OnLoad() Handles Me.Load
     If Not (Command = Nothing)
          If (Url.IsWellFormatedUriString(Command, UriKind.Absolute))
               WebBrowser1.Navigate(Command)
          End If
     End If
End Sub

Beauty, and now to open one link as default browser (my browser)?

  • The question of the title is different from the question of the body, what in fact you want to know?

  • I just want to know how I leave my browser that I made as the default system, the browser that opens the links automatically....

  • I think you didn’t do what you think you did, but okay, you do what you want. You want to write a code that makes the switch or just want to change it on Windows?

  • 1

    When you install Google Chrome it shows "Want to make your browser default", if you mark it stays as default browser, it has automatically changed in Windows, I want to know how it did this, in case a code that does this

1 answer

1


I’m just going to put out an alert. Are you going to trade a browser that thousands of extracompetent people have worked for years for something you’ve done? Make yourself at home.

The secret is to put the right information in the Windows registry to make "your browser" the system default.

I found a code that can help you in a response in the OS.

Registry.ClassesRoot.OpenSubKey(@".htm", true).SetValue("", "FirefoxHTML");
Registry.ClassesRoot.OpenSubKey(@".html", true).SetValue("", "FirefoxHTML");
Registry.ClassesRoot.OpenSubKey(@".shtml", true).SetValue("", "FirefoxHTML");
Registry.ClassesRoot.OpenSubKey(@".xht", true).SetValue("", "FirefoxHTML");
Registry.ClassesRoot.OpenSubKey(@".xhtml", true).SetValue("", "FirefoxHTML");
Registry.ClassesRoot.OpenSubKey(@"http\shell\open\command", true).SetValue("", "firefox.exe");
Registry.ClassesRoot.OpenSubKey(@"https\shell\open\command", true).SetValue("", "firefox.exe");
Registry.CurrentUser.OpenSubKey(@"Software\Classes\http\shell\open\command", true).SetValue("", "firefox.exe");
Registry.CurrentUser.OpenSubKey(@"Software\Classes\https\shell\open\command", true).SetValue("", "firefox.exe");
Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice", true).SetValue("progId", "FirefoxURL");
Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice", true).SetValue("progId", "FirefoxURL");
Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\Shell\Associations\UrlAssociations\ftp\UserChoice", true).SetValue("progId", "FirefoxURL");

I put in the Github for future reference.

Obviously in the example was used Firefox, you should switch to what is most suitable for "your browser".

Evidently the software already needs to be installed (at least copied). It may be that the installer allows you to do this in a simpler way. See the documentation for your installer.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.