Skip to content

Instantly share code, notes, and snippets.

@klashxx
Last active December 12, 2019 10:47
Show Gist options
  • Save klashxx/30513ab042d8a0c555571204e54dd7a7 to your computer and use it in GitHub Desktop.
Save klashxx/30513ab042d8a0c555571204e54dd7a7 to your computer and use it in GitHub Desktop.
Download VS Code extensions as VSIX

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?

http://stackoverflow.com/a/38866913/1032492

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

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 name is vue.
  • The latest version number is in More Info section on the right side.
    more

So the package can be downloaded via this URL:

https://liuji-jim.gallery.vsassets.io/_apis/public/gallery/publisher/liuji-jim/extension/vue/0.1.3/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage

javascript:void function(){var e=document.querySelector('[data-bind$="version"]').innerText,t=window.location.href.replace(/.*itemName=(.*?)\.(.*)/,"$1"),i=window.location.href.replace(/.*itemName=(.*?)\.(.*)/,"$2"),o=document.createElement("a");o.innerText="Download VSIX",o.style.position="fixed",o.style.right="0",o.style.top="120px",o.style.padding="10px 15px",o.style.background="#007acc",o.style.color="#fff",o.href="https://"+t+".gallery.vsassets.io/_apis/public/gallery/publisher/"+t+"/extension/"+i+"/"+e+"/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage",document.body.appendChild(o)}();
void function() {
var ver = document.querySelector('[data-bind$="version"]').innerText
var pub = window.location.href.replace(/.*itemName=(.*?)\.(.*)/, '$1')
var name = window.location.href.replace(/.*itemName=(.*?)\.(.*)/, '$2')
var button = document.createElement('a')
button.innerText = 'Download VSIX'
button.style.position = 'fixed'
button.style.right = '0'
button.style.top = '120px'
button.style.padding = '10px 15px'
button.style.background = '#007acc'
button.style.color = '#fff'
button.href = 'https://' + pub + '.gallery.vsassets.io/_apis/public/gallery/publisher/' + pub + '/extension/' + name + '/' + ver + '/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage'
document.body.appendChild(button)
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment