WSM Skip Core Values Modal

Skip Core Values Modal in WSM

  1. // ==UserScript==
  2. // @name WSM Skip Core Values Modal
  3. // @namespace WSM Scripts
  4. // @description Skip Core Values Modal in WSM
  5. // @icon https://wsm.sun-asterisk.vn/assets/wsm_logo_name-91525b18c1f7674362de380d12dc3fcb38026181774573818e847fce57cec573.png
  6. // @run-at document-start
  7. // @match *://wsm.sun-asterisk.vn/*
  8. // @grant none
  9. // @version 1.0.3
  10. // ==/UserScript==
  11.  
  12. document.addEventListener('DOMContentLoaded', function (event) {
  13. var targetNode = document.documentElement || document.body;
  14. var config = { attributes: true, childList: true, subtree: true };
  15. var callback = function (mutations) {
  16. var count = 0;
  17. for (var i = 0; i < mutations.length; i++) {
  18. var mutation = mutations[i];
  19. if (!count) {
  20. count++;
  21. $('#remind-change-profile-modal').modal('hide');
  22. }
  23. }
  24. };
  25. var observer = new MutationObserver(callback);
  26. (targetNode instanceof Element || targetNode instanceof HTMLDocument) && observer.observe(targetNode, config);
  27. setTimeout(function () {
  28. if ($('.container.container-f2a').is(':hidden')) {
  29. $('.wsm-btn.btn-login').trigger('click');
  30. $('#user_remember_me').trigger('click');
  31.  
  32. console.log('timeout2000');
  33. setTimeout(function () {
  34. if ($('#user_email').val() && $('#user_password').val()) {
  35. console.log($('#user_email').val());
  36. $('#wsm-login-button').trigger('click');
  37. setTimeout(function () {
  38. $('#close-core-values-modal').removeClass('hidden').trigger('click');
  39. }, 500);
  40. }
  41. }, 5000);
  42. }
  43.  
  44. $('#user_otp_attempt').on('keyup', function (event) {
  45. var otp = $(event.target).val();
  46. if (otp && otp.length === 6) {
  47. $('#btn-login-f2a').trigger('click');
  48. }
  49. });
  50. }, 2000);
  51. });