From be5cc4ea50f51af53596d69c8da808fe9a49ff06 Mon Sep 17 00:00:00 2001 From: "Lockszmith (@VAST)" Date: Tue, 25 Feb 2025 09:36:10 -0500 Subject: [PATCH] macos: add .finicky.js configuration --- _home.macos/dot_finicky.js | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 _home.macos/dot_finicky.js diff --git a/_home.macos/dot_finicky.js b/_home.macos/dot_finicky.js new file mode 100644 index 0000000..c31e7e9 --- /dev/null +++ b/_home.macos/dot_finicky.js @@ -0,0 +1,50 @@ +// Use https://finicky-kickstart.now.sh to generate basic configuration +// Learn more about configuration options: https://github.com/johnste/finicky/wiki/Configuration + +module.exports = { + defaultBrowser: "Browserosaurus", + 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", "si"]; // 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: [ + finicky.matchDomains(/.*\.vastdata.com/) + ], + browser: "Google Chrome" + }, + { + match: [ + finicky.matchDomains(/127\.0\.0\.1/) + ], + browser: "DuckDuckGo" + }, + { + // Open these in Browserosaurus + match: [ + "github.com*", + "open.spotify.com*", + // YouTube + "youtube.com*", + "youtu.be*", + finicky.matchDomains(/.*\.youtube.com/) // use helper function to match on domain only + ], + browser: "Browserosaurus" + } + ] +}