Today is the third day of Diduary. You can see links to all of the published articles in the series here.
Often, I find myself needing to test my websites in multiple browsers. I would hope that all of you understand by now that pages like this one are no longer acceptable anymore. (If you don’t launch the link, utah.gov is a little behind the times. Netscape? Really?)
The way I generally do this is to press F5 to run my application, and wait for it to launch in Internet Explorer. Once this is done, I copy the address from IE, and paste it into Chrome, Firefox, etc. This works well for most cases. Sometimes, however, I just want to launch the ONE browser, without the overhead of all of them. Perhaps I am focusing on one small CSS anomaly, for example.
You’ve always been able to right-click on a web page in Visual Studio and choose “View in browser,” (which you can also do with Ctrl + Shift + W), but you may have never opened the “Browse With…” item right below it.
Here’s what the “Browse with…” dialog looks like:
If you haven’t used this dialog before, it allows you to launch your page using any application you choose. I had to manually add Firefox, Safari, and Chrome. Technically, you could add Microsoft Word, I suppose, if that’s the application you want to browse your site with. You’ll notice in my example, however, that I have Firefox as my default browser. This is different than the “default browser” for your operating system. This applies only to the Visual Studio environment. It does set an alternative browser as your default, though, which means that F5 will now launch my pages in Firefox instead of Internet Explorer. (You should still be testing your applications in all relevant browsers. The point of this article was to let you use your favorite by default, not encourage you to ignore the alternatives.)
I’d like to see this feature expanded, so that I can see the page in ALL browsers when I click F5. Certainly not something I want enabled ALL the time, but there are certainly times where it would be helpful.
Leave a Reply