(In continuance to this question of mine).
I\'ve been writing this userscript for the site metal-archives.com.
When opening a band page (example) you land to DISCOGR
Assuming the appendColumn
function works, as is, on reloads; then you would rewrite it slightly and call it from waitForKeyElements().
You don't need most of that rigamorole, just use class names display
and discog
for the selector. Like so:
waitForKeyElements (".display.discog", appendColumn);
function appendColumn(jNode) {
var tbl = jNode[0]; // table reference
var i;
var newCell, newText;
var tr = tbl.tHead.children[0],
th = document.createElement('th');
// THE REST OF THE FUNCTION IS THE SAME...
//...