2 // @name Github.com - Add RPG tab
3 // @namespace nitlanguage/github/rpg
4 // @description Adds a "Github RPG" Tab at the end of the tabs.
5 // @include https://github.com/*
6 // @downloadURL https://github.com/nitlang/nit/raw/master/contrib/nitrpg/nitrpg.user.js
11 // The nav bar with tabs
12 var nav
= document
.getElementsByClassName('reponav');
13 if (!nav ||
!nav
[0]) return;
15 // The current repo to link
16 var repo
= $
("meta[name='octolytics-dimension-repository_nwo']").attr("content");
17 //repo = "nitlang/nit";
20 // The content of the new tab
21 var html
= '<a href="http://nitlanguage.org/rpg/games/' + repo
+ '" class="js-selected-navigation-item reponav-item" data-selected-links="nitrpg"><span class="octicon octicon-ruby"></span> Github RPG</a>';
22 //html = '<p><span>x</span></p>';
25 var div
= document
.createElement('div');
27 nav
[0].append(div
.firstChild
);