Jandan Copy

强力解除煎蛋复制限制

2015-11-29 기준 버전입니다. 최신 버전을 확인하세요.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==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");
});