Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save matthewpenkala/909535551f7cadb973e6714a062781e4 to your computer and use it in GitHub Desktop.
Save matthewpenkala/909535551f7cadb973e6714a062781e4 to your computer and use it in GitHub Desktop.
re-enable right click (bookmarklet)
javascript:(function(w){
var arr = ['contextmenu','copy','cut','paste','mousedown','mouseup','beforeunload','beforeprint'];
for(var i = 0, x; x = arr[i]; i++){
if(w['on' + x])w['on' + x] = null;
w.addEventListener(x, function(e){e.stopPropagation()}, true);
};
for(var j = 0, f; f = w.frames[j]; j++){try{arguments.callee(f)}catch(e){}}})(window);
@matthewpenkala
Copy link
Author

matthewpenkala commented Mar 6, 2023

MISC. ENABLE R CLICK kyo-agoenable-right-click

(function () {
    function Mutation(callback) {
        this.isCalled = false;
        this.isUnbound = false;
        this.callback = callback;
        this.events = ['DOMAttrModified', 'DOMNodeInserted', 'DOMNodeRemoved', 'DOMCharacterDataModified', 'DOMSubtreeModified'];
        this.bind();
    }
    Mutation.prototype.bind = function () {
        this.events.forEach(function (name) {
            document.addEventListener(name, this, true);
        }.bind(this));
    };
    Mutation.prototype.handleEvent = function () {
        this.isCalled = true;
        this.unbind();
    };
    Mutation.prototype.unbind = function () {
        if (this.isUnbound) {
            return;
        }
        this.events.forEach(function (name) {
            document.removeEventListener(name, this, true);
        }.bind(this));
        this.isUnbound = true;
    };

    function Synchronizetion() {
        this._setTimeout = window.setTimeout;
        this._requestAnimationFrame = window.requestAnimationFrame;
        this._Promise = window.Promise;
        this.isRestoration = false;
        this.calledPromise = false;
        window.requestAnimationFrame = window.setTimeout = function (callback) {
            callback();
        };
        window.Promise = function () {
            this._Promise.apply(this, arguments);
            this.calledPromise = true;
            window.Promise = this._Promise;
        };
    }
    Synchronizetion.prototype.restore = function () {
        if (this.isRestoration) {
            return;
        }
        window.setTimeout = this._setTimeout;
        window.requestAnimationFrame = this._requestAnimationFrame;
        if (!this.calledPromise) {
            window.Promise = this._Promise;
        }
        this.isRestoration = true;
    };

    function EventHandler(event) {
        this.event = event;
        this.contextmenuEvent = this.createEvent(this.event.type);
        this.mouseupEvent = this.createEvent('mouseup');
        this.isCanceled = this.contextmenuEvent.defaultPrevented;
    }
    EventHandler.prototype.createEvent = function (type) {
        var target = this.event.target;
        var event = target.ownerDocument.createEvent('MouseEvents');
        event.initMouseEvent(type, this.event.bubbles, this.event.cancelable,
            target.ownerDocument.defaultView, this.event.detail,
            this.event.screenX, this.event.screenY, this.event.clientX, this.event.clientY,
            this.event.ctrlKey, this.event.altKey, this.event.shiftKey, this.event.metaKey,
            this.event.button, this.event.relatedTarget
        );
        return event;
    };
    EventHandler.prototype.fire = function () {
        var target = this.event.target;
        var contextmenuHandler = function (event) {
            this.isCanceled = event.defaultPrevented;
            event.preventDefault();
        }.bind(this);
        window.addEventListener(this.event.type, contextmenuHandler, false);
        target.dispatchEvent(this.contextmenuEvent);
        window.removeEventListener(this.event.type, contextmenuHandler, false);
        this.isCanceled = this.contextmenuEvent.defaultPrevented;
        target.dispatchEvent(this.mouseupEvent);
    };

    var disableRightClick = false;
    window.addEventListener('message', function (event) {
        if (!event.data || event.data.type !== 'enable-right-click') {
            return;
        }
        disableRightClick = !!event.data.disableRightClick;
        event.stopPropagation();
        event.stopImmediatePropagation();
    }, true);

    window.addEventListener('contextmenu', handleEvent, true);

    function handleEvent(event) {
        if (disableRightClick) {
            return;
        }

        event.stopPropagation();
        event.stopImmediatePropagation();
        var handler = new EventHandler(event);

        window.removeEventListener(event.type, handleEvent, true);
        var sync = new Synchronizetion();
        var mutation = new Mutation(function () {
            sync.restore();
        });

        var _alert = window.alert;
        window.alert = function () {};
        handler.fire();
        window.alert = _alert;

        sync.restore();
        mutation.unbind();
        window.addEventListener(event.type, handleEvent, true);

        if (handler.isCanceled && (mutation.isCalled || sync.calledPromise)) {
            event.preventDefault();
        }
    }
})();

