-
Notifications
You must be signed in to change notification settings - Fork 6
/
finicky.js
51 lines (49 loc) · 1.55 KB
/
finicky.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
module.exports = {
defaultBrowser: "Safari",
rewrite: [
{
// Redirect all urls to use https
match: ({ url }) => url.protocol === "http",
url: { protocol: "https" }
},
{
// Remove all marketing/tracking information from urls
// https://github.com/johnste/finicky/wiki/Configuration-ideas#remove-all-marketingtracking-information-from-urls
match: () => true, // Execute rewrite on all incoming urls to make this example easier to understand
url({ url }) {
const removeKeysStartingWith = ["utm_", "uta_"]; // Remove all query parameters beginning with these strings
const removeKeys = ["fblid", "gclid"]; // Remove all query parameters matching these keys
const search = url.search
.split("&")
.map((parameter) => parameter.split("="))
.filter(([key]) => !removeKeysStartingWith.some((startingWith) => key.startsWith(startingWith)))
.filter(([key]) => !removeKeys.some((removeKey) => key === removeKey));
return {
...url,
search: search.map((parameter) => parameter.join("=")).join("&"),
};
},
}
],
handlers: [
{
match: [
"meet.google.com/*",
"www.gov.uk/*" // to make the most of the GOVUK browser extension
],
browser: "Brave Browser"
},
{
match: "open.spotify.com/*",
browser: "Spotify"
},
{
match: [
"zoom.us/*",
finicky.matchDomains(/.*\zoom.us/),
/zoom.us\/j\//,
],
browser: "us.zoom.xos"
}
]
};