• This repository has been archived on 09/Jun/2023
  • Stars
    star
    225
  • Rank 177,187 (Top 4 %)
  • Language
    C#
  • License
    MIT License
  • Created about 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Small utility to launch a different browser depending on the domain of the url being launched.

NOTE: This software is not being actively developed or maintained. Some fork (such as slater1/BrowseRouter may be more up-to-date).

Browser Selector Build status

Small utility to launch a different browser depending on the domain of the url being launched.

Read the blog post about this here.

Setting Up

  1. Grab the latest release and extract to a folder somewhere on your PC.
  2. Open the BrowserSelector.ini file and customise paths to your browsers and domain patterns (see below).
  3. Run BrowserSelector.exe --register from this folder to register the tool in Windows as a web browser.
  4. Open the "Choose a default browser" screen in Windows (you can simply search for "default browser" from the start screen).
  5. Select BrowserSelector as the default browser.

So far, it has been tested on the following:

  • Windows 8.1
  • Windows 10 Pro

Usage

BrowserSelector.exe --register
    Register as web browser

BrowserSelector.exe --unregister
    Unregister as web browser

BrowserSelector.exe --create
    Creates a default/sample settings file

BrowserSelector.exe "http://example.org/"
    Launch example.org

BrowserSelector.exe [--wait] "http://example.org/"
    Launch example.org, optionally waiting for the browser to close..

BrowserSelector.exe "http://example.org/" "http://example.com/" [...]
    Launches multiple urls

BrowserSelector.exe "my bookmark file.url"
    Launches the URL specified in the .url file.

BrowserSelector.exe "my bookmark file.webloc"
    Launches the URL specified in the .webloc (osx) file.

If you use the --wait flag with multiple urls/files each will open one after the other, in order. Each waits for the previous to close before opening. Using the --wait flag is tricky, though, since many (most) browsers open new urls as a new tab in an existing instance.

To open multiple urls at the same time and wait for them, try the following:

BrowserSelector.exe "url-or-file" "url-or-file" --wait "url-or-file"

Config

Config is a poor mans INI file:

; Default browser is first in list
; Use `{url}` to specify UWP app browser details
[browsers]
chrome = C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
ff = C:\Program Files (x86)\Mozilla Firefox\firefox.exe
edge = microsoft-edge:{url}
ie = iexplore.exe
chrome_prof8 = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 8"

; Url preferences.
; Only * is treated as a special character (wildcard).
; Matches are domain-only. Protocols and paths are ignored.
; Use "*.blah.com" for subdomains, not "*blah.com" as that would also match "abcblah.com".
[urls]
microsoft.com = ie
*.microsoft.com = ie

; Use my project-based Chrome profile
myproject.live = chrome_prof8
myproject.local = chrome_prof8

; if the key is wrapped in /'s, it is treated as a regex.
/sites\.google\.com/a/myproject.live\.com/ = chrome_prof8

google.com = chrome
visualstudio.com = edge

Browsers

chrome = C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
chrome_prof8 = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 8"
  • Browser exes must be exact paths to the browser executable.
  • Arguments are optional. However, if you provide arguments the exe must be enclosed in quotes.
  • If there are no arguments, then the exe paths do not need to be quoted.

Special cases:

edge = microsoft-edge:{url}
  • For special browsers, you can include the {url} flag. This allows better control over the browser command-line arguments.
  • This is required when specifying UWP app's such as Microsoft Edge.
  • By default, the url is used as an argument when launching the exe. If the {url} flag is specified, it will not be added to the arguments. (In other words, it won't be added twice..)

Urls

There are two ways to specify an Url. You can use simple wildcards or full regular expressions.

Simple wildcards:

microsoft.com = ie
*.microsoft.com = ie
  • Only * is treated as a special character in URL patterns, and matches any characters (equivalent to the .* regex syntax).
  • Only the domain part (or IP address) of a URL is checked.
  • There is no implied wildcard at the start or end, so you must include these if you need them, but be aware that "microsoft.*" will not only match "microsoft.com" and "microsoft.co.uk" but also "microsoft.somethingelse.com".

Full regular expressions:

	/sites\.google\.com/a/myproject.live\.com/ = chrome_prof8
  • Full regular expressions are specified by wrapping it in /'s.
  • The domain and path are used in the Url comparison.
  • The regular expression syntax is based on the Microsoft .NET implementation.

More Repositories

1

dart-native-executables

An example Dart project compiled to Windows, Linux, macOS native executables with GitHub Actions
Dart
47
star
2

tiler

Library for rendering maps created with the Tiled map editor in Dart/Flutter.
Dart
44
star
3

github-codespaces-flutter-web

Dart
34
star
4

DaChip8

A simple CHIP-8 interpreter written in C# (rendering with WinForms).
C#
34
star
5

TestAdapters

Test Adapters and Frameworks for Visual Studio
JavaScript
28
star
6

codespaces-flutter-web

A sample Flutter web project for use on VS Online.
Dart
20
star
7

gitpod-flutter-web

A sample Flutter project for use on GitPod.
Dart
13
star
8

DaNES

Danny's attempt to make a NES emulator in C#.
C#
10
star
9

DaChip8JS

My simple C# CHIP-8 interpreter compiling into JS/HTML5 Canvas using Bridge.NET
C#
8
star
10

bridge-pong

HTML5 Pong in C#/Bridge.NET
C#
7
star
11

streamdeck.dart

A library for creating StreamDeck plugins in Dart.
Dart
7
star
12

gh-actions

GitHub actions
TypeScript
5
star
13

GPlus-Notifier

G+ Notifier is a Windows utility that sits in the notification area and alerts you to notifications in the Google+ social network.
C#
3
star
14

MarkdownHelper

HTML helpers to allow easier rendering of Markdown in an ASP.NET MVC web app.
C#
3
star
15

tiler-test-maps

Test maps and expected screenshots for the Dart/Flutter Tiler package
2
star
16

vscode-repro-nodebug-lost

TypeScript
2
star
17

tab_route_test

Dart
2
star
18

karma-xml-reporter

A Karma plugin. Report results in DanTup's xml format.
JavaScript
2
star
19

actions_test

1
star
20

vscode-repro-73090

Repro for https://github.com/Microsoft/vscode/issues/73090
TypeScript
1
star
21

gitpod-dart

A sample Dart project for use on GitPod.
Dart
1
star
22

Stuff

Random stuff
Jupyter Notebook
1
star
23

PwnAdventure3

Some code and scripts for proxying/injecting the (made-for-exploiting) PwnAdventure3 game.
Dart
1
star
24

SimpleSlackBot

Simple bot library for Slack.
C#
1
star
25

vscode-repro-68503

Repro for https://github.com/Microsoft/vscode/issues/68503
TypeScript
1
star
26

pi_build_status

A simple script to show project build statuses on my Pi's Unicorn Hat HD.
Dart
1
star
27

speedtest_docker

Docker image to run speedtest_cli
Dockerfile
1
star
28

Google-Wave-Notifier

Google Wave Notifier sits in the notification area of your Windows PC and notifies you of unread messages in your Google Wave account with a balloon notification.
C#
1
star