Login

22:09:36 16/12/2024

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey to install this script.

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

Advertisement:

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Advertisement:

// ==UserScript==
// @name        Login
// @namespace   Login to account
// @match       https://fap.fpt.edu.vn/Default.aspx
// @grant       none
// @version     1.0
// @author      -Eric Anti Code
// @description 22:09:36 16/12/2024
// ==/UserScript==
(function() {
    'use strict';

    setTimeout(() => {
        // Tìm dropdown campus
        const campusDropdown = document.getElementById("ctl00_mainContent_ddlCampus");
        const selectedValue = campusDropdown.value;

        if (selectedValue === "4") {
            clickLoginButton();
        } else {
            campusDropdown.value = "4";
            __doPostBack('ctl00$mainContent$ddlCampus', '');
        }
    }, 2000);

    function clickLoginButton() {
        const intervalId = setInterval(() => {
            const googlePlusButton = document.querySelector('span.fa.fa-google-plus');

            if (googlePlusButton) {
                googlePlusButton.click();
                clearInterval(intervalId);
            }
        }, 1000);
    }
})();