No DisableDevTool

Break disable-devtool and devtools-detector while keeping the website working perfectly.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला 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              No DisableDevTool
// @name:zh-CN        放飞 disable-devtool
// @name:ja           disable-devtool をぶち壊せ
// @namespace         NoDisableDevTool
// @version           1.1.2
// @description       Break disable-devtool and devtools-detector while keeping the website working perfectly.
// @description:zh-CN 在禁用 disable-devtool 和 devtools-detector 的同时,使网站完美运行。
// @description:ja    disable-devtool と devtools-detector を壊すながら、ウェブサイトに影響を及ぼさず。
// @author            FurryR
// @match             *://*/*
// @license           MIT
// @grant             none
// @run-at            document-start
// ==/UserScript==

(function() {
    'use strict';

    if (document instanceof XMLDocument) {
        return;
    }

    const slice = Array.prototype.slice;
    Array.prototype.slice = function (...args) {
        if (args.length === 0 && Array.prototype.every.call(this, v => v && typeof v === 'object' && typeof v.name === 'string' && typeof v.isOpen === 'function' && typeof v.isEnable === 'function')) {
                Array.prototype.slice = slice;
                return [];
        }
        return slice.call(this, args);
    };

    const assign = Object.assign;
    Object.assign = function (...args) {
        if (args.length === 2 && typeof args[0] === 'function' && typeof args[1] === 'object' && args[1] !== null && typeof args[1].isDevToolOpened === 'function' && typeof args[1].version === 'string' && typeof args[1].isRunning === 'boolean' && typeof args[1].isSuspend === 'boolean') {
            Object.assign = assign;
            const result = Object.assign(...args);
            console.log('Detected disable-devtool component', result);
            return Object.assign(function () {
                console.trace('disable-devtool called here');
            }, args[1]);
        }
        return assign.call(this, ...args);
    }
})();