WSM Skip Core Values Modal

Skip Core Values Modal in WSM

Versione datata 11/10/2022. Vedi la nuova versione l'ultima versione.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name WSM Skip Core Values Modal
// @namespace WSM Scripts
// @description Skip Core Values Modal in WSM
// @icon https://wsm.sun-asterisk.vn/assets/wsm_logo_name-91525b18c1f7674362de380d12dc3fcb38026181774573818e847fce57cec573.png
// @run-at document-start
// @match *://wsm.sun-asterisk.vn/*
// @grant none
// @version 1.0.2
// ==/UserScript==

document.addEventListener('DOMContentLoaded', function (event) {
    var targetNode = document.documentElement || document.body;
    var config = { attributes: true, childList: true, subtree: true };
    var callback = function (mutations) {
        var count = 0;
        for (var i = 0; i < mutations.length; i++) {
            var mutation = mutations[i];
            if (!count) {
                count++;
                $('#remind-change-profile-modal button').click();
            }
        }
    };
    var observer = new MutationObserver(callback);
    (targetNode instanceof Element || targetNode instanceof HTMLDocument) && observer.observe(targetNode, config);
    setTimeout(function () {
        if ($('.container.container-f2a').is(':hidden')) {
            $('.wsm-btn.btn-login').trigger('click');
            $('#user_remember_me').trigger('click');

            console.log('timeout2000');
            setTimeout(function () {
                if ($('#user_email').val() && $('#user_password').val()) {
                    console.log($('#user_email').val());
                    $('#wsm-login-button').trigger('click');
                    setTimeout(function () {
                        $('#close-core-values-modal').removeClass('hidden').trigger('click');
                    }, 500);
                }
            }, 5000);
        }

        $('#user_otp_attempt').on('keyup', function (event) {
            var otp = $(event.target).val();
            if (otp && otp.length === 6) {
                $('#btn-login-f2a').trigger('click');
            }
        });
    }, 2000);
});