-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsuscreen.min.js
1 lines (1 loc) · 10.2 KB
/
suscreen.min.js
1
window.addEventListener("DOMContentLoaded",function(){function e(){let e=document.getElementById("myRange");document.querySelector(".inner-window").style.height=a/e.value+"px",document.querySelector(".inner-window").style.width=r/e.value+"px",document.querySelector(".outer-window").style.height=d.window_props.outerHeight/e.value+"px",document.querySelector(".outer-window").style.width=d.window_props.outerWidth/e.value+"px",document.querySelector(".outer-window").style.marginLeft=d.screen_props.compLeft/e.value+"px",document.querySelector(".outer-window").style.marginTop=d.screen_props.compTop/e.value+"px",document.querySelector(".avail-screen").style.height=d.screen_props.availHeight/e.value+"px",document.querySelector(".avail-screen").style.width=d.screen_props.availWidth/e.value+"px",document.querySelector(".screen").style.height=d.screen_props.height/e.value+"px",document.querySelector(".screen").style.width=d.screen_props.width/e.value+"px";let n="";0==d.screen_props.availTop&&0==d.screen_props.availLeft?n+="<strong>isPrimary: This is the primary display":d.screen_props.initialLeft>=d.screen_props.width?n+="<strong>isExtended: Its probably on the right extended display! The primary display width is probably "+d.screen_props.availLeft+"px </strong><br>":Math.abs(d.screen_props.initialLeft)>=d.window_props.actualInnerWidth?n+="<strong>isExtended: Its probably on the left extended display! </strong><br>":-1==Math.sign(d.screen_props.availTop)&&Math.abs(d.screen_props.initialTop)>=d.window_props.outerHeight?n+="<strong>isExtended: Its probably on the top extended display! </strong><br>":d.screen_props.initialTop>=d.screen_props.height&&(n+="<strong>isExtended: Its probably on the bottom extended display! The primary display height is probably "+d.screen_props.availTop+"px </strong><br>");let i=Math.round(100*window.devicePixelRatio),t=`Zoom Level: ${i}%`,o="<ul>";for(var s in o+=`<li>${t}</li>`,d.window_props)o+="<li>"+s+": "+d.window_props[s]+"</li>";for(var s in d.screen_props)o+="<li>"+s+": "+d.screen_props[s]+"</li>";o+="</ul>",document.getElementById("window-properties").innerHTML=o,document.getElementById("window-sus").innerHTML=n}function n(){var e=[];0===d.window_props.outerWidth&&0===d.window_props.outerHeight&&e.push("Probably a VM"),(d.window_props.windowWidthdiff<=-150||d.window_props.windowHeightdiff<=-200||d.window_props.windowWidthdiff>=300||d.window_props.height>=1e4||d.window_props.availHeight>=1e4)&&e.push("Probably a VM"),800===d.window_props.outerWidth&&600===d.window_props.outerHeight&&800===d.screen_props.availWidth&&600===d.screen_props.availHeight&&800===d.screen_props.width&&600===d.screen_props.height&&0===d.screen_props.screenHeightdiff&&0===d.screen_props.screenWidthdiff&&e.push("Probably a VM"),-40!==d.screen_props.screenHeightdiff&&-81!==d.screen_props.screenHeightdiff&&-122!==d.screen_props.screenHeightdiff&&-163!==d.screen_props.screenHeightdiff&&-204!==d.screen_props.screenHeightdiff&&-245!==d.screen_props.screenHeightdiff&&-286!==d.screen_props.screenHeightdiff&&-327!==d.screen_props.screenHeightdiff||e.push("OS Prediction (without user-agent): Windows 10"),-32!==d.screen_props.screenHeightdiff&&-48!==d.screen_props.screenHeightdiff&&-72!==d.screen_props.screenHeightdiff||e.push("OS Prediction (without user-agent): Windows 11"),-21===d.screen_props.screenHeightdiff&&(e.push("OS Prediction (without user-agent): macOS 10.4 - 10.9"),document.querySelector(".avail-screen").style.alignSelf="flex-end"),-22===d.screen_props.screenHeightdiff&&(e.push("OS Prediction (without user-agent): macOS 10.10 - 10.15"),document.querySelector(".avail-screen").style.alignSelf="flex-end"),-24===d.screen_props.screenHeightdiff&&(e.push("OS Prediction (without user-agent): macOS 11 -"),document.querySelector(".avail-screen").style.alignSelf="flex-end");var n="";e.length>0&&(n+="<strong>"+e.join("<br>")+"</strong><br>"),document.getElementById("os-properties").innerHTML=n}function i(){r=Math.round(window.innerWidth/window.devicePixelRatio),a=Math.round(window.innerHeight/window.devicePixelRatio),d.window_props={menubar:window.menubar.visible,toolbar:window.toolbar.visible,statusbar:window.statusbar.visible,scrollbars:window.scrollbars.visible,personalbar:window.personalbar.visible,locationbar:window.locationbar.visible,innerWidth:window.innerWidth,innerHeight:window.innerHeight,actualInnerWidth:r,actualInnerHeight:a,outerWidth:window.outerWidth,outerHeight:window.outerHeight,devicePixelRatio:window.devicePixelRatio,windowHeightdiff:window.outerHeight-Math.round(window.innerHeight/window.devicePixelRatio),windowWidthdiff:window.outerWidth-Math.round(window.innerWidth/window.devicePixelRatio)},d.screen_props={availWidth:window.screen.availWidth,availHeight:window.screen.availHeight,width:window.screen.width,height:window.screen.height,screenHeightdiff:window.screen.availHeight-window.screen.height,screenWidthdiff:window.screen.availWidth-window.screen.width,initialLeft:window.screenLeft,initialTop:window.screenTop,availLeft:window.screen.availLeft,compLeft:window.screenLeft-window.screen.availLeft,availTop:window.screen.availTop,compTop:window.screenTop-window.screen.availTop,colorDepth:window.screen.colorDepth},e()}function t(){const e=[{name:"Cookies Enabled",value:navigator.cookieEnabled},{name:"Browser Language",value:navigator.language},{name:"Platform",value:navigator.platform},{name:"Do Not Track",value:navigator.doNotTrack},{name:"Online Status",value:navigator.onLine},{name:"WebGL Support",value:!!window.WebGLRenderingContext},{name:"WebSockets Support",value:"WebSocket"in window},{name:"Geolocation Support",value:"geolocation"in navigator},{name:"Local Storage Support",value:"undefined"!=typeof Storage},{name:"IndexedDB Support",value:"indexedDB"in window},{name:"Service Worker Support",value:"serviceWorker"in navigator},{name:"Web Workers Support",value:"Worker"in window},{name:"Web Share API Support",value:"share"in navigator},{name:"Battery Status API Support",value:"getBattery"in navigator},{name:"Media Devices API Support",value:"mediaDevices"in navigator},{name:"Gamepad API Support",value:!!navigator.getGamepads},{name:"Web Bluetooth API Support",value:"bluetooth"in navigator},{name:"File System API Support",value:"requestFileSystem"in window},{name:"Speech Recognition API Support",value:"SpeechRecognition"in window},{name:"Web MIDI API Support",value:"requestMIDIAccess"in navigator},{name:"Web USB API Support",value:"usb"in navigator},{name:"WebXR Support",value:"xr"in navigator},{name:"WebRTC Support",value:"RTCPeerConnection"in window},{name:"WebAssembly Support",value:"WebAssembly"in window},{name:"FileSystem Access API Support",value:"showDirectoryPicker"in window},{name:"Notifications API Support",value:"Notification"in window},{name:"Push API Support",value:"PushManager"in window},{name:"Payment Request API Support",value:"PaymentRequest"in window},{name:"Credential Management API Support",value:"credentials"in navigator},{name:"Presentation API Support",value:"presentation"in navigator},{name:"Idle Detection API Support",value:"IdleDetector"in window},{name:"Orientation Sensor API Support",value:"AbsoluteOrientationSensor"in window},{name:"Device Orientation API Support",value:"DeviceOrientationEvent"in window},{name:"Ambient Light Sensor API Support",value:"AmbientLightSensor"in window},{name:"Proximity Sensor API Support",value:"ProximitySensor"in window},{name:"Web Speech API Support",value:"webkitSpeechRecognition"in window},{name:"Audio/Video Codecs Support",value:"undefined"!=typeof MediaRecorder&&"undefined"!=typeof MediaSource}];let n="<ul>";for(let i=0;i<e.length;i++)n+=`<li>${e[i].name}: ${e[i].value}</li>`;n+="</ul>",document.getElementById("user-feature-data").innerHTML=n}function o(e){e.clientX&&null!==e.clientX&&(b.innerHTML=e.clientX),null!==e.clientY&&(S.innerHTML=e.clientY),null!==e.screenX&&(m.innerHTML=e.screenX),null!==e.screenY&&(f.innerHTML=e.screenY),document.querySelector(".mouse").style.marginTop=e.clientY/s.value+"px",document.querySelector(".mouse").style.marginLeft=e.clientX/s.value+"px"}let r=Math.round(window.innerWidth/window.devicePixelRatio),a=Math.round(window.innerHeight/window.devicePixelRatio);const d={window_props:{menubar:window.menubar.visible,toolbar:window.toolbar.visible,statusbar:window.statusbarv,scrollbars:window.scrollbars.visible,personalbar:window.personalbar.visible,locationbar:window.locationbar.visible,innerWidth:window.innerWidth,innerHeight:window.innerHeight,actualInnerWidth:r,actualInnerHeight:a,outerWidth:window.outerWidth,outerHeight:window.outerHeight,devicePixelRatio:window.devicePixelRatio,windowHeightdiff:window.outerHeight-Math.round(window.innerHeight/window.devicePixelRatio),windowWidthdiff:window.outerWidth-Math.round(window.innerWidth/window.devicePixelRatio)},screen_props:{availWidth:window.screen.availWidth,availHeight:window.screen.availHeight,width:window.screen.width,height:window.screen.height,screenHeightdiff:window.screen.availHeight-window.screen.height,screenWidthdiff:window.screen.availWidth-window.screen.width,initialLeft:window.screenLeft,initialTop:window.screenTop,availLeft:window.screen.availLeft,compLeft:window.screenLeft-window.screen.availLeft,availTop:window.screen.availTop,compTop:window.screenTop-window.screen.availTop,colorDepth:window.screen.colorDepth}};e(),n();var s=document.getElementById("myRange");s.oninput=function(){e()};let w=!1,l=1e3;window.addEventListener("resize",()=>{i(),w=!0,setTimeout(()=>{w=!1},l)}),setInterval(()=>{w||i()},l);var p="",c="Not Available";if(window.WebGLRenderingContext){var u=document.createElement("canvas"),h=u.getContext("webgl")||u.getContext("experimental-webgl");h&&h.getParameter(h.VERSION)&&(c=h.getParameter(h.RENDERER)+" - "+h.getParameter(h.VERSION))}p+="<p>GPU: ",p+=c,p+="</p>",document.getElementById("gpu-data").innerHTML=p;let v=new UAParser,g=v.getResult();p="";p+="User-Agent: "+g.ua+"<br>",p+="Browser: "+g.browser.name+" "+g.browser.version+"<br>",p+="Engine: "+g.engine.name+" "+g.engine.version+"<br>",p+="OS: "+g.os.name+" "+g.os.version+"<br>",p+="Device: "+g.device.model+" "+g.device.type+" "+g.device.vendor+"<br>",p+="CPU Architecture: "+g.cpu.architecture+"<br>",document.getElementById("user-agent-data").innerHTML=p,t();const m=document.getElementById("screenX"),f=document.getElementById("screenY"),b=document.getElementById("clientX"),S=document.getElementById("clientY");document.addEventListener("mousemove",o)});