fix(desktop): allow Obsidian deep links in openExternal - #84593
Open
thefreenickmurray wants to merge 1 commit into
Open
fix(desktop): allow Obsidian deep links in openExternal#84593thefreenickmurray wants to merge 1 commit into
thefreenickmurray wants to merge 1 commit into
Conversation
Chat markdown links like obsidian://open?vault=…&file=… were rejected with "Invalid external URL" because openExternalUrl only allowed http/https/mailto. Extract an explicit shell-open scheme allowlist and add obsidian: so vault deep links launch the local Obsidian app when registered with the OS. Dangerous schemes stay denied.
Collaborator
Related: #75457 proposes a broader local-file and Obsidian response-link policy. This PR is the narrow shell.openExternal allowlist path only; maintainers should choose or consolidate the policy before merging. |
Contributor
fix(desktop): allow Obsidian deep links in openExternal
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
obsidian://…markdown links with Invalid external URL becauseopenExternalUrlonly allowedhttp:/https:/mailto:.apps/desktop/electron/external-url.ts) and addobsidian:so vault deep links (e.g.obsidian://open?vault=…&file=…) launch the local Obsidian app when the OS has the protocol handler registered.javascript:,data:,file:via this path, IDE schemes not requested, etc.) remain denied.file:still goes through the existingshell.openPathpath-hardening branch.Test plan
cd apps/desktop && npx vitest run electron/external-url.test.ts --project electron(5 tests pass)[note](obsidian://open?vault=<vault-id>&file=Path%2FNote.md)with Obsidian installed → opens the notehttps://example.com→ still opens in the browserjavascript:alert(1)/ bare unlisted custom scheme → still rejected (no OS handoff)