您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Fixes "Open with Visual Studio" button on GitHub to open with VSCode instead of Visual Studio
当前为
- // ==UserScript==
- // @name Github - Open with VSCode
- // @namespace V@no
- // @description Fixes "Open with Visual Studio" button on GitHub to open with VSCode instead of Visual Studio
- // @match https://github.com/*
- // @version 23.10.21-004817
- // @license MIT
- // @run-at document-end
- // @grant none
- // ==/UserScript==
- (() =>
- {
- "use strict";
- const fixLink = () =>
- {
- const elLink = document.querySelector('[data-open-app="visual-studio"]');
- if (!elLink)
- return true;
- elLink.dataset.openApp = "vscode"; // display "Launching Visual Studio Code..." message
- elLink.innerHTML += " Code";
- const cloneURL = (document.querySelector(".input-group > .form-control") || {}).value;
- if (cloneURL)
- elLink.href = "vscode://vscode.git/clone?url=" + encodeURI(cloneURL);
- else
- elLink.href = elLink.href.replace("git-client://", "vscode://vscode.git/");
- //we don't need keep observing DOM changes
- observer.disconnect();
- };
- const observer = new MutationObserver(fixLink);
- if (fixLink())
- observer.observe(document, {childList: true, subtree: true});
- })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址