Skip to content

Instantly share code, notes, and snippets.

@erikvold
Created September 10, 2013 23:59
Show Gist options
  • Select an option

  • Save erikvold/6517492 to your computer and use it in GitHub Desktop.

Select an option

Save erikvold/6517492 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @id github.com-24a4aabb-e0ba-a54c-befe-2eb0a555de9e@scriptish
// @name Better Github Commit Pages
// @version 1.0
// @namespace erikvold-github
// @author Erik Vold
// @description
// @include https://github.com/*/commit/*
// @grant GM_xpath
// @run-at document-end
// ==/UserScript==
// Display the date of the commit
let commitDate = GM_xpath('//div[@class="authorship"]/time[@class="js-relative-date"]');
commitDate.parentNode.insertBefore(document.createTextNode(commitDate.getAttribute('title') + '; '), commitDate);
// linkify bugzilla bugs
let commitTitle = GM_xpath('//*[@class="commit-title"]');
commitTitle.innerHTML = commitTitle.innerHTML.replace(/bug (\d+)/i, '<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=$1">Bug $1</a>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment