[Pixlr] Bypass saves

Bypass saves in pixlr

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         [Pixlr] Bypass saves
// @namespace    https://greasyfork.org/users/821661
// @version      1.0
// @description  Bypass saves in pixlr
// @author       hdyzen
// @match        https://pixlr.com/*
// @icon         https://www.google.com/s2/favicons?domain=pixlr.com/&sz=64
// @grant        none
// @run-at       document-start
// @license      GPL-3.0-only
// ==/UserScript==

const observer = new MutationObserver(mutationsHandler)

observer.observe(document.documentElement, {
    childList: true,
    subtree: true
})

function mutationsHandler(muts) {
    for (const mut of muts) {
        for (const node of mut.addedNodes) {
            if (isNodeTarget(node)) handlerScript(node);
        }
    }
}

function isNodeTarget(node) {
    return node.tagName === "SCRIPT" && node.src?.includes("/dist/express.");
}

async function handlerScript(node) {
    const src = node.src;
    const content = await fetch(src).then(res => res.text());

    const newScript = document.createElement("script");
    newScript.textContent = content.replace("l()>=3", "false");
    document.head.appendChild(newScript);

    node.remove();
}