Compare with staging

Add a link

// ==UserScript==
// @name         Compare with staging
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Add a link
// @author       Arne Goeteyn
// @match        https://github.com/officient/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant        none
// @require https://code.jquery.com/jquery-3.6.0.min.js
// ==/UserScript==

(function() {
    'use strict';

    var originalUrl = document.URL
    var base = originalUrl.match('.*officient/[^\/]*/')

    var a = $('a, no-underline').filter(function() {
        return this.href.match(/http.*officient.*tree/);
    });

    var href = a.last().attr('href');
    var compareHref = href.replace("tree/", "compare/staging...")

    var zNode = document.createElement ('a');
    zNode.setAttribute ('href', compareHref);
    zNode.text = "compare staging";

    var parent = a.parent().parent();
    parent.append (zNode);

})();

QingJ © 2025

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