Last active
January 9, 2020 17:07
-
-
Save hanachin/4b95fe8a661225d9cd5094a21e538b5f to your computer and use it in GitHub Desktop.
https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/b369f5e8a2c1e4bc90c561365d42dc5674f83d6e みたいなコミットのページからGitHubに飛べるやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Jump to GitHub from bugs.ruby-lang.org | |
// @namespace https://www.hanach.in/ | |
// @version 0.1.0 | |
// @description Add link to the commit on GitHub | |
// @author hanachin | |
// @match https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/* | |
// @grant none | |
// @run-at document-idle | |
// @license GPLv3 - http://www.gnu.org/licenses/gpl-3.0.txt | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const revisionTitle = document.querySelector('h2'); | |
const [title, revision] = revisionTitle.textContent.split(' '); | |
revisionTitle.innerHTML = revisionTitle.innerHTML = `${title} <a href="https://github.com/ruby/ruby/commit/${revision}">${revision}</a>` | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment