Remove Limits - ALL KILL

ALL-KILL solution for removing limits on the website

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Remove Limits - ALL KILL
// @name:zh-CN   移除限制 - 通杀
// @namespace    http://tampermonkey.net/
// @version      0.2.0
// @description  ALL-KILL solution for removing limits on the website
// @description:zh-CN 用于移除网站限制的通杀解决方案
// @match        none
// @author       PRO
// @run-at       document-start
// @license      gpl-3.0
// ==/UserScript==

(function () {
    "use strict";
    const debug = false;
    const log = debug ? console.log.bind(console, "[Remove Limits]") : () => { };
    // === JavaScript Part ===
    // Stop listeners that might hinder right-click menu, selection, etc.
    const events = ["contextmenu", "select", "selectstart", "copy", "cut", "dragstart"];
    events.forEach((event) => {
        document.addEventListener(event, (e) => {
            e.stopImmediatePropagation();
        }, { capture: true });
    });
    // === CSS Part ===
    const userSelectAliases = ["-webkit-touch-callout", "-webkit-user-select", "-moz-user-select", "-ms-user-select", "user-select"];
    // Remove CSS rules that might hinder user selection
    function removeUserSelect(styleSheet) {
        for (const rule of styleSheet.cssRules) { // Might encounter a SecurityError
            if (!rule instanceof CSSStyleRule || !rule.style) continue; // Not what we're looking for
            // Iterate over its styles
            for (const property of rule.style) {
                if (userSelectAliases.includes(property) && rule.style.getPropertyValue(property) === "none") {
                    rule.style.removeProperty(property); // Remove the property
                    log(`Removed "${property}" from rule:`, rule);
                }
            }
        }
    }
    document.addEventListener("DOMContentLoaded", () => {
        // Remove all `user-select: none` declarations
        for (const styleSheet of document.styleSheets) {
            try {
                removeUserSelect(styleSheet);
            } catch (e) {
                if (e instanceof DOMException && e.name === "SecurityError") {
                    log("Caught a SecurityError while trying to read a CSS rule. This is expected if the CSS rule is from a different origin.");
                } else {
                    log("An unexpected error occurred while trying to read a CSS rule:", e);
                }
            }
        }
    });
    // Allow selection using CSS (not needed anymore in most cases)
    const style = document.createElement("style");
    style.textContent = `* {
        ${userSelectAliases.map((alias) => `${alias}: unset !important;`).join("\n")}
    }`;
    document.head.appendChild(style);
})();