Let extensions hook into url opening
See original GitHub issueOverview
Let extensions hook into url opening. Motivating use case: I click on a link in the integrated terminal and it opens in my browser preview extension
Potential places to handle links:
- Links in the terminal
- Links in documents
- Links from the remote port forwarding views
- Debugger launch?
- Open external?
Additional requirements
-
A url opener should be able to decline opening a link
Some openers may only support specific types of links, such as
localhost
-
Clicking a link should activate relevant extensions
We’d need a new activation event so that extensions can make sure they handle link opening
-
Let users fallback to VS Code’s default behavior
This typically is to open using the default browser
-
Handle multiple url openers being registered at the same time
Users should be able to select which opener to use in this case. They should potentially be able to specify a default opener.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Chrome extension post-install hook/API function: does it exist?
You can do this using a background page. When the extension is installed, the background page is opened in the background, and thus...
Read more >Working with URLs in extensions - Azure DevOps
Learn about best practices for working with URLs in Azure DevOps extensions and integrations.
Read more >Chrome Extensions Message passing
How to pass messages between extensions and content scripts.
Read more >Creating a Chrome Extension with React - In Plain English
The content script is a piece of JavaScript which runs in a tab with a specific URL. The URL pattern is defined in...
Read more >Lambda Extensions API - AWS Documentation
In the Shutdown phase, Lambda shuts down the runtime, alerts the extensions to let them stop cleanly, and then removes the environment.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jrieken @alexdima Here’s the current version of the API based on our discussion earlier:
Main changes:
Renamed to
ExternalUriOpener
to make it clear the opener only applies to uris that VS Code itself does not handleThe provider now registers for a specific set of schemes
The
openExternalUri
method now returns a command. If there are multiple openers, we show the command title in a quick pick so that the user can select which opener to useThanks @JacksonKearl! I’ve adopted the same logic for our url patterns. Now you can use globs for the setting:
or
Other changes to the API:
Added the concept of a ‘priority’ for openers
After talking with Kai, it sounds like we do want the simple browser to be used by default in codespaces. To support this, I added ability to say that an opener is preferred and should be used by default.