您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Makes the branch name in the "merged commit" message a link as well
- // ==UserScript==
- // @name Make branch name a link
- // @namespace http://tampermonkey.net/
- // @version 2024-02-07
- // @description Makes the branch name in the "merged commit" message a link as well
- // @author Alexander M. Scheurer <ams@patentrenewal.com>
- // @match https://github.com/*/*/pull/*
- // @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
- // @grant GM_addElement
- // @license MIT
- // ==/UserScript==
- (function () {
- "use strict";
- let base_ref = document.querySelector(".base-ref");
- if (base_ref === null) return;
- let children = base_ref.children;
- let branch_name = base_ref.innerText;
- let href = `${document.location.href.split("/pull")[0]}/tree/${branch_name}`;
- let a = GM_addElement(base_ref, "a", {
- href,
- });
- for (let child of children) {
- child.remove();
- a.appendChild(child);
- }
- })();