HBUT net

Free your hands, connect your network automatically!!!

目前为 2022-05-26 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name HBUT net
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.4.1
  5. // @description Free your hands, connect your network automatically!!!
  6. // @author Huang
  7. // @match http://202.114.177.246/srun_portal_pc?ac_id=1&theme=pro
  8. // @match https://202.114.177.246/srun_portal_pc?ac_id=1&theme=pro
  9. // @match *202.114.177.246/*
  10. // @license myself
  11. // @icon https://tse2-mm.cn.bing.net/th/id/OIP-C.MvkZ23M8xQitxsRcgCsFmwHaHa?w=160&h=180&c=7&r=0&o=5&pid=1.7
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. // Your code here...
  19. setTimeout(function(){
  20. var buttonValue = document.getElementById('login-account');
  21. var count = 500;
  22. while(document.getElementById('logout') == null){
  23. // console.log("登陆界面的 --> "+ buttonValue);
  24. buttonValue.onclick = function(){};
  25. buttonValue.click();
  26. if(count<0){
  27. break;
  28. }
  29. count -=1;
  30. }
  31. }, 3000);
  32. console.log('登录成功');
  33. setTimeout(function(){
  34. var count = 50;
  35. while(document.getElementById('logout') != null){
  36. closeWindows();
  37. if(count--<0){
  38. break;
  39. }
  40. }
  41. }, 5000);
  42. alert('爱你,凡凡子♥');
  43.  
  44. function closeWindows() {
  45. var browserName = navigator.appName;
  46. var browserVer = parseInt(navigator.appVersion);
  47. //alert(browserName + " : "+browserVer);
  48.  
  49. //document.getElementById("flashContent").innerHTML = "<br>&nbsp;<font face='Arial' color='blue' size='2'><b> You have been logged out of the Game. Please Close Your Browser Window.</b></font>";
  50.  
  51. if(browserName == "Microsoft Internet Explorer"){
  52. var ie7 = (document.all && !window.opera && window.XMLHttpRequest) ? true : false;
  53. if (ie7)
  54. {
  55. //This method is required to close a window without any prompt for IE7 & greater versions.
  56. window.open('','_parent','');
  57. window.close();
  58. }
  59. else
  60. {
  61. //This method is required to close a window without any prompt for IE6
  62. this.focus();
  63. self.opener = this;
  64. self.close();
  65. }
  66. }else{
  67. //For NON-IE Browsers except Firefox which doesnt support Auto Close
  68. try{
  69. this.focus();
  70. self.opener = this;
  71. self.close();
  72. }
  73. catch(e){
  74.  
  75. }
  76.  
  77. try{
  78. window.open('','_self','');
  79. window.close();
  80. }
  81. catch(e){
  82.  
  83. }
  84. }
  85. }
  86. })();