GitHub 加速 (Gist)

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

安装此脚本?
作者推荐脚本

您可能也喜欢GitHub 加速 (Releases)

安装此脚本
  1. // ==UserScript==
  2. // @name GitHub 加速 (Gist)
  3. // @namespace https://mogeko.me
  4. // @version 0.1.7
  5. // @author Zheng Junyi
  6. // @description 通过代理为 GitHub Gist 的 Raw Assets 提供加速
  7. // @license MIT
  8. // @icon https://besticon.herokuapp.com/icon?size=80..120..200&url=github.com
  9. // @homepage https://github.com/mogeko/userscripts/tree/master/packages/ghproxy-gist-raw#readme
  10. // @homepageURL https://github.com/mogeko/userscripts/tree/master/packages/ghproxy-gist-raw#readme
  11. // @source https://github.com/mogeko/userscripts.git
  12. // @supportURL https://github.com/mogeko/userscripts/issues
  13. // @match https://gist.github.com/**
  14. // @grant none
  15. // @run-at document-end
  16. // ==/UserScript==
  17.  
  18. (function () {
  19. 'use strict';
  20.  
  21. const PROXY_URL = "https://ghproxy.com/";
  22. function agentGistRaw(proxy) {
  23. for (const link of document.querySelectorAll(
  24. ".file-actions a, .ml-2:nth-last-child(1) a"
  25. )) {
  26. link.href = proxy + link.href;
  27. }
  28. }
  29. agentGistRaw(PROXY_URL);
  30. document.addEventListener("pjax:success", () => {
  31. agentGistRaw(PROXY_URL);
  32. });
  33.  
  34. })();