So I had a friend teach me how to write my own browser…
Ok, ok, I didn’t technically write my own browser, that would take a lot of work, but what I did do is build a Browser Proxy. The Browser Proxy is the default Browser on my PC, and all it does, is validate if a key is pressed (“Left Shift” to be exact) and either launch IE or Chrome based on that key. This means for me now, “Click” is to open in IE and “Shift+Click” is to open in Chrome!
Here’s how I did it
First, you need AutoHotKey, which I’ve written about before. You can use it have an always-on scripting engine running to help you control Windows, or to create scripts and turn them in executable, which is what we’re going to do here. So get that installed on your PC.
Second, Choose your actual “Default Browser” in Windows. I made Internet Explorer default because people send me work related links in Lync, Email, and they are scattered all through documents and such, so it makes sense to make IE default for me. This means that without the SHIFT key down, IE will be used.
Third, we need to create what I call “Browser Proxy” executable, This is going to be a bit more complicated, to get you started, My friend and I have created the browser .ahk file (AutoHotKey script) and installer .reg file (think of this as associations for your application so Windows can find it). Download the package here, (virus scan it, because you should virus scan any weird .zip file you download from the Internet), and then unzip it. You’ll find 3 files, one of which is a readme and you can figure that out.
Crack open the BrowserProxy.ahk in Notepad or your favorite editor, it looks like this:
Validate the paths for both Internet Explorer and Chrome. Change the paths as appropriate. You can also chose to use a different key, like if you wanted the Left CONTROL button to be the key you use, change the “LShift” in bold above to “LControl”. In fact you can choose whatever key you want (here is the list).
; Shift Key up -- launch IE
Run,"C:\Program Files (x86)\Internet Explorer\iexplore.exe" -nohome "%1%"
; Shift Key down -- launch Chrome
Run,"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "%1%"
Once you’ve got the script validated, save it and then since you now have AutoHotKey installed, you right click on the script and choose Compile Script.
This produces a BrowserProxy.exe in the same directory. I copied this to "C:\Program Files (x86)\BrowserProxy\BrowserProxy.exe" (and agreed to the UAC prompt). You can put this anywhere, but more updates will be required in the .reg file which we’re going to use next.
Now we need to import the BrowserProxy.reg file into your system registry. Please do feel free to open it in Notepad before importing it (you should always be aware of what you’re putting into your registry), but it does 3 important things
- Define the BrowserProxy.exe application under the SOFTWARE section of the registry
- Registers that application
- Sets up the root classes that the application can handle
Now that your own “Browser” is ready, you need to make it default. This is how I did it on Windows 8.1
- Open the Desktop Control panel (Win+R, type “control”, and click OK)
- Click on Programs
- select under Default Programs click on Make a file type always open a specific program.
- In this dialog, we need to change the default to “Browser Proxy” for “.htm”, “.html”, “.shtml”, “.xht”, “.xhtml”, “FTP”, “HTTP” and “HTTPS”. Select the item in the list and click on Change program… then select BrowserProxy.exe
Note: Some applications may cache the default browser, in which case they would need to be restarted (My offender: Outlook). Now you can use two browsers easily without having to do the usual tricks of copying URLs between browser windows, or manually setting default browsers constantly.
Final note: If you are looking for a way to launch Firefox, try changing the launch EXE in the .ahk script to:
For Reference here is the contents of the .reg file:
; Shift Key down -- launch FireFox
Run,"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -requestPending -osint -url "%1%"
Windows Registry Editor Version 5.00
"ApplicationDescription"="Browser Proxy Application, enables you to switch between IE or Chrome simply by pressing SHIFT when you click"
@="C:\\Program Files (x86)\\BrowserProxy\\BrowserProxy.exe,0"
@="\"C:\\Program Files (x86)\\BrowserProxy\\BrowserProxy.exe\""
@="\"C:\\Program Files (x86)\\BrowserProxy\\BrowserProxy.exe\",0"
@="\"C:\\Program Files (x86)\\BrowserProxy\\BrowserProxy.exe\" \"%1\""