question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow the OS to handle custom URIs. Cannot open links with custom URL schema (e.g. slack://)

See original GitHub issue

Does this issue occur when all extensions are disabled?: Yes/No Yes

  • VS Code Version: 1.60.1
  • OS Version: All

Steps to Reproduce:

  1. Obtain a custom URI. For Mac users an easy way to test a custom URI is with Hook from a file or email. Or you could create a bearbones app with a custom URI with a few lines of AppleScript. These types of links are common e.g. slack://, Zoom, OmniFocus, and several more so you should be able to find a URI that works. You can test these in your browser.
  2. Add the link to a markdown file open in VSCode
  3. Try to click it in the code editor and markdown preview. Observe the error.

Additional Info

Poking around I see vscode only handles a limited list. If a schema is unknown, VSCode must delegate to the OS to handle it. It also occurs to me that mailto doesn’t require special treatment on this list and should be handled by the OS.

https://github.com/microsoft/vscode/blob/021071ff74a53038dae299db2fe1328beed13da0/extensions/markdown-language-features/src/util/links.ts#L9-L16

This was reported before and fell through the cracks. The same console errors where VSCode attempts to resolve a markdown file with a filename that is a substring of the url it does not understand:

Testing custom scheme:
[p.ideas.test.md](hook://file/3NE0H471r?p=RGVuZHJvbi92YXVsdA==&n=p.ideas.test.md)
Unable to open '3NE0H471r.md': Unable to read file '/Users/brandon/Dendron/vault/hook:/file/3NE0H471r.md'
(Error: Unable to resolve non-existing file '/Users/brandon/Dendron/vault/hook:/file/3NE0H471r.md').

https://github.com/microsoft/vscode/issues/104429

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:16
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Stedagcommented, Nov 6, 2021

I did a PR to the Dendron Extension which provides a tidy workaround for this issue via dendron: Open link.

0reactions
AlexAtkinsoncommented, Nov 18, 2022

Whatever you’re doing with this, please just simply add ‘tel’ href links to the sanitization list as requested here: https://github.com/microsoft/vscode/issues/133365

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reference: Deep linking into Slack
Deep linking with slack:// Use the slack:// URI scheme to deep link into a user's native Slack client on the following operating systems:...
Read more >
Defining a custom URL scheme for your app - Apple Developer
Custom URL schemes provide a way to reference resources inside your app. Users tapping a custom URL in an email, for example, launch...
Read more >
Linking - React Native
Custom URL scheme isn't the only way to open your application on mobile. You don't want to use a custom URL scheme in...
Read more >
Slack URL to open a channel from browser - Stack Overflow
The OS will prompt you if it doesn't recognize the custom protocol handler, but if Slack has this enabled, then it wouldn't be...
Read more >
Configure Link Behaviors for Redirects and Link Domain
If you change settings in Custom link behavior, the values you set for ... allows you to control how and when Branch uses...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found