Closed hapimp closed 1 year ago
In order to get that done you will want to specify that your match
expresses a predicate on both the opener
and the url
. I believe that would look something like this:
module.exports = {
defaultBrowser: "Google Chrome",
handlers: [
{
// Open youtube link clicked in Slack in Firefox
match: ({ url, opener }) =>
opener.bundleId === "com.tinyspeck.slackmacgap" && (url.host === "youtube.com" || url.host === "youtu.be"),
browser: "Firefox"
},
]
}
Thank you very much for pointing me in the right direction @thobe ! I was not able to make your code work, but I ended up finding another example in the wiki going with what you wrote. By modifying it a bit, everything now seems to work.
My code:
module.exports = {
defaultBrowser: "Google Chrome",
handlers: [
{
// Open youtube link clicked in Slack in Firefox
match: ({ opener, url }) =>
opener.bundleId === "com.tinyspeck.slackmacgap" && url.host.includes("youtube.com") || url.host.includes("youtu.be"),
browser: "Firefox"
}
]
}
I've managed to get Finicky to open all links I click in Slack in Firefox, but I only want it to happen with YouTube links and I don't understand the syntax well enough to do this. This is what I have now:
Any ideas to how I can do this?