Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Adding URI Query to the string matched against a regex pattern. #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DanTup.BrowserSelector/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static void LaunchBrowser(string url, bool waitForClose = false)
if (urlPattern.StartsWith("/") && urlPattern.EndsWith("/"))
{
// The domain from the INI file is a regex..
domain = uri.Authority + uri.AbsolutePath;
domain = uri.Authority + uri.PathAndQuery;
pattern = urlPattern.Substring(1, urlPattern.Length - 2);
}
else
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
> NOTE: This software is not being actively developed or maintained.
> NOTE: This is a clone of [DanTup/BrowserSelector](https://github.com/DanTup/BrowserSelector) enhanced by comparing the full URI (including query part) against a regex pattern.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would you PR that?


# Browser Selector [![Build status](https://ci.appveyor.com/api/projects/status/github/DanTup/BrowserSelector?svg=true)](https://ci.appveyor.com/project/DanTup/browserselector)
# Browser Selector [![Build status](https://ci.appveyor.com/api/projects/status/github/pstodulka/BrowserSelector?svg=true)](https://ci.appveyor.com/project/pstodulka/browserselector)

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

> **[Read the blog post about this here](http://blog.dantup.com/2015/09/simple-windows-browser-selector/)**.

## Setting Up

1. Grab the [latest release](https://github.com/DanTup/BrowserSelector/releases) and extract to a folder somewhere on your PC.
1. Grab the [latest release](https://github.com/pstodulka/BrowserSelector/releases) 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).
Expand Down Expand Up @@ -121,5 +121,5 @@ There are two ways to specify an Url. You can use simple wildcards or full regul
```

- Full regular expressions are specified by wrapping it in /'s.
- The domain _and_ path are used in the Url comparison.
- The domain _and_ path _and_ query are used in the Url comparison.
- The regular expression syntax is based on the Microsoft .NET implementation.