Techmny Bypasser for MoviesMod

Swiftly go through Techmny to reach your destination link.

// ==UserScript==
// @name         Techmny Bypasser for MoviesMod
// @namespace    https://naeembolchhi.github.io/
// @version      0.4
// @description  Swiftly go through Techmny to reach your destination link.
// @author       NaeemBolchhi
// @license      GPL-3.0-or-later
// @icon         https://moviesmod.vip/wp-content/uploads/2022/10/moviesmod.png
// @match        https://techmny.com/*
// @match        https://en.techmny.com/*
// @match        https://oddfirm.com/*
// @match        https://tech.unblockedgames.world/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

// Make everything disappear!
const voidCSS = `* {opacity: 0;z-index: -999999;}`;
function addStyle(css) {
    let head = document.querySelector('head'),
        style = document.createElement('style');
    style.innerHTML = css;
    head.appendChild(style);
}
let headObserver = new MutationObserver(function() {
    if (document.title) {
        addStyle(voidCSS.replace(';',' !important;'));
        headObserver.disconnect();
    }
});
headObserver.observe(document.documentElement, {childList: true, subtree: true});

// Bypass Page 1 #landing
function action1() {
    try {
        document.querySelector('#landing').submit();
        document.title = "Bypass Action (1/3)";
    } catch {}
}

// Bypass Page 2 #verify_button directly and skip waiting time
function action2() {
    try {
        document.querySelector('#verify_button').click();
        document.title = "Bypass Action (2/3)";
    } catch {}
}

// Bypass Page 2 #two_steps_btn by waiting and redirecting when link appears
function action3() {
    try {
        let observer = new MutationObserver(function() {
            if (document.querySelector('#two_steps_btn').href !== "") {
                observer.disconnect();
                document.title = "Bypass Action (3/3)";
                window.location = document.querySelector('#two_steps_btn').href;
            }
        });
        observer.observe(document.querySelector('#two_steps_btn'), {attributes: true});
    } catch {}
}

// Wait for page to be "complete"
document.onreadystatechange = function () {
    // Modify body when document is complete.
    if (document.readyState === 'complete') {
        action1();
        action2();
        action3();
    }
}