Note: After saving, changes may not occur immediately. Click here to learn how to bypass your browser's cache.
  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Cmd-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (Cmd-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Clear the cache in Tools → Preferences

For details and instructions about other browsers, see Wikipedia:Bypass your cache.

// ==================================================================
// Copy wikitext source of the current page to the clipboard.
// ==================================================================

// Make sure the necessary modules are loaded
mw.loader.using('mediawiki.util', function () {

  // Wait for the page to be parsed (new-style $(document).ready())
  $(function () {
  	
    // Special:-pages have no wiki-source
    if (mw.config.get('wgCanonicalNamespace') === 'Special') {
      return;
    }

    var copyPortlet = mw.util.addPortletLink(
      'p-cactions', '#', 'Copy wikitext', 'ca-copywikitext', 'Copy the wikitext of this page to the clipboard'
    ); 
    $(copyPortlet).on('click', function (e) {
      e.preventDefault();
      doCopy();
    });
  }); // END: $(document).ready()
}); // END: mw.loader.using()


function doCopy () {
  var api = new mw.Api();
  var page = mw.config.get('wgArticleId');
  var source = '';

  api.get({
    action: 'parse',
    pageid: page,
    prop:   'wikitext',
    format: 'json'
  }).then(function (data) {
    source = data.parse.wikitext['*'];
	navigator.clipboard.writeText(source).then(function () {
		mw.notify(
			"Page wikisource copied to clipboard.",
			{title: 'Page source copied', type: 'info', tag: 'copySource'}
		);
	});
  });
}