GW-Editer ON

EDIT THINGS LIKE A BOSS

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        GW-Editer ON
// @include     https://www.htacademy.org/
// @include     http://game.galaxywarfare.com*
// @version     1
// @namespace   http://hairballtech.wix.com/hb-chat
// @description EDIT THINGS LIKE A BOSS
// ==/UserScript==

var zNode       = document.createElement ('div');
zNode.innerHTML = '<button id="myButton2" type="button">'
                + 'Editer On</button>'
                ;
zNode.setAttribute ('id', 'myContainer2');
document.body.appendChild (zNode);


document.getElementById ("myButton2").addEventListener (
    "click", ButtonClickAction, true
);

function ButtonClickAction (zEvent) {
   
    var zNode       = document.body.contentEditable='true'; document.designMode='on'; void 0;
    zNode.innerHTML = '';
    document.getElementById ("myContainer2").appendChild (zNode);
}

GM_addStyle ( multilineStr ( function () {/*!
    #myContainer2 {
        position:               fixed;
        top:                    0;
        left:                   0;
        font-size:              12px;
        background:             ;
        border:                 0px outset black;
        margin:                 52px 12px;
        opacity:                10;
        z-index:                1000;
        padding:                0px 0px;
    }
    #myButton2 {
         color:                 #00ff00;
    background:                 #313131;
        cursor:                 pointer;
    }
*/} ) );

function multilineStr (dummyFunc) {
    var str = dummyFunc.toString ();
    str     = str.replace (/^[^\/]+\/\*!?/, '') 
            .replace (/\s*\*\/\s*\}\s*$/, '')   
            .replace (/\/\/.+$/gm, '')
            ;
    return str;
}