User:3mi1y/auto-skin-switcher.js

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.
// Automatically change skin when switching between mobile and desktop.
// Why? Because mobile Timeless is really good, and desktop Timeless is less good.

// But if your preferences don't match mine, you can change them here.
const mobileSkin = 'timeless',
	desktopSkin = 'vector',
	// I believe 'iPhone' will work for iPhones, but I have not tried it.
	mobileUserAgent = 'Android';

$(function() {
	const isMobile = navigator.userAgent.includes(mobileUserAgent), isMobileSkin = window.mw.config.get('skin') === mobileSkin;
	
	if (isMobile && !isMobileSkin) {
	    (new mw.Api()).saveOption('skin', mobileSkin).then(function() { window.location.reload(); });
	} else if (!isMobile && isMobileSkin) {
	    (new mw.Api()).saveOption('skin', desktopSkin).then(function() { window.location.reload(); });
	}
});