User:XiaoZhou/monobook.js

From Meta, a Wikimedia project coordination wiki

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
$(function(){
	var ca_history = document.getElementById( "ca-history" );
	if ( ca_history && document.location.href.indexOf(mw.config.get('wgServer')+mw.config.get('wgArticlePath').replace("$1","")) == 0 ){
		var newA = document.createElement( "a" );
		newA.setAttribute( "href" , ca_history.firstChild.href.replace( "=history" , "=purge" ) );
		newA.appendChild( document.createTextNode('刷新缓存') );
		var newLi = document.createElement( "li" );
		newLi.appendChild( newA );
		var ul = ca_history.parentNode;
		ul.appendChild( newLi );
	}
});