Filters
The Filters tab specifies transforms to URLs before sending them on the rules engine. The rules engine then matches on the transformed URL and launches a browser.
When opening a link, Linklever starts at the top of the filter list. It moves down and selects the first matching filter. If there are multiple matches, it selects the first match. If there is no match, then the raw URL is passed along to the rules engine.
For example, if a filter exists with pattern .*teams\.cdn\.office\.net.*url=([^&]+).*
and template unescape($1)
, then Linklever won't launch the URL statics.teams.cdn.office.net/evergreen-assets/safelinks/1/atp-safelinks.html?url=https%3A%2F%2Fexample.com
. Instead it will launch https://example.com
.
Anatomy of a Filter
Each filter consists of a name, a pattern, and a template.
Name
The name can be any text. It will appear in notifications, so it's best to keep it short.
Pattern
Patterns are regular expressions. For help creating patterns, follow our Pattern Guide.
Template
A template selects and transforms text from the raw URL.
In the above example, the template unescape($1)
extracts the text https%3A%2F%2Fexample.com
and URL unescapes it to https://example.com
. Here, $1
refers to the first capture group, i.e. everything matched in the first parenthesis ( ... )
, which is in this case everything after url=
. The macro unescape
converts URL-escaped strings like https%3A%2F%2Fexample.com
to normal URLs like https://example.com
.
Filter operations
Add
To add a filter, fill in the fields at the bottom of the app, and click the add button.
The example below, the pattern (.*)[&?]utm_source=[^&]+.*
and template $1
remove the utm_source
tracking parameter. For example, https://example.com?product=123&utm_source=google
becomes https://example.com?product=123
Delete
To delete a filter, select it, and click the delete button.
Promote
To promote a filter (move it up the list), select it, and click the promote button.
It is not possible to promote the catch-all filter.
Demote
To demote a filter (move it down the list), select it, and click the demote button.
Saving
Changes are saved immediately on edit; there is no save button.