Skip to content

Instantly share code, notes, and snippets.

@illola
Forked from wanglf/vscode-extension-offline.md
Last active January 26, 2025 17:30
Show Gist options
  • Select an option

  • Save illola/86c0a5d3f6a108521c9867344d7f9765 to your computer and use it in GitHub Desktop.

Select an option

Save illola/86c0a5d3f6a108521c9867344d7f9765 to your computer and use it in GitHub Desktop.
Download VS Code extensions as VSIX (UPD 2025)

How to use?

  • Copy content of vsix-bookmarklet, create a bookmark in your browser.
  • Navigate to the web page of the VS Code extension you want to install.
  • Click the bookmark you just created, then click the download button.
    download
  • After download finished, rename the file extension to *.vsix.
  • In VS Code, select Install from VSIX... in the extension context menu.
    vsc

How does it work?

microsoft/vscode-python#20184
https://stackoverflow.com/a/38866913/1032492
https://stackoverflow.com/questions/79359919

A VS Code extension's offline install package (VSIX) is available at:

https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${extension}/${version}/vspackage?targetPlatform=${platform}
OLD TYPE: https://${publisher}.gallery.vsassets.io/_apis/public/gallery/publisher/${publisher}/extension/${extension name}/${version}/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage

Take the syntax highlight extension for Vue.js as an example:

https://marketplace.visualstudio.com/items?itemName=liuji-jim.vue

  • The itemName query is a composition of publisher and extension name, separated with a dot.
  • The publisher is liuji-jim.
  • The extension is vue.
  • The latest version number is in More Info section on the right side.
  • The platform is hidden. You can check full list of platforms in bottom section. If *.vsix is download without @ symbol in name, than it does not have different platforms.

more

So the package can be downloaded via this URL:

https://marketplace.visualstudio.com/_apis/public/gallery/publishers/liuji-jim//vsextensions/vue/0.1.3/vspackage?targetPlatform=win32-x64
OLD type: https://liuji-jim.gallery.vsassets.io/_apis/public/gallery/publisher/liuji-jim/extension/vue/0.1.3/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage

Some words about targetPlatform

This example is for Windows x64-bit platform. If page not found, than you should delete platform query: ?targetPlatform=win32-x64.
The full list of platforms that extensions could have are: win32-x64, win32-arm64, linux-x64, linux-arm64, linux-armhf, alpine-x64, alpine-arm64, darwin-x64, darwin-arm64, web (c) @nervous-inhuman

Copyrights and thanks:

javascript:(function()%7Bconst%20URL_VSIX_PATTERN%20%3D%20'https%3A%2F%2Fmarketplace.visualstudio.com%2F_apis%2Fpublic%2Fgallery%2Fpublishers%2F%24%7Bpublisher%7D%2Fvsextensions%2F%24%7Bextension%7D%2F%24%7Bversion%7D%2Fvspackage%3FtargetPlatform%3Dwin32-x64'%3B%0A%0Alet%20itemName%20%3D%20new%20URL(window.location.href).searchParams.get('itemName')%3B%0Alet%20%5Bpublisher%2C%20extension%5D%20%3D%20itemName.split('.')%3B%0Alet%20version%20%3D%20document.querySelector('%23versionHistoryTab%20tbody%20tr%20.version-history-container-column').textContent%3B%0A%0Alet%20url%20%3D%20URL_VSIX_PATTERN.replace('%24%7Bpublisher%7D'%2C%20publisher)%0A%09%09%09%09%09%09%20%20.replace('%24%7Bextension%7D'%2C%20extension)%0A%09%09%09%09%09%09%20%20.replace('%24%7Bversion%7D'%2C%20version)%3B%0A%0Awindow.open(url%2C%20'_blank')%3B%7D)()%3B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment