您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Downloads .vsix package on VS Code Marketplace
- // ==UserScript==
- // @name VS Code Extension Downloader
- // @namespace https://github.com/yookibooki/userscripts
- // @version 1.0
- // @description Downloads .vsix package on VS Code Marketplace
- // @match https://marketplace.visualstudio.com/items*
- // ==/UserScript==
- (function() {
- 'use strict';
- const url = new URL(window.location.href);
- const itemName = url.searchParams.get("itemName");
- if (!itemName) return;
- const [publisher, extensionName] = itemName.split(".");
- if (!publisher || !extensionName) return;
- const observer = new MutationObserver(() => {
- const versionCell = document.querySelector("table.ux-table-metadata td[aria-labelledby='Version'], table.ux-table-metadata td[aria-labelledby='version']");
- if (versionCell && !versionCell.querySelector('.vsix-download-link')) {
- const version = versionCell.textContent.trim();
- const link = document.createElement("a");
- link.href = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${extensionName}/${version}/vspackage/`;
- link.textContent = version;
- link.className = "vsix-download-link";
- link.title = "Download .vsix package";
- versionCell.textContent = '';
- versionCell.appendChild(link);
- }
- });
- observer.observe(document, { childList: true, subtree: true });
- })();