GitHub 加速 (Raw)

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

Від 31.07.2023. Дивіться остання версія.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         GitHub 加速 (Raw)
// @namespace    https://mogeko.me
// @version      0.1.6
// @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);
  });

})();