API: Support protocol handlers #46256
Labels
api-proposal
feature-request
Request for new features or functionality
on-testplan
plan-item
VS Code - planned item for upcoming
Milestone
From #45685
Problem
There is no current way for extension to react on URLs being open with the
vscode:
scheme. Allowing extensions to do so can enable many different scenarios. A specific one is to provide Clone URLs in Github/TFS which would simply invoke VS Code to clone a URL, using its git extension.Security Concerns
Allowing extensions to handle a URL doesn't seem to open any additional security concerns, since it's already possible to run arbitrary code by having a user click a URL while taking advantage of the
*
activation event.There is no added API for this to happen, since we can leverage commands to handle URLs and the
contributes
manifest field to expose a URL handler.An example URL format would be:
Proposal
I suggest to keep it simple and allow a single URL handler per extension:
The
handleURLCommand
would be invoked with a single instance ofvscode.Uri
as a single argument:The text was updated successfully, but these errors were encountered: