WSM Skip Core Values Modal

Skip Core Values Modal in WSM

Stan na 11-10-2022. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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);
});