GitHub My Issues

Add a link to issues you've contributed to on GitHub

目前為 2020-09-22 提交的版本,檢視 最新版本

// ==UserScript==
// @name          GitHub My Issues
// @description   Add a link to issues you've contributed to on GitHub
// @author        chocolateboy
// @copyright     chocolateboy
// @version       0.0.1
// @namespace     https://github.com/chocolateboy/userscripts
// @license       GPL: http://www.gnu.org/copyleft/gpl.html
// @include       https://github.com/
// @include       https://github.com/*
// @require       https://code.jquery.com/jquery-3.5.1.slim.min.js
// @grant         GM_log
// @inject-into   auto
// ==/UserScript==

// XXX note: the unused grant is a workaround for a Greasemonkey bug:
// https://github.com/greasemonkey/greasemonkey/issues/1614

const user = $('meta[name="user-login"]').attr('content')
const $issues = $('[aria-label="Global"] a[href="/issues"]')

if (user && $issues.length) {
    const repo = $('meta[name="octolytics-dimension-repository_nwo"]').attr('content')
    const query = escape(`involves:${user}`)
    const href = repo ? `/${repo}/issues?q=${query}` : `/issues?q=${query}`
    const $link = $issues.clone()
        .attr({ href, 'data-hotkey': 'g I' })
        .text('My Issues')

    $issues.after($link)
}

QingJ © 2025

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