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.
// Adds a purge button
//
// Installation:
// Add the following line to your monobook.js
// importScript('User:Plastikspork/purge.js');

addOnloadHook(function () {
 if (wgIsArticle && wgAction == "view") {
  mw.util.addPortletLink('p-cactions',
   mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=' + encodeURIComponent(mw.config.get('wgPageName')) + '&action=purge',
   'Purge', 'ca-purge',
   'Purge this page',
   'P', document.getElementById('ca-history'));
  }
});
// [[Category:Wikipedia scripts]]