GauthMath Bypass Paywall newer version

Bypass the paywall and hopefully jailbreak the site

لا ينبغي أن لا يتم تثبيت هذا السكريت مباشرة. هو مكتبة لسكبتات لتشمل مع التوجيه الفوقية // @require https://update.greasyfork.org/scripts/488027/1331884/GauthMath%20Bypass%20Paywall%20newer%20version.js

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.

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         GauthMath Bypass Paywall newer version
// @namespace    http://tampermonkey.net/
// @version      2.5
// @license      MIT
// @description  Bypass the paywall and hopefully jailbreak the site
// @author       Viruszy
// @match        https://www.gauthmath.com/
// @match        https://www.gauthmath.com/calculator
// @match        https://www.gauthmath.com/search-question?questionID=1791612050420741&action=image_search
// @match        https://www.gauthmath.com/solution/1782791331021829/
// @match        https://www.gauthmath.com/solution/1782791331021829/
// @match        https://www.gauthmath.com/solution/1782635516057605/
// @icon         a photo of gauthmath symbol
// @grant        none
// ==/UserScript==

(function () {
    'use strict';
    const elementsToRemove = [
        "[data-testid^='ad_below_']" //Annoying video ads
    ];
    //simulating button click to keep native Gauth Math functionality without needing additional code.
    const elementsToClick = [
        "[data-testid='registration_toplayer_close_button']", //Login popup/modal close button
        '[aria-label="Close this dialog window"]' //Promotion popup/modal close button
    ];
    const config = { attributes: true, childList: true, subtree: true };
    let timeoutID = 0;
    let mutationObserver;
    const mutationCallback = () => {
        mutationObserver.disconnect();
        for (let query of elementsToRemove) {
            let nodes = document.querySelectorAll(query);
            for (let node of nodes)
                node.remove();
        }
        for (let query of elementsToClick) {
            let nodes = document.querySelectorAll(query);
            for (let node of nodes)
                if (timeoutID === 0)
                    timeoutID = setTimeout(() => { timeoutID = 0; node.click(); }, 500);
        }
        mutationObserver.observe(document.body, config);
    }
    try {
        localStorage.clear();
    } catch (err) {
        console.error("Couldn't clear local storage, the browser is most likely blocking access to it. (are all cookies being blocked?)");
        console.error(err);
    }
    document.addEventListener("DOMContentLoaded", () => {
        mutationObserver = new MutationObserver(mutationCallback);
        mutationCallback();
        // Remove paywall elements
    function bypassPaywall() {
        const paywallElement = document.getElementById('paywall'); // Adjust the ID based on the actual paywall element
        if (paywallElement) {
            paywallElement.remove();
        }
    }
         // Enable Gauthplus features
    function enableGauthplus() {
        // Simulate successful Gauthplus subscription
        localStorage.setItem('isGauthplus', 'true');
    }

    // Check if user has Gauthplus subscription
    function hasGauthplus() {
        return localStorage.getItem('isGauthplus') === 'true';
    }

    // Main function
    function main() {
        bypassPaywall();
        if (!hasGauthplus()) {
            enableGauthplus();
        }
    }
    });
})();