finicky icon indicating copy to clipboard operation
finicky copied to clipboard

Support URL Scheme

Open urapico opened this issue 7 years ago • 5 comments

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.

urapico avatar Nov 14 '19 01:11 urapico

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] })

stevemoser avatar Nov 14 '19 01:11 stevemoser

@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?

johnste avatar Nov 14 '19 09:11 johnste

@urapico Published a new release that should fix this https://github.com/johnste/finicky/releases/tag/v2.2.3

johnste avatar Nov 18 '19 21:11 johnste

It seems working fine. Thank you very much. 👍

urapico avatar Nov 20 '19 09:11 urapico

@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!

ralphjsmit avatar Aug 30 '23 14:08 ralphjsmit