Last active
July 3, 2022 19:49
-
-
Save gerwitz/e9bd2730b03977879893a3eb7bfa9c9f to your computer and use it in GitHub Desktop.
Configuration file for Finicky: https://github.com/johnste/finicky
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
defaultBrowser: "Safari", | |
handlers: [ | |
{ | |
// Open Teams in Teams | |
match: /^https?:\/\/teams\.microsoft\.com\/l\/meetup\-join\/.*$/, | |
browser: "Microsoft Teams" | |
}, | |
{ | |
// Use Edge for Miro | |
match: /^https?:\/\/miro\.com\/.*$/, | |
browser: "Microsoft Edge" | |
}, | |
{ | |
// Keep links from work apps on Edge | |
match: ({opener}) => | |
["Microsoft Teams", "Microsoft Outlook"].includes(opener.name), | |
browser: "Microsoft Edge" | |
}, | |
{ | |
// Keep Philips GitHub on Edge | |
match: ({url}) => | |
url.host.includes("github.com") && url.pathname.includes("philips"), | |
browser: "Microsoft Edge" | |
} | |
], | |
rewrite: [{ | |
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 = ["fbclid", "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("&"), | |
}; | |
}, | |
}], | |
options: { | |
urlShorteners: (list) => [...list, "eur01.safelinks.protection.outlook.com", "mandrillapp.miro.com"] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment