if(window.innerWidth == screen.width && window.innerHeight == screen.height) { alert("metro"); } else { alert("desktop"); }