@matthewpenkala
Copy link
Author

matthewpenkala commented Mar 6, 2023

PART ONE [minified]

!function(){function e(){[].forEach.call("contextmenu copy cut paste mouseup mousedown keyup keydown drag dragstart select selectstart".split(" "),function(t){document.addEventListener(t,function(t){t.stopPropagation()},!0)})}var t=document.createElement("style"),n=document.head;t.type="text/css";var i,c,o,a=!(t.innerText="* {\n        -webkit-user-select: text !important;\n        -moz-user-select: text !important;\n        -ms-user-select: text !important;\n         user-select: text !important;\n    }"),s=RegExp("youtube.com|.google.|.google.com|greasyfork.org|twitter.com|instagram.com|facebook.com|translate.google.com|.amazon.|.ebay.|github.|stackoverflow.com|bing.com|live.com|.microsoft.com|dropbox.com|pcloud.com|box.com|sync.com|onedrive.com|mail.ru|deviantart.com|pastebin.com|dailymotion.com|twitch.tv|spotify.com|steam.com|steampowered.com|gitlab.com|.reddit.com").exec(window.location.hostname);window&&null!=n&&(i=function(){this.h=["DOMAttrModified","DOMNodeInserted","DOMNodeRemoved","DOMCharacterDataModified","DOMSubtreeModified"],this.bind()},c=function(t){this.event=t,this.g=this.createEvent(this.event.type)},s||1==a||(o=document,s=document.body,o.oncontextmenu=null,o.onselectstart=null,o.ondragstart=null,o.onmousedown=null,s.oncontextmenu=null,s.onselectstart=null,s.ondragstart=null,s.onmousedown=null,s.oncut=null,s.oncopy=null,s.onpaste=null,[].forEach.call(["copy","cut","paste","select","selectstart"],function(t){document.addEventListener(t,function(t){t.stopPropagation()},!0)}),RegExp("example.com|www.example.com").exec(location.hostname)&&e(),function(){try{GM_registerMenuCommand("Enable Absolute Right Click Mode",function(){return 1==confirm("Activate Absolute Right Click Mode!")?e():null})}catch(t){console.log(t)}}(),n.appendChild(t),document.addEventListener("keydown",function(t){if(t.ctrlKey&&192==t.keyCode)return 1==confirm("Activate Absolute Right Click Mode!")?e():null}),a=!0,window.addEventListener("contextmenu",function t(e){e.stopPropagation(),e.stopImmediatePropagation();var n=new c(e);window.removeEventListener(e.type,t,!0);var o=new i;n.i(),window.addEventListener(e.type,t,!0),n.l&&o.j&&e.preventDefault()},!0)),i.prototype.bind=function(){this.h.forEach(function(t){document.addEventListener(t,this,!0)}.bind(this))},i.prototype.handleEvent=function(){this.j=!0},c.prototype.createEvent=function(t){var e=this.event.target,n=e.ownerDocument.createEvent("MouseEvents");return n.initMouseEvent(t,this.event.bubbles,this.event.cancelable,e.ownerDocument.defaultView,this.event.detail,this.event.screenX,this.event.screenY,this.event.clientX,this.event.clientY,this.event.ctrlKey,this.event.altKey,this.event.shiftKey,this.event.metaKey,this.event.button,this.event.relatedTarget),n},c.prototype.i=function(){var t=this.event.target;(function(t){t.preventDefault()}).bind(this),t.dispatchEvent(this.g),this.l=this.g.defaultPrevented})}(),function(t){for(var e,n="contextmenu copy cut paste mousedown mouseup beforeunload beforeprint".split(" "),o=0;e=n[o];o++)t["on"+e]&&(t["on"+e]=null),t.addEventListener(e,function(t){t.stopPropagation()},!0);for(n=0;e=t.frames[n];n++)try{arguments.callee(e)}catch(t){}}(window);

@matthewpenkala
Copy link
Author

matthewpenkala commented Mar 6, 2023

