将 Ant Design (antd) 文档重定向到国内镜像,加快访问速度
// ==UserScript== // @name Ant Design (antd) 文档重定向到国内镜像 // @namespace antd-docs-redirect // @version 1.0.2 // @author https://github.com/kazoottt // @description 将 Ant Design (antd) 文档重定向到国内镜像,加快访问速度 // @license MIT // @icon https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg // @match https://ant.design/* // @match https://procomponents.ant.design/* // ==/UserScript== (function () { 'use strict'; (() => { if (window.location.href.startsWith("https://ant.design/")) { const pathname = window.location.pathname; console.log(`redirecting to https://ant-design.antgroup.com${pathname}`); window.location.href = `https://ant-design.antgroup.com${pathname}`; } if (window.location.href.startsWith("https://procomponents.ant.design/")) { const pathname = window.location.pathname; console.log( `redirecting to https://pro-components.antdigital.dev${pathname}` ); window.location.href = `https://pro-components.antdigital.dev${pathname}`; } })(); })();