VSCode Extensions Download

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

  1. // ==UserScript==
  2. // @name VSCode Extensions Download
  3. // @namespace https://marketplace.visualstudio.com
  4. // @version 1.0.0
  5. // @description VSCode应用市场移除了.vsix插件各个版本的下载链接,这个脚本可以帮你加回插件各个版本的下载链接
  6. // @author qaulau
  7. // @match *://marketplace.visualstudio.com/items?itemName=*
  8. // @icon https://marketplace.visualstudio.com/favicon.ico
  9. // @require https://code.bdstatic.com/npm/jquery@3.5.0/dist/jquery.min.js
  10. // @grant GM_addStyle
  11. // @tag vscode
  12. // @license AGPL-3.0-or-later
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17. var $ = window.jQuery;
  18. var timerId = setInterval(function(){
  19. if($('table.version-history-table').length == 0){
  20. return ;
  21. }
  22. GM_addStyle('.version-history-top-container .version-history-container-column {width: 20%;}');
  23. clearInterval(timerId);
  24. let data = JSON.parse($('.jiContent').text());
  25. let baseUrl = 'https://marketplace.visualstudio.com/_apis/public/gallery/publishers/' + data.Resources.PublisherName + '/vsextensions/' + data.Resources.ExtensionName + '/';
  26. // 添加下载行
  27. $('thead.version-history-table-thead > tr').append('<th class="version-history-container-column"></th><th class="version-history-container-column"></th>');
  28. // 遍历添加下载链接
  29. $('tbody.version-history-table-body > tr').each(function(i, e){
  30. let version = $.trim($(e).find('td').first().text());
  31. let url = baseUrl + version + '/vspackage';
  32. $(e).append('<td class="version-history-container-column"></td><td class="version-history-container-column"><a href="'+url+'">Download</a></td>');
  33. });
  34. }, 100);
  35. })();