GitHub链接精简

删除GitHub链接多余的参数。GitHub Remove /refs/heads from URL.

目前为 2025-02-24 提交的版本。查看 最新版本

// ==UserScript==
// @name        GitHub链接精简
// @version      0.13
// @description  删除GitHub链接多余的参数。GitHub Remove /refs/heads from URL.
// @match        *://api.gf.qytechs.cn/*
// @run-at       document-start
// @grant        none
// @namespace    https://gf.qytechs.cn/users/1171320
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // 检查并更改 URL
    function removeRefsHeads() {
        const currentUrl = window.location.href;
        const newUrl = currentUrl.replace('/refs/heads', '');

        if (currentUrl !== newUrl) {
            window.location.replace(newUrl); // 重定向到新 URL
        }
    }

    // 立即执行以确保在页面加载时应用更改
    removeRefsHeads();
})();

QingJ © 2025

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