Symbolab Pro

Symbolab pro for free

目前為 2021-12-14 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Symbolab Pro
// @namespace    http://tampermonkey.net/
// @version      1.4
// @description  Symbolab pro for free
// @author       J. Lawrence Dev Pro Tips
// @match        https://www.symbolab.com/
// @include      *://*symbolab.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    "use strict";

    var code = `window.onload = function(){
        const signedIn = !!document.getElementById("userName").title.trim();

        if (signedIn) {
            // initialize constants
            const url = location.href;
            const langMatch = url.match('//([a-z]{2})\.symbolab');
            const lang = langMatch ? langMatch[1] : 'en';
            
            // reinitialize SymbolabSteps with subscribed set to true
            SYSTEPS = new SymbolabSteps(lang, 'true', null, url);
            
            // reinitialize Solutions with subscribed set to true
            SOLUTIONS = new Solutions("", "step-by-step", htmlDecode(SYMBOLAB.params.query),htmlDecode(''), '0', '', lang, 'true');
            SOLUTIONS.init();

            // prevent paywall from appearing when verify solution is clicked
            $("#click-capture").addClass("click-capture-subscribed");
        }

        // warn user if not logged in
        else {
            // create a tooltip popup next to the sign in link to tell the user they must log in
            const joinEl = document.getElementById("join");
            const warning = document.createElement("div");
            const styles = {
                position: "absolute",
                top: "49px",
                right: "0px",
                width: "260px",
                height: "185px",
                backgroundColor: "rgb(255 255 255)",
                zIndex: "9999",
                padding: "1em",
                fontSize: "150%",
                lineHeight: "1.5em",
                border: "2px solid red",
            };
            Object.assign(warning.style, styles);
            warning.innerHTML =
                "<h4>Viewing step-by-step solutions is only possible when logged in.</h4>" +
                "</h4><p>Sign in or create a free account to continue.</p>";
            // close button
            const closeButton = document.createElement("button");
            closeButton.innerHTML = "&times;";
            const closeStyles = {
                position: "absolute",
                top: "0px",
                right: "0px",
                fontSize: "150%",
                fontWeight: "bold",
                cursor: "pointer",
                background: "none",
                border: "none",
            };
            Object.assign(closeButton.style, closeStyles);
            closeButton.addEventListener("click", () => {
                warning.style.display = "none";
            });
            warning.appendChild(closeButton);
            joinEl.appendChild(warning);
        }
    }`;

    // make sure the code runs before the subscription status is checked
    document.documentElement.setAttribute("onreset", code);
    document.documentElement.dispatchEvent(new CustomEvent("reset"));
    document.documentElement.removeAttribute("onreset");
})();