User:Mifield/common/script-installer/loader.js

// "use strict"; /* script-installer loader */

( => {

if (window.scriptInstallerInstallTarget !== undefined) { // presume that another instance of the same script is running alert("\"x-script-installer\" found an instance of \"script-installer\" instance running; quitting"); return /* set( state.quit ) */; }	window.xScriptInstallerInstallTarget = "common";

if( /* in a real (not virtual) namespace */		mw.config.get( "wgNamespaceNumber" ) > 0 &&		( mw.config.get( "wgPageName" ).endsWith( ".js" ) || mw.config.get( "wgPageContentModel" ) === "javascript" || document.getElementsByClassName( "scriptInstallerLink" ).length || document.querySelector( "table.infobox-user-script" ).length )	) {		const scriptPath = ( /* relative */ path ) => new URL( `${ new URL( path, [ window.location.origin, mw.format( ...				[ "wgArticlePath", "wgPageName" ].map( ( wg ) => mw.config.get( wg ) ) ) ].join( "" ) ) }?${ new URLSearchParams( { action: "raw", ctype: "text/javascript", } ) }` );

mw.libs.xsi = Object.assign( mw.libs.xsi || {}, {			utils: {				script: {					path: scriptPath,				},			},		} );

importScript('User:Mifield/common/script-installer/main.js'); return; }

return; });