Your target site already uses jQuery and your script is loading a different jQuery on top of it. Loading jQuery in @grant none
mode busts the page, or the script, or both.
Additionally:
The node with the id main_tab_set
is not always present and is probably added via AJAX. You need AJAX techniques for that.
The node may be in an iFrame. You'd need to adjust the script's @include
statements for that.
(Note that in 60 seconds of poking around, I did not see that node at all.)
So, Change the script to this:
// ==UserScript==
// @name LootTracker
// @namespace Kong
// @include http://www.kongregate.com/games/5thPlanetGames/*
// @version 1
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant GM_addStyle
// ==/UserScript==
/*- The @grant directive is needed to work around a design change
introduced in GM 1.0. It restores the sandbox.
*/
console.log ('1');
LootTabHeaderText = "<li id='loot_tab'>Loot tab</li>";
console.log (LootTabHeaderText);
waitForKeyElements ("#main_tab_set", appendListItem);
function appendListItem (jNode) {
jNode.append (LootTabHeaderText);
console.log ("Node found!");
}
That will work unless the content is in an iframe. In that case, adjust the @include
s to fire on the iframe.
Open the console (CtrlShiftK) to see the debug messages.