This script on Windows sets itself as a default browser and redirects the link protocol handlers HTTP, HTTPS, and FTP for opening links in different browsers with custom arguments.
- Are you a power user who uses multiple browsers?
- Do you want to keep browsing sessions separate for different websites?
- Do you want to control which websites open in which browser and in either a new tab or new window?
- Are you tired of manually copying and pasting links into the correct browser?
-
In the "
src
" directory, run "Install default browser redirector.bat
" as administrator. -
Start > Run (Win + R) >
ms-settings:defaultapps
.Start > Settings (Win + I) > Apps > Default apps.
-
Default browser redirector > Set default file types or link types for HTTP, HTTPS, and FTP > Set default.
The script and config file are installed to the "%AppData%\Default browser redirector
" directory.
The "browser_rules.json
" file contains the browsers and the rules in JSON format.
The first browser will be the default browser if no rules apply.
- Each browser provides a
path
to the executable. However, the "clipboard" property does not require it. - An optional
arguments
property can be a single string or an array of strings. - If the
clipboard
value istrue
, the URI is copied to the clipboard.
- The
rules
property is an array of strings or objects, containingtext
,regex
,arguments
, andclipboard
properties.
- The
regex
property can be a single string or an object, containingpattern
andflags
properties.
An example "browser_rules.json
" file is provided and must be edited with your custom values.
- Opera is the first browser, which is used as the default if no rules apply.
- Vivaldi opens for github.com, stackoverflow.com, twitch.tv, ups.com, and zillow.com.
- Google Chrome opens test.tld using the "Profile 12" profile.
- Mozilla Firefox opens firefox.com using the "default" profile and copies the URI to the clipboard.
- Thorium opens discord.com and Private.tld in a new incognito window and public.tld in a regular tab.
- Microsoft Edge has no rules and is ignored.
- For the "clipboard" property, clip.me is copied to the clipboard only instead of redirecting to a browser.