User:Eman235/test.js

// some code adapted from User:Þjarkur/NeverUseMobileVersion.js

var urlPattern = /^(https?:\/\/[^.]+\.)m\./;

if(window.location.href.match(urlPattern)) { window.location.href = window.location.href.replace(urlPattern, '$1'); }