functionScreenSaver (settings) { This. Settings =settings; This. Ntimeout = This. Settings.timeout; Document.body.screenSaver= This; //link in to Body eventsDocument.body.onmousemove =ScreenSaver.prototype.onevent; Document.body.onmousedown=ScreenSaver.prototype.onevent; Document.body.onkeydown=ScreenSaver.prototype.onevent; Document.body.onkeypress=ScreenSaver.prototype.onevent; varPThis = This; varf =function() {pthis.timeout ();} This. Timerid = Window.settimeout (f, This. Ntimeout); } ScreenSaver.prototype.timeout=function(){ if( ! This. Saver) {window.location= ' www.baidu.com '; }} ScreenSaver.prototype.signal=function(){ if( This. Saver) { This. Saver.stop (); } window.cleartimeout ( This. Timerid); varPThis = This; varf =function() {pthis.timeout ();} This. Timerid = Window.settimeout (f, This. Ntimeout); } ScreenSaver.prototype.onevent=function(e) { This. screensaver.signal (); } varSaver; functionInitscreensaver () {//Blort; Saver =NewScreenSaver ({timeout:5000});//No action time} window.onload=function() {initscreensaver (); }
JS Monitoring page----No mouse keyboard action, automatic page skipping