Support URL Scheme
I'd like to use URL Scheme to open with specific desktop app.
ex) Trello mac app / https://apps.apple.com/jp/app/trello/id1278508951?mt=12
Now I rewrote protocol but I got an error message on finicky.
rewrite: [
{
match: finicky.matchHostnames(["trello.com"]),
url: ({ url }) => ({
...url,
protocol: "trello"
})
}
],
Error Message
Configuration: Error: url: Value not one of string or {
"protocol": "https, http or file",
I suggest that the validation will be removed.
I was actually thinking of something similar. I want to open bookmarklets and javascript: protocol isn't recognized by the system open. Also I wonder if I can inject some AppleScript into this app to open a bookmarklet like so:
const bookmarklet_code="{query}"
const frontmost_app_name = Application('System Events').applicationProcesses.where({ frontmost: true }).name()[0]
const frontmost_app = Application(frontmost_app_name)
frontmost_app.doJavaScript(bookmarklet_code, { in: frontmost_app.documents[0] })
@urapico I can make this happen for sure. I hope to get some time this weekend to work on some open issues.
@stevemoser Not sure this can be done. I don't think javascript: is an actual valid url protocol? (I could be mistaken).
As for AppleScript the alpha build for #49 is using it to control Chrome. Also I've seen requests for running AppleScript scripts so that's something I'm considering.
Edit: @stevemoser Would you mind opening another issue for the AppleScript question?
@urapico Published a new release that should fix this https://github.com/johnste/finicky/releases/tag/v2.2.3
It seems working fine. Thank you very much. 👍
@urapico Sorry for tagging you, but I'm trying to figure out how to set up Finicky for Trello. This issue was the only reference to Trello + Finicky that I could find 😄 Does the way you set it up still work and if so, could you share how you set up your configuration file?
My configuration file:
module.exports = {
defaultBrowser: "Safari",
rewrite: [
{
match: finicky.matchHostnames(["trello.com"]),
url: ({ url }) => ({
...url,
protocol: "trello"
})
}
],
handlers: [
{
match: ["trello.com/*"],
browser: "Trello"
}
]
}
Thanks a lot!