Speedtest自动测速防卡死代码

[四川移动][综调演示][自动测速]

  1. // ==UserScript==
  2. // @name Speedtest自动测速防卡死代码
  3. // @namespace [url=mailto:552397723@qq.com]552397723@qq.com[/url]
  4. // @version 0.1.6
  5. // @description [四川移动][综调演示][自动测速]
  6. // @author 潘宇_QQ552397723_TEL18380123411
  7. // @match https://beta.speedtest.net/*
  8. // @match https://www.speedtest.net/
  9. // @run-at document-start
  10. // @grant none
  11. // ==/UserScript==
  12. /* jshint -W097 */
  13. 'use strict';
  14.  
  15. var RepeatTime=0 ;
  16. var RepeatTag="";
  17. (function() {
  18. run();
  19. setTimeout(function(){FalutMonitor();},3000);
  20. })();
  21.  
  22. function run(){
  23. var iid=setInterval(function(){
  24. clearInterval(iid);
  25. var r=document.getElementsByClassName("js-start-test");
  26. if(r.length===0){
  27. run();
  28. return;
  29. }
  30. r=r[0];
  31. r.click();
  32. run();
  33. },1000*8); //可以自行调整延
  34. }
  35.  
  36. function FalutMonitor(){
  37. var iid=setInterval(function(){
  38. if(document.getElementsByClassName("gauge-speed-needle").length<1){
  39. clearInterval(iid);
  40. location.href="http://beta.speedtest.net";
  41. }else{
  42. var PaintTag=document.getElementsByClassName("gauge-speed-needle")[0].outerHTML;
  43. if(PaintTag.substring(PaintTag.indexOf("rotateZ(")+8,PaintTag.indexOf("deg)"))===RepeatTag) {
  44. RepeatTime=RepeatTime+1;
  45. console.log("异常:当前测绘角度未变化:"+PaintTag.substring(PaintTag.indexOf("rotateZ(")+8,PaintTag.indexOf("deg)")));
  46. }else{
  47. console.log("正常:当前测绘角度变化中");
  48. RepeatTag=PaintTag.substring(PaintTag.indexOf("rotateZ(")+8,PaintTag.indexOf("deg)"));
  49. RepeatTime=0;
  50. }
  51. if(RepeatTime>30){
  52. location.href="http://beta.speedtest.net";
  53. }
  54. }
  55. },1000); //可以自行调整延
  56. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址