Comment on page
Integrate with Desktop Apps via Custom URL Schemes
Integrate with Desktop Apps via Custom URL Schemes
Operating systems allow applications to register a custom URL scheme (as opposed to, e.g.,
https://
). Applications (including the Web Browser) can use this to deep-link into and perform actions in other desktop applicationsSome popular productivity applications supporting URL schemes:
To use a custom URL scheme, you can use the
@pixiebrix/browser/open-tab
brick just like with a normal URLDepending on the application, you may need to specify a different encoding for spaces URL query parameters using the
spaceEncoding
. For most cases, the default %20
encoding is what's expected. But you may need to use +
in some cases.By disabling the confirmation, a malicious site could trick you into performing an action in a desktop application. That being said, most applications do not expose destructive actions via URL schemes for this reason
When you try to navigate to a link with a custom URL scheme, Chrome will prompt you to open the application:
.png?alt=media&token=0fff5a16-20e3-4df2-9c68-2e3246590cc9)
If you're trying to trigger a lot of actions, that can become tedious. Here are some steps for disabling the confirmation in Chrome.
- 2.In the prompt, enter the following with the URL scheme for the application you're using. For example, the Drafts URL scheme is
drafts://
, so we'd enter:defaults write com.google.Chrome URLAllowlist -array-add 'drafts://*' - 3.Restart Chrome
Last modified 28d ago