您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
通过代理为 GitHub Raw Assets 提供加速
当前为
// ==UserScript== // @name GitHub 加速 (Raw) // @namespace https://mogeko.me // @version 0.1 // @description 通过代理为 GitHub Raw Assets 提供加速 // @author Mogeko // @supportURL https://github.com/Mogeko/user-script-ghproxy/issues // @match https://github.com/*/* // @icon https://github.githubassets.com/pinned-octocat.svg // @run-at document-end // @grant none // @license MIT // ==/UserScript== const PROXY_URL = "https://ghproxy.com/"; const GH_RAW_HOST = "raw.githubusercontent.com"; const jsDelivrIt = (url) => { const ast = url.split("/"); const path = ast[2] === GH_RAW_HOST ? [ast[3], ast[4]+"@"+ast[5], ...ast.slice(6)] : [ast[3], ast[4]+"@"+ast[6], ...ast.slice(7)]; return path.reduce((x, y) => x+"/"+y, PROXY_URL); } const agentRaw = proxy => { const rawButton = document.querySelector("#raw-url"); if (rawButton) { rawButton.href = proxy + window.location.href; } } (function() { 'use strict'; //debugger; agentRaw(PROXY_URL); document.addEventListener('pjax:success', () => { agentRaw(PROXY_URL); }); })();