Google Wikipedia

By Matthew Flaschen Last update Dec 28, 2005 — Installed 2,652 times.

Applying to all MediaWiki pages

in
Subscribe to Applying to all MediaWiki pages 1 post, 1 voice

Ian Young Scriptwright

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;
}

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel