Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Mr-xzq/6f2d395533fc16b94de3e6504631217c to your computer and use it in GitHub Desktop.

Select an option

Save Mr-xzq/6f2d395533fc16b94de3e6504631217c to your computer and use it in GitHub Desktop.

Revisions

  1. @wanglf wanglf revised this gist Jan 31, 2018. 2 changed files with 1 addition and 16 deletions.
    2 changes: 1 addition & 1 deletion vsix-bookmarklet
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    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)}();
    javascript:!function(){(function(){for(var%20e={version:%22%22,publisher:%22%22,identifier:%22%22,getDownloadUrl:function(){return[%22https://%22,this.identifier.split(%22.%22)[0],%22.gallery.vsassets.io/_apis/public/gallery/publisher/%22,this.identifier.split(%22.%22)[0],%22/extension/%22,this.identifier.split(%22.%22)[1],%22/%22,this.version,%22/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage%22].join(%22%22)},getFileName:function(){return[this.identifier,%22_%22,this.version,%22.vsix%22].join(%22%22)},getDownloadButton:function(){var%20e=document.createElement(%22a%22);return%20e.innerHTML=%22Download%20VSIX%22,e.href=%22javascript:void(0);%22,e.style.fontFamily=%22wf_segoe-ui,Helvetica%20Neue,Helvetica,Arial,Verdana%22,e.style.display=%22inline-block%22,e.style.padding=%222px%205px%22,e.style.background=%22darkgreen%22,e.style.color=%22white%22,e.style.fontWeight=%22bold%22,e.style.margin=%222px%205px%22,e.setAttribute(%22data-url%22,this.getDownloadUrl()),e.setAttribute(%22data-filename%22,this.getFileName()),e.onclick=function(e){e.target.onclick=null,e.target.innerHTML=%22Downloading%20VSIX...%22;var%20t=new%20XMLHttpRequest;console.log(e.target.getAttribute(%22data-url%22)),t.open(%22GET%22,e.target.getAttribute(%22data-url%22),!0),t.responseType=%22blob%22,t.onprogress=function(t){if(t.lengthComputable){var%20r=t.loaded/t.total*100;e.target.innerHTML=%22Downloading%20VSIX...%22+r.toString()+%22%25%22}},t.onload=function(t){if(200==this.status){var%20r=this.response,n=document.createElement(%22a%22);n.href=window.URL.createObjectURL(r),n.download=e.target.getAttribute(%22data-filename%22),n.click(),e.target.href=n.href,e.target.download=n.download,e.target.innerHTML=%22Download%20VSIX%22}else%20e.target.innerHTML=%22Error.%20Please%20reload%20the%20page%20amd%20try%20again.%22,alert(%22Error%20%22+this.status+%22%20error%20receiving%20the%20document.%22)},t.onerror=function(t){e.target.innerHTML=%22Error.%20Please%20reload%20the%20page%20amd%20try%20again.%22,alert(%22Error%20%22+t.target.status+%22%20occurred%20while%20receiving%20the%20document.%20%22)},t.send()},e}},t={Version:%22version%22,Publisher:%22publisher%22,%22Unique%20Identifier%22:%22identifier%22},r=document.querySelectorAll(%22.ux-table-metadata%20tr%22),n=0;n%3Cr.length;n++){var%20i=r[n],a=i.querySelectorAll(%22td%22);if(2==a.length){var%20o=a[0].innerText.replace(/^\s+|\s+$/g,%22%22),l=a[1].innerText.replace(/^\s+|\s+$/g,%22%22);t.hasOwnProperty(o)%26%26(e[t[o]]=l)}}document.querySelector(%22.vscode-moreinformation%22).parentElement.appendChild(e.getDownloadButton()).scrollIntoView(),e})()}();
    15 changes: 0 additions & 15 deletions vsix.js
    Original file line number Diff line number Diff line change
    @@ -1,15 +0,0 @@
    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)
    }()
  2. @wanglf wanglf renamed this gist Jan 8, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @myst729 myst729 revised this gist Nov 4, 2016. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,9 @@
    # How to use?

    - Copy content of `vsix-bookmarklet`, create a bookmark in your browser.
    - Copy content of [`vsix-bookmarklet`](#file-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.
    - Click the bookmark you just created, then click the download button.
    <img width="150" alt="download" src="https://cloud.githubusercontent.com/assets/519733/19998297/0cfb1e8e-a2a7-11e6-9098-cf35ee2facfb.png">
    - After download finished, rename the file extension to `*.vsix`.
    - In VS Code, select **Install from VSIX...** in the extension context menu.
    <img width="643" alt="vsc" src="https://cloud.githubusercontent.com/assets/519733/19998077/9bbeb7b8-a2a5-11e6-8dc3-9b08ca740089.png">
  4. @myst729 myst729 revised this gist Nov 4, 2016. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,7 @@
    - 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.
    - After download finished, rename the file extension to `*.vsix`.
    - In VS Code, select **Install from VSIX...** in the extension context menu.

    - In VS Code, select **Install from VSIX...** in the extension context menu.
    <img width="643" alt="vsc" src="https://cloud.githubusercontent.com/assets/519733/19998077/9bbeb7b8-a2a5-11e6-8dc3-9b08ca740089.png">


    @@ -24,8 +23,7 @@ Take the syntax highlight extension for Vue.js as an example:
    - 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.

    - The latest version number is in _More Info_ section on the right side.
    <img width="253" alt="more" src="https://cloud.githubusercontent.com/assets/519733/19998076/9b825f7a-a2a5-11e6-92d0-5cad25fef73b.png">

    So the package can be downloaded via this URL:
  5. @myst729 myst729 revised this gist Nov 4, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,7 @@
    - Click the bookmark you just created, then click the download button.
    - After download finished, rename the file extension to `*.vsix`.
    - In VS Code, select **Install from VSIX...** in the extension context menu.

    <img width="643" alt="vsc" src="https://cloud.githubusercontent.com/assets/519733/19998077/9bbeb7b8-a2a5-11e6-8dc3-9b08ca740089.png">


    @@ -24,6 +25,7 @@ Take the syntax highlight extension for Vue.js as an example:
    - The publisher is **liuji-jim**.
    - The extension name is **vue**.
    - The latest version number is in _More Info_ section on the right side.

    <img width="253" alt="more" src="https://cloud.githubusercontent.com/assets/519733/19998076/9b825f7a-a2a5-11e6-92d0-5cad25fef73b.png">

    So the package can be downloaded via this URL:
  6. @myst729 myst729 revised this gist Nov 4, 2016. 1 changed file with 8 additions and 5 deletions.
    13 changes: 8 additions & 5 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,12 @@
    # 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.
    + After download finished, rename the file extension to `*.vsix`.
    + In VS Code, select **Install from VSIX...** in the extension context menu.
    - 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.
    - After download finished, rename the file extension to `*.vsix`.
    - In VS Code, select **Install from VSIX...** in the extension context menu.
    <img width="643" alt="vsc" src="https://cloud.githubusercontent.com/assets/519733/19998077/9bbeb7b8-a2a5-11e6-8dc3-9b08ca740089.png">


    # How does it work?

    @@ -22,6 +24,7 @@ Take the syntax highlight extension for Vue.js as an example:
    - The publisher is **liuji-jim**.
    - The extension name is **vue**.
    - The latest version number is in _More Info_ section on the right side.
    <img width="253" alt="more" src="https://cloud.githubusercontent.com/assets/519733/19998076/9b825f7a-a2a5-11e6-92d0-5cad25fef73b.png">

    So the package can be downloaded via this URL:

  7. @myst729 myst729 revised this gist Nov 4, 2016. 1 changed file with 10 additions and 12 deletions.
    22 changes: 10 additions & 12 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -11,20 +11,18 @@
    > 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
    ```

    > 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
    ```

    > 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.
    - The publisher is **liuji-jim**.
    - The extension name is **vue**.
    - The latest version number is in _More Info_ section on the right side.

    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
    ```

    > https://liuji-jim.gallery.vsassets.io/_apis/public/gallery/publisher/liuji-jim/extension/vue/0.1.3/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage
  8. @myst729 myst729 revised this gist Nov 4, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,7 @@ 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.
  9. @myst729 myst729 renamed this gist Nov 4, 2016. 1 changed file with 14 additions and 4 deletions.
    18 changes: 14 additions & 4 deletions README → README.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,18 @@
    An VS Code extension's offline install package (VSIX) is available at:
    # 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.
    + After download finished, rename the file extension to `*.vsix`.
    + In VS Code, select **Install from VSIX...** in the extension context menu.

    # 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
    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:
    @@ -15,5 +27,3 @@ 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
    ```

    After download, just rename the file extension to `*.vsix`. In VS Code, select **Install from VSIX...** in the extension context menu.
  10. @myst729 myst729 created this gist Nov 4, 2016.
    19 changes: 19 additions & 0 deletions README
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    An 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 publisher is `liuji-jim`.
    - The extension name is `vue`.
    - The latest version number is in **More Info** section on the right side.

    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
    ```

    After download, just rename the file extension to `*.vsix`. In VS Code, select **Install from VSIX...** in the extension context menu.
    1 change: 1 addition & 0 deletions vsix-bookmarklet
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    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)}();
    15 changes: 15 additions & 0 deletions vsix.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    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)
    }()