Make Github issue numbers appear in browser tabs

#70. Yippee!

#70. Yippee!

I use Github Issues as a bugtracker for a number of my projects. My workflow usually includes having the ticket open in one browser tab, and a local WordPress installation open in another browser tab (to test the bugfixes themselves). When I write commit messages, I want to reference the issue number, but by default, it’s buried deep in the <title> element, and thus not visible on a smallish browser tab.

So I wrote a short userscript that reproduces the issue number at the beginning of the <title>, so I can see it at a glance. It’s structured as a userscript for Greasemonkey/Firefox, though I imagine you could easily repackage it for Chrome or whatever.

// ==UserScript==
// @name        github issue number in tab
// @namespace
// @description github issue number in tab
// @include*/*/issues/*
// @version     1
// @grant       none
// ==/UserScript==

var t, ttext, issueno;

t = document.getElementsByTagName( 'title' );
ttext = t[0].innerHTML;
ino = ttext.match(/Issue #([0-9]+)/);
console.log("#" + ino[1] + " " + ttext);
t[0].innerHTML = "#" + ino[1] + " " + ttext;

3 thoughts on “Make Github issue numbers appear in browser tabs

  1. Pingback: WordPress School: Bookmarklets and User Scripts « Lorelle on WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *