MediaWiki:Gadget-script-installer.js

From Test Wiki
Revision as of 18:11, 19 February 2020 by Brownlowe.2 (talk | contribs) (1 revision imported)
Jump to navigation Jump to search

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.
/**
 * script-installer loader
 */

if( mw.config.get( "wgNamespaceNumber" ) > 0 ) {
    var jsPage = mw.config.get( "wgPageName" ).slice( -3 ) === ".js" ||
        mw.config.get( "wgPageContentModel" ) === "javascript";
    if( jsPage || document.getElementsByClassName( "scriptInstallerLink" ).length ||
            document.querySelector( "table.infobox-user-script" ) ) {
        mw.loader.load('https://en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-script-installer-core.js&action=raw&ctype=text/javascript');
    }
}