Greasy Fork

Greasy Fork is available in English.

Symbolab Pro

Symbolab pro for free

当前为 2021-12-14 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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");
})();