User:Lionel.rowe/common.js

(function {	var scriptNames = [		'sort-by-heading',		'disable-search-auto-capitalize',		'redirect-mobile-if-user-agent-desktop',		// 'vector-skin-desktop-only',		// 'mimic-mobile-section-collapse',	]	function _getScriptPath(username) {		return function(scriptName) {			var url = new URL('/w/index.php', window.location.origin)

var title = [ username && 'User:' + username, scriptName + '.js', ].filter(Boolean).join('/')

Object.entries({				title: title,				action: 'raw',				ctype: 'text/javascript',			}).forEach(function(kv) {				url.searchParams.set(kv[0], kv[1])			})

var path = url.href.slice(window.location.origin.length)

return path }	}

var getScriptPath = _getScriptPath('Lionel.rowe')

scriptNames.map(getScriptPath) .forEach(function(scriptPath) {			mw.loader.load(scriptPath)		}) })