Jump to content

User:Func/monobook.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Func (talk | contribs) at 19:43, 1 September 2005 (so stupid). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
if ( window.addEventListener && document.createElement ) // modern browser
{
	function PreLoad()
	{
		var a;
	
		var href = window.location.href,
			path = window.location.pathname,
			quer = window.location.search.replace( /^\?/, '' );
	
		if ( quer )
		{
			if ( ( a = quer.match( /returnto=([^&]+)/ ) ) )
				window.location.href = 'http://en.wikipedia.org/wiki/' + a[ 1 ];
	
			if ( ( a = quer.match( /title=([^&]+)&action=(un)?watch/ ) ) )
				window.location.href = 'http://en.wikipedia.org/wiki/' + a[ 1 ];
		}
	}
	PreLoad();

}