PART TWO [minified]

!function(){function r(){this.s=this.m=!1,this.l=["DOMAttrModified","DOMNodeInserted","DOMNodeRemoved","DOMCharacterDataModified","DOMSubtreeModified"],this.bind()}function a(){this.A=window.setTimeout,this.v=window.requestAnimationFrame,this.g=window.Promise,this.h=this.o=!1,window.requestAnimationFrame=window.setTimeout=function(t){t()},window.Promise=function(){this.g.apply(this,arguments),this.h=!0,window.Promise=this.g}}function h(t){this.event=t,this.i=this.createEvent(this.event.type),this.C=this.createEvent("mouseup"),this.j=this.i.defaultPrevented}r.prototype.bind=function(){this.l.forEach(function(t){document.addEventListener(t,this,!0)}.bind(this))},r.prototype.handleEvent=function(){this.m=!0,this.u()},r.prototype.u=function(){this.s||(this.l.forEach(function(t){document.removeEventListener(t,this,!0)}.bind(this)),this.s=!0)},a.prototype.restore=function(){this.o||(window.setTimeout=this.A,window.requestAnimationFrame=this.v,this.h||(window.Promise=this.g),this.o=!0)},h.prototype.createEvent=function(t){var e=this.event.target,i=e.ownerDocument.createEvent("MouseEvents");return i.initMouseEvent(t,this.event.bubbles,this.event.cancelable,e.ownerDocument.defaultView,this.event.detail,this.event.screenX,this.event.screenY,this.event.clientX,this.event.clientY,this.event.ctrlKey,this.event.altKey,this.event.shiftKey,this.event.metaKey,this.event.button,this.event.relatedTarget),i};var d=!(h.prototype.B=function(){var t=this.event.target,e=function(t){this.j=t.defaultPrevented,t.preventDefault()}.bind(this);window.addEventListener(this.event.type,e,!1),t.dispatchEvent(this.i),window.removeEventListener(this.event.type,e,!1),this.j=this.i.defaultPrevented,t.dispatchEvent(this.C)});window.addEventListener("message",function(t){t.data&&"enable-right-click"===t.data.type&&(d=!!t.data.D,t.stopPropagation(),t.stopImmediatePropagation())},!0),window.addEventListener("contextmenu",function t(e){var i,n,o,s;d||(e.stopPropagation(),e.stopImmediatePropagation(),i=new h(e),window.removeEventListener(e.type,t,!0),n=new a,o=new r,s=window.alert,window.alert=function(){},i.B(),window.alert=s,n.restore(),o.u(),window.addEventListener(e.type,t,!0),i.j&&(o.m||n.h)&&e.preventDefault())},!0)}(),function(t){for(var e,i="contextmenu copy cut paste mousedown mouseup beforeunload beforeprint".split(" "),n=0;e=i[n];n++)t["on"+e]&&(t["on"+e]=null),t.addEventListener(e,function(t){t.stopPropagation()},!0);for(i=0;e=t.frames[i];i++)try{arguments.callee(e)}catch(t){}}(window);

@matthewpenkala
Copy link
Author

