Login

22:09:36 16/12/2024

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

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);
    }
})();