Routing Rules
Conditions reference
Match links by Link address or Link clicked, and combine conditions with Any, All, or None.
A condition is the test BrowserFairy runs on each link to decide whether a rule applies. This page covers every condition you can build: the two things you can test, the operators each one offers, and how to combine several tests into one rule.
Every rule reads as a sentence in the editor: Open link with a browser when a group of conditions is true. You build that group from rows. Each row has a left popup that picks what to test (Link address or Link clicked), an operator popup, and a value. To add or remove a row, use the small minus and plus buttons at the end of it.
What you can test
There are exactly two things BrowserFairy can look at:
- Link address is the full link text, the whole address including the
https://part, the site, the path, and anything after it. - Link clicked is the app you clicked the link in, such as Mail, Slack, or Notes.
There is no separate field for just the site or just the domain. Every Link address test runs against the entire link, which is why a rule that matches a whole site usually starts with begins with https://.
Match by Link address
Pick Link address in the left popup, then choose one of five operators and type a value to compare against. All five comparisons ignore capitalization, so Figma.com and figma.com are treated the same.
contains
The link matches if your value appears anywhere inside it. This is the most forgiving operator and the easiest to start with.
- Value
figma.commatcheshttps://www.figma.com/file/123,https://figma.com/, and any other link that mentionsfigma.comanywhere.
When to reach for contains
Use contains when the part you care about can show up in the middle of a link, like a site that sometimes appears with www. and sometimes without it.
begins with
The link matches only if it starts with your value. Because the test runs on the whole link, you include the https:// part. This is the usual way to match a specific site, since it pins the match to the start of the address and will not be fooled by the site name appearing later in a path or tracking parameter.
- Value
https://mail.google.commatches your Gmail links but not a random link that merely mentionsmail.google.comfurther along.
ends with
The link matches only if it finishes with your value. This is handy for file types.
- Value
.pdfmatches any link that ends in.pdf.
is
The link matches only if it is exactly your value, start to finish, with nothing extra. This is the strictest operator. It compares the entire link, not just the site, so it is best for one specific address you want to route on its own.
- Value
https://example.com/matches that exact address and nothing else.
is not
The reverse of is. The link matches every link except the exact value you type. You will rarely need this on its own, but it is useful inside a larger group when you want to carve out one exception.
Use the smallest reliable value
Prefer a short, stable value like the site name calendar.google.com over pasting a long link full of tracking parameters. Shorter values are easier to read and keep matching even when the rest of the link changes.
Match by Link clicked
Pick Link clicked in the left popup to test which app the link came from instead of what the link says. This is perfect for rules like "every link I click in Slack should open in one place", no matter where those links point.
Link clicked has a single operator, in, and one Select… button instead of a typed value. Click Select… to open an app picker, choose the app (for example Slack), and BrowserFairy remembers it. From then on, any link opened from that app matches the rule.
If you later move or remove the chosen app, the button shows App not found!. The rule keeps the app it was set to, so pick the app again with Select… to fix the warning.
Link clicked needs the right setup
Link clicked only sees the source app for links handed to BrowserFairy. For links you click while already inside a browser, you also need the browser extensions. For links from other apps like Mail, setting BrowserFairy as your default browser is enough.
Combine conditions
A rule can have more than one condition. The popup at the top of the condition group decides how they work together. It reads as Any, All, or None followed by "of the following are true".
- Any means the rule matches if at least one condition is true. This is an OR. Use it to gather several sites or addresses into a single rule.
- All means the rule matches only if every condition is true. This is an AND. Use it to narrow a match, such as a link that begins with one site and also contains a particular word.
- None means the rule matches only if none of the conditions are true. This is a NOT. Use it to match everything except a short list of exceptions.
The example below uses Any with two Link address conditions, so a link matches if it begins with either address:
You can also nest groups. Add a group inside a group to build something like "All of: begins with one site, and None of these two pages". Keep it as simple as the job allows, since most rules need only one or two conditions.
Where to go next
- For ready-made conditions you can copy, see rule recipes.
- To understand which rule wins when several could match, see how routing works.
- To learn the rest of the rule editor, see create rules.