Skip to content

Instantly share code, notes, and snippets.

@kerim
Created November 14, 2025 07:59
Show Gist options
  • Select an option

  • Save kerim/bed1c92a84b8d1f392f8335e2ea66ae0 to your computer and use it in GitHub Desktop.

Select an option

Save kerim/bed1c92a84b8d1f392f8335e2ea66ae0 to your computer and use it in GitHub Desktop.
Finicky handler for Logseq protocol URLs - redirects logseq:// links to test.logseq.com

Finicky Handler for Logseq Protocol URLs

This Finicky configuration redirects logseq:// protocol URLs to open in the web version of Logseq (test.logseq.com) in Chrome, instead of the desktop Logseq app.

URL Transformation

Input (from Logseq Sidekick extension):

logseq://graph/Chrome%20Import%202025-11-09?block-id=68fa4001-7af5-4c59-aa4d-8b9ca2602bc7

Output (opened in Chrome):

https://test.logseq.com/#/page/68fa4001-7af5-4c59-aa4d-8b9ca2602bc7

Finicky Configuration

Add this handler to your ~/.finicky.js config:

export default {
  defaultBrowser: "Brave Browser", // or your preferred browser
  handlers: [
    {
      // Handle logseq:// URLs - rewrite and open in Chrome
      match: ({ protocol }) => protocol === "logseq:",
      browser: "Google Chrome",
      url: ({ search }) => {
        // Extract block-id from search params
        const params = new URLSearchParams(search);
        const blockId = params.get("block-id");

        if (blockId) {
          return `https://test.logseq.com/#/page/${blockId}`;
        }

        return "https://test.logseq.com/";
      }
    }
  ]
};

Setup Instructions

1. Install Finicky

If you don't have Finicky installed:

brew install --cask finicky

2. Add Configuration

Add the handler above to your ~/.finicky.js file.

3. Set Finicky as the Handler for logseq:// URLs

Use duti to register Finicky as the default handler for the logseq:// protocol:

# Install duti if needed
brew install duti

# Set Finicky as the handler for logseq:// URLs
duti -s se.johnste.finicky logseq

4. Verify Registration

Check that Finicky is registered:

defaults read ~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure | grep -B 5 -A 5 "LSHandlerURLScheme = logseq"

You should see LSHandlerRoleAll = "se.johnste.finicky";

5. Restart Your Browser

Important: After registering Finicky as the handler, restart your browser (Brave, Chrome, Safari, etc.) for the changes to take effect.

6. Test

Test with this command:

open "logseq://graph/Chrome%20Import%202025-11-09?block-id=68fa4001-7af5-4c59-aa4d-8b9ca2602bc7"

This should open Chrome with: https://test.logseq.com/#/page/68fa4001-7af5-4c59-aa4d-8b9ca2602bc7

Troubleshooting

  • If links aren't working from your browser, restart the browser after setting up Finicky
  • Check Finicky logs in Console.app (Applications > Utilities > Console) and search for "Finicky"
  • Verify the handler is registered with the defaults read command above

How It Works

  1. The Logseq Sidekick extension generates logseq:// URLs when you click on search results
  2. macOS launches Finicky (the registered handler for logseq:// protocol)
  3. Finicky's handler extracts the block-id parameter from the URL
  4. Finicky transforms the URL to https://test.logseq.com/#/page/{block-id}
  5. Finicky opens the transformed URL in Chrome

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment