Jandan Copy

强力解除煎蛋复制限制

Versione datata 29/11/2015. Vedi la nuova versione l'ultima versione.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name        Jandan Copy
// @namespace   -
// @description 强力解除煎蛋复制限制
// @include     http://jandan.net/*
// @version     0.2
// @rut-at      document-start
// @copyright   mistree
// @grant       none
// ==/UserScript==

EventTarget.prototype.addEventListenerBase = EventTarget.prototype.addEventListener;
EventTarget.prototype.addEventListener = function(type, listener)
{
    if(type=="copy") return;
    if(!this.EventList) { this.EventList = []; }
    this.addEventListenerBase.apply(this, arguments);
    if(!this.EventList[type]) { this.EventList[type] = []; }
    var list = this.EventList[type];
    for(var index = 0; index != list.length; index++)
    {
        if(list[index] === listener) { return; }
    }
    list.push(listener);
};

EventTarget.prototype.removeEventListenerBase = EventTarget.prototype.removeEventListener;
EventTarget.prototype.removeEventListener = function(type, listener)
{
    if(!this.EventList) { this.EventList = []; }
    if(listener instanceof Function) { this.removeEventListenerBase.apply(this, arguments); }
    if(!this.EventList[type]) { return; }
    var list = this.EventList[type];
    for(var index = 0; index != list.length;)
    {
        var item = list[index];
        if(!listener)
        {
            this.removeEventListenerBase(type, item);
            list.splice(index, 1); continue;
        }
        else if(item === listener)
        {
            list.splice(index, 1); break;
        }
        index++;
    }
    if(list.length == 0) { delete this.EventList[type]; }
};

window.addEventListener("load", function()
{
    document.removeEventListener("copy");
});