GitHub 加速 (Raw)

通过代理为 GitHub Raw Assets 提供加速

安裝腳本?
作者推薦腳本

您可能也會喜歡 GitHub 加速 (Gist)

安裝腳本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         GitHub 加速 (Raw)
// @namespace    https://mogeko.me
// @version      0.1.9
// @author       Zheng Junyi
// @description  通过代理为 GitHub Raw Assets 提供加速
// @license      MIT
// @icon         https://besticon.herokuapp.com/icon?size=80..120..200&url=github.com
// @homepage     https://github.com/mogeko/userscripts/tree/master/packages/ghproxy-raw#readme
// @homepageURL  https://github.com/mogeko/userscripts/tree/master/packages/ghproxy-raw#readme
// @source       https://github.com/mogeko/userscripts.git
// @supportURL   https://github.com/mogeko/userscripts/issues
// @match        https://github.com/**
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function () {
  'use strict';

  const PROXY_URL = "https://ghproxy.com/";
  function agentRaw(proxy) {
    const rawButton = document.querySelector("#raw-url");
    if (rawButton) rawButton.href = proxy + window.location.href;
  }
  agentRaw(PROXY_URL);
  document.addEventListener("pjax:success", () => {
    agentRaw(PROXY_URL);
  });

})();