Skip to content

Instantly share code, notes, and snippets.

@hanachin
Last active January 9, 2020 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hanachin/4b95fe8a661225d9cd5094a21e538b5f to your computer and use it in GitHub Desktop.
Save hanachin/4b95fe8a661225d9cd5094a21e538b5f to your computer and use it in GitHub Desktop.
// ==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