自动切换到国内镜像,比如 huggingface

google搜索页面修改,增加便条

  1. // ==UserScript==
  2. // @name 自动切换到国内镜像,比如 huggingface
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description google搜索页面修改,增加便条
  6. // @grant GM_addStyle
  7. // @grant GM_getValue
  8. // @grant GM_setValue
  9. // @grant GM_xmlhttpRequest
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
  11. // @match https://huggingface.co/*
  12. // @require https://code.jquery.com/jquery-3.6.0.min.js
  13. // ==/UserScript==
  14.  
  15.  
  16. const dom = {};
  17. dom.query = jQuery.noConflict(true);
  18. dom.query(document).ready(function ($) {
  19. 'use strict';
  20.  
  21. const {hostname, pathname} = location;
  22.  
  23.  
  24. function add_search_note(){
  25.  
  26. var head=document.querySelector("body > div.flex.min-h-dvh.flex-col > div:nth-child(2) > header");
  27. $(head).append("<div id='content'><center><a href='https://hf-mirror.com"+pathname+"' target=_blank><font color=red>国内镜像:hf-mirror.com</font></a></center></div>");
  28.  
  29. }
  30.  
  31.  
  32. add_search_note();
  33.  
  34. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址