Use mobile detection function that's the easiest and than use it in your mydesktop-script.js to disable execution.
function detectmob() {
if( navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)
){
return true;
}
else {
return false;
}
}
Or you can check it server side and just don't attach the js to the html.
Server side detection of mobile devices is done or in whatever language you have your app written or for example you can use varnish + esi. Virtually planty of ways to achieve that.
But as I said the easiest is to detect the device in your script and disable part of your script based on detection result.