Tag Archives: issues

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.

<br />
// ==UserScript==<br />
// @name        github issue number in tab<br />
// @namespace   https://boone.gorg.es<br />
// @description github issue number in tab<br />
// @include     https://github.com/*/*/issues/*<br />
// @version     1<br />
// @grant       none<br />
// ==/UserScript==</p>
<p>var t, ttext, issueno;</p>
<p>t = document.getElementsByTagName( 'title' );<br />
ttext = t[0].innerHTML;<br />
ino = ttext.match(/Issue #([0-9]+)/);<br />
console.log("#" + ino[1] + " " + ttext);<br />
t[0].innerHTML = "#" + ino[1] + " " + ttext;<br />