VSCode Extensions Download

VSCode应用市场移除了.vsix插件各个版本的下载链接,这个脚本可以帮你加回插件各个版本的下载链接

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         VSCode Extensions Download
// @namespace    https://marketplace.visualstudio.com
// @version      1.0.0
// @description  VSCode应用市场移除了.vsix插件各个版本的下载链接,这个脚本可以帮你加回插件各个版本的下载链接
// @author       qaulau
// @match        *://marketplace.visualstudio.com/items?itemName=*
// @icon         https://marketplace.visualstudio.com/favicon.ico
// @require      https://code.bdstatic.com/npm/[email protected]/dist/jquery.min.js
// @grant        GM_addStyle
// @tag          vscode
// @license      AGPL-3.0-or-later
// ==/UserScript==

(function() {
    'use strict';
    var $ = window.jQuery;
    var timerId = setInterval(function(){
        if($('table.version-history-table').length == 0){
            return ;
        }
        GM_addStyle('.version-history-top-container .version-history-container-column {width: 20%;}');
        clearInterval(timerId);
        let data = JSON.parse($('.jiContent').text());
        let baseUrl = 'https://marketplace.visualstudio.com/_apis/public/gallery/publishers/' + data.Resources.PublisherName + '/vsextensions/' + data.Resources.ExtensionName + '/';
        // 添加下载行
        $('thead.version-history-table-thead > tr').append('<th class="version-history-container-column"></th><th class="version-history-container-column"></th>');
        // 遍历添加下载链接
        $('tbody.version-history-table-body > tr').each(function(i, e){
            let version = $.trim($(e).find('td').first().text());
            let url = baseUrl + version + '/vspackage';
            $(e).append('<td class="version-history-container-column"></td><td class="version-history-container-column"><a href="'+url+'">Download</a></td>');
        });
    }, 100);
})();