Applying to all MediaWiki pages
|
|
Hi, I slapped together a quick fix that applies this to all MediaWiki pages automatically. Change the pages the script includes to *, and add the following lines to the top of the script:
// Peek in the generator tag to see if this is a MediaWiki page
var head = document.getElementsByTagName('head')[0];
var metas = head.getElementsByTagName('meta');
gentstr = '';
for (var i = 0; i < metas.length; i++) {
if (metas[i].name == 'generator') {
genstr = metas[i].content;
break;
}
}
// If it isn't, just quit
if (genstr.indexOf('MediaWiki') == -1) {
return;
}
|