cite university wifi auto login script

This script allows you to skip the login process on the login page when you connect to Cité université wifi.

2024/03/10のページです。最新版はこちら。

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==UserScript==
// @name            cite university wifi auto login script
// @name:fr         Cité université wifi auto login script
// @namespace       seojihyuk@university
// @match           http://10.254.0.254:*/*
// @match           https://www.msn.com/*
// @version         1.6
// @license         MIT
// @author          seojihyuk
// @grant           GM_getValue
// @grant           GM_setValue
// @grant           window.close
// @description     This script allows you to skip the login process on the login page when you connect to Cité université wifi.
// @description:fr  Ce script vous permet de sauter le processus de connexion sur la page de connexion lorsque vous vous connectez au Cité université wifi.
// ==/UserScript==
 if(window.location.hostname=="www.msn.com"){
  window.close();
}else{
  const CurrentTime = Date.now();
  const lastLoginAttemptTime = GM_getValue("lastLoginAttemptTime");
  const username = GM_getValue("username");
  const password = GM_getValue("password");
  // console.log("username: "+username+", password: "+password+", lastLoginAttemptTime: ",lastLoginAttemptTime);
  var usernameDom =
      // document.querySelector("[name=username]");// match           http://10.60.207.254/*
  document.querySelector("#ft_un");
  var passwordDom =
      // document.querySelector("[name=password]");
  document.querySelector("#ft_pd");
  var button =
      // document.querySelector(".bottom > input");
  document.querySelector(".fer > input");
  if(username && password && ((CurrentTime - lastLoginAttemptTime)>10)){
    usernameDom.value = username;
    passwordDom.value = password;
    GM_setValue("lastLoginAttemptTime",CurrentTime);
    button.click();
  }else{
    button.addEventListener("click", function() {
      console.log("save id and password");
      GM_setValue("username",usernameDom.value);
      GM_setValue("password",passwordDom.value);
      GM_setValue("lastLoginAttemptTime",CurrentTime);
    });
  }
}