! function () {
    function e() {
        [].forEach.call('contextmenu copy cut paste mouseup mousedown keyup keydown drag dragstart select selectstart'.split(' '), function (t) {
            document.addEventListener(t, function (t) {
                t.stopPropagation();
            }, !0);
        });
    }
    var t = document.createElement('style'),
        n = document.head;
    t.type = 'text/css';
    var i, c, o, a = !(t.innerText = '* {\n        -webkit-user-select: text !important;\n        -moz-user-select: text !important;\n        -ms-user-select: text !important;\n         user-select: text !important;\n    }'),
        s = RegExp('youtube.com|.google.|.google.com|greasyfork.org|twitter.com|instagram.com|facebook.com|translate.google.com|.amazon.|.ebay.|github.|stackoverflow.com|bing.com|live.com|.microsoft.com|dropbox.com|pcloud.com|box.com|sync.com|onedrive.com|mail.ru|deviantart.com|pastebin.com|dailymotion.com|twitch.tv|spotify.com|steam.com|steampowered.com|gitlab.com|.reddit.com').exec(window.location.hostname);
    window && null != n && (i = function () {
        this.h = [
            'DOMAttrModified',
            'DOMNodeInserted',
            'DOMNodeRemoved',
            'DOMCharacterDataModified',
            'DOMSubtreeModified'
        ], this.bind();
    }, c = function (t) {
        this.event = t, this.g = this.createEvent(this.event.type);
    }, s || 1 == a || (o = document, s = document.body, o.oncontextmenu = null, o.onselectstart = null, o.ondragstart = null, o.onmousedown = null, s.oncontextmenu = null, s.onselectstart = null, s.ondragstart = null, s.onmousedown = null, s.oncut = null, s.oncopy = null, s.onpaste = null, [].forEach.call([
        'copy',
        'cut',
        'paste',
        'select',
        'selectstart'
    ], function (t) {
        document.addEventListener(t, function (t) {
            t.stopPropagation();
        }, !0);
    }), RegExp('example.com|www.example.com').exec(location.hostname) && e(), function () {
        try {
            GM_registerMenuCommand('Enable Absolute Right Click Mode', function () {
                return 1 == confirm('Activate Absolute Right Click Mode!') ? e() : null;
            });
        } catch (t) {
            console.log(t);
        }
    }(), n.appendChild(t), document.addEventListener('keydown', function (t) {
        if (t.ctrlKey && 192 == t.keyCode)
            return 1 == confirm('Activate Absolute Right Click Mode!') ? e() : null;
    }), a = !0, window.addEventListener('contextmenu', function t(e) {
        e.stopPropagation(), e.stopImmediatePropagation();
        var n = new c(e);
        window.removeEventListener(e.type, t, !0);
        var o = new i();
        n.i(), window.addEventListener(e.type, t, !0), n.l && o.j && e.preventDefault();
    }, !0)), i.prototype.bind = function () {
        this.h.forEach(function (t) {
            document.addEventListener(t, this, !0);
        }.bind(this));
    }, i.prototype.handleEvent = function () {
        this.j = !0;
    }, c.prototype.createEvent = function (t) {
        var e = this.event.target,
            n = e.ownerDocument.createEvent('MouseEvents');
        return n.initMouseEvent(t, this.event.bubbles, this.event.cancelable, e.ownerDocument.defaultView, this.event.detail, this.event.screenX, this.event.screenY, this.event.clientX, this.event.clientY, this.event.ctrlKey, this.event.altKey, this.event.shiftKey, this.event.metaKey, this.event.button, this.event.relatedTarget), n;
    }, c.prototype.i = function () {
        var t = this.event.target;
        (function (t) {
            t.preventDefault();
        }.bind(this), t.dispatchEvent(this.g), this.l = this.g.defaultPrevented);
    });
}(),
function (t) {
    for (var e, n = 'contextmenu copy cut paste mousedown mouseup beforeunload beforeprint'.split(' '), o = 0; e = n[o]; o++)
        t['on' + e] && (t['on' + e] = null), t.addEventListener(e, function (t) {
            t.stopPropagation();
        }, !0);
    for (n = 0; e = t.frames[n]; n++)
        try {
            arguments.callee(e);
        } catch (t) {}
}(window);
! function () {
    function r() {
        this.s = this.m = !1, this.l = [
            'DOMAttrModified',
            'DOMNodeInserted',
            'DOMNodeRemoved',
            'DOMCharacterDataModified',
            'DOMSubtreeModified'
        ], this.bind();
    }

    function a() {
        this.A = window.setTimeout, this.v = window.requestAnimationFrame, this.g = window.Promise, this.h = this.o = !1, window.requestAnimationFrame = window.setTimeout = function (t) {
            t();
        }, window.Promise = function () {
            this.g.apply(this, arguments), this.h = !0, window.Promise = this.g;
        };
    }

    function h(t) {
        this.event = t, this.i = this.createEvent(this.event.type), this.C = this.createEvent('mouseup'), this.j = this.i.defaultPrevented;
    }
    r.prototype.bind = function () {
        this.l.forEach(function (t) {
            document.addEventListener(t, this, !0);
        }.bind(this));
    }, r.prototype.handleEvent = function () {
        this.m = !0, this.u();
    }, r.prototype.u = function () {
        this.s || (this.l.forEach(function (t) {
            document.removeEventListener(t, this, !0);
        }.bind(this)), this.s = !0);
    }, a.prototype.restore = function () {
        this.o || (window.setTimeout = this.A, window.requestAnimationFrame = this.v, this.h || (window.Promise = this.g), this.o = !0);
    }, h.prototype.createEvent = function (t) {
        var e = this.event.target,
            i = e.ownerDocument.createEvent('MouseEvents');
        return i.initMouseEvent(t, this.event.bubbles, this.event.cancelable, e.ownerDocument.defaultView, this.event.detail, this.event.screenX, this.event.screenY, this.event.clientX, this.event.clientY, this.event.ctrlKey, this.event.altKey, this.event.shiftKey, this.event.metaKey, this.event.button, this.event.relatedTarget), i;
    };
    var d = !(h.prototype.B = function () {
        var t = this.event.target,
            e = function (t) {
                this.j = t.defaultPrevented, t.preventDefault();
            }.bind(this);
        window.addEventListener(this.event.type, e, !1), t.dispatchEvent(this.i), window.removeEventListener(this.event.type, e, !1), this.j = this.i.defaultPrevented, t.dispatchEvent(this.C);
    });
    window.addEventListener('message', function (t) {
        t.data && 'enable-right-click' === t.data.type && (d = !!t.data.D, t.stopPropagation(), t.stopImmediatePropagation());
    }, !0), window.addEventListener('contextmenu', function t(e) {
        var i, n, o, s;
        d || (e.stopPropagation(), e.stopImmediatePropagation(), i = new h(e), window.removeEventListener(e.type, t, !0), n = new a(), o = new r(), s = window.alert, window.alert = function () {}, i.B(), window.alert = s, n.restore(), o.u(), window.addEventListener(e.type, t, !0), i.j && (o.m || n.h) && e.preventDefault());
    }, !0);
}(),
function (t) {
    for (var e, i = 'contextmenu copy cut paste mousedown mouseup beforeunload beforeprint'.split(' '), n = 0; e = i[n]; n++)
        t['on' + e] && (t['on' + e] = null), t.addEventListener(e, function (t) {
            t.stopPropagation();
        }, !0);
    for (i = 0; e = t.frames[i]; i++)
        try {
            arguments.callee(e);
        } catch (t) {}
}(window);

@matthewpenkala
Copy link
Author

matthewpenkala commented Mar 6, 2023

FINAL VERSION [minified] ↓

@matthewpenkala
Copy link
Author

!function(){function e(){[].forEach.call("contextmenu copy cut paste mouseup mousedown keyup keydown drag dragstart select selectstart".split(" "),function(t){document.addEventListener(t,function(t){t.stopPropagation()},!0)})}var t=document.createElement("style"),n=document.head;t.type="text/css";var i,s,o,r=!(t.innerText="* {\n        -webkit-user-select: text !important;\n        -moz-user-select: text !important;\n        -ms-user-select: text !important;\n         user-select: text !important;\n    }"),a=RegExp("youtube.com|.google.|.google.com|greasyfork.org|twitter.com|instagram.com|facebook.com|translate.google.com|.amazon.|.ebay.|github.|stackoverflow.com|bing.com|live.com|.microsoft.com|dropbox.com|pcloud.com|box.com|sync.com|onedrive.com|mail.ru|deviantart.com|pastebin.com|dailymotion.com|twitch.tv|spotify.com|steam.com|steampowered.com|gitlab.com|.reddit.com").exec(window.location.hostname);window&&null!=n&&(i=function(){this.h=["DOMAttrModified","DOMNodeInserted","DOMNodeRemoved","DOMCharacterDataModified","DOMSubtreeModified"],this.bind()},s=function(t){this.event=t,this.g=this.createEvent(this.event.type)},a||1==r||(o=document,a=document.body,o.oncontextmenu=null,o.onselectstart=null,o.ondragstart=null,o.onmousedown=null,a.oncontextmenu=null,a.onselectstart=null,a.ondragstart=null,a.onmousedown=null,a.oncut=null,a.oncopy=null,a.onpaste=null,[].forEach.call(["copy","cut","paste","select","selectstart"],function(t){document.addEventListener(t,function(t){t.stopPropagation()},!0)}),RegExp("example.com|www.example.com").exec(location.hostname)&&e(),function(){try{GM_registerMenuCommand("Enable Absolute Right Click Mode",function(){return 1==confirm("Activate Absolute Right Click Mode!")?e():null})}catch(t){console.log(t)}}(),n.appendChild(t),document.addEventListener("keydown",function(t){if(t.ctrlKey&&192==t.keyCode)return 1==confirm("Activate Absolute Right Click Mode!")?e():null}),r=!0,window.addEventListener("contextmenu",function t(e){e.stopPropagation(),e.stopImmediatePropagation();var n=new s(e);window.removeEventListener(e.type,t,!0);var o=new i;n.i(),window.addEventListener(e.type,t,!0),n.l&&o.j&&e.preventDefault()},!0)),i.prototype.bind=function(){this.h.forEach(function(t){document.addEventListener(t,this,!0)}.bind(this))},i.prototype.handleEvent=function(){this.j=!0},s.prototype.createEvent=function(t){var e=this.event.target,n=e.ownerDocument.createEvent("MouseEvents");return n.initMouseEvent(t,this.event.bubbles,this.event.cancelable,e.ownerDocument.defaultView,this.event.detail,this.event.screenX,this.event.screenY,this.event.clientX,this.event.clientY,this.event.ctrlKey,this.event.altKey,this.event.shiftKey,this.event.metaKey,this.event.button,this.event.relatedTarget),n},s.prototype.i=function(){var t=this.event.target;(function(t){t.preventDefault()}).bind(this),t.dispatchEvent(this.g),this.l=this.g.defaultPrevented})}(),function(t){for(var e,n="contextmenu copy cut paste mousedown mouseup beforeunload beforeprint".split(" "),o=0;e=n[o];o++)t["on"+e]&&(t["on"+e]=null),t.addEventListener(e,function(t){t.stopPropagation()},!0);for(n=0;e=t.frames[n];n++)try{arguments.callee(e)}catch(t){}}(window),function(){function r(){this.s=this.m=!1,this.l=["DOMAttrModified","DOMNodeInserted","DOMNodeRemoved","DOMCharacterDataModified","DOMSubtreeModified"],this.bind()}function a(){this.A=window.setTimeout,this.v=window.requestAnimationFrame,this.g=window.Promise,this.h=this.o=!1,window.requestAnimationFrame=window.setTimeout=function(t){t()},window.Promise=function(){this.g.apply(this,arguments),this.h=!0,window.Promise=this.g}}function c(t){this.event=t,this.i=this.createEvent(this.event.type),this.C=this.createEvent("mouseup"),this.j=this.i.defaultPrevented}r.prototype.bind=function(){this.l.forEach(function(t){document.addEventListener(t,this,!0)}.bind(this))},r.prototype.handleEvent=function(){this.m=!0,this.u()},r.prototype.u=function(){this.s||(this.l.forEach(function(t){document.removeEventListener(t,this,!0)}.bind(this)),this.s=!0)},a.prototype.restore=function(){this.o||(window.setTimeout=this.A,window.requestAnimationFrame=this.v,this.h||(window.Promise=this.g),this.o=!0)},c.prototype.createEvent=function(t){var e=this.event.target,n=e.ownerDocument.createEvent("MouseEvents");return n.initMouseEvent(t,this.event.bubbles,this.event.cancelable,e.ownerDocument.defaultView,this.event.detail,this.event.screenX,this.event.screenY,this.event.clientX,this.event.clientY,this.event.ctrlKey,this.event.altKey,this.event.shiftKey,this.event.metaKey,this.event.button,this.event.relatedTarget),n};var d=!(c.prototype.B=function(){var t=this.event.target,e=function(t){this.j=t.defaultPrevented,t.preventDefault()}.bind(this);window.addEventListener(this.event.type,e,!1),t.dispatchEvent(this.i),window.removeEventListener(this.event.type,e,!1),this.j=this.i.defaultPrevented,t.dispatchEvent(this.C)});window.addEventListener("message",function(t){t.data&&"enable-right-click"===t.data.type&&(d=!!t.data.D,t.stopPropagation(),t.stopImmediatePropagation())},!0),window.addEventListener("contextmenu",function t(e){var n,o,i,s;d||(e.stopPropagation(),e.stopImmediatePropagation(),n=new c(e),window.removeEventListener(e.type,t,!0),o=new a,i=new r,s=window.alert,window.alert=function(){},n.B(),window.alert=s,o.restore(),i.u(),window.addEventListener(e.type,t,!0),n.j&&(i.m||o.h)&&e.preventDefault())},!0)}(),function(t){for(var e,n="contextmenu copy cut paste mousedown mouseup beforeunload beforeprint".split(" "),o=0;e=n[o];o++)t["on"+e]&&(t["on"+e]=null),t.addEventListener(e,function(t){t.stopPropagation()},!0);for(n=0;e=t.frames[n];n++)try{arguments.callee(e)}catch(t){}}(window);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment