Force Full CKEditor

Forces CKEditor to always use the full editor

目前為 2019-03-08 提交的版本,檢視 最新版本

// ==UserScript==
// @name Force Full CKEditor
// @description Forces CKEditor to always use the full editor
// @author qsniyg
// @version 0.1
// @namespace Violentmonkey Scripts
// @include *
// @grant none
// @run-at document-start
// ==/UserScript==

(function() {
    var ck = null;
    Object.defineProperty(window, "CKEDITOR", {
        get: function() {
            if (ck && ck.replace && !ck.replace.injected) {
                var oldreplace = ck.replace;
                oldreplace.injected = true;
                ck.replace = function() {
                    if (arguments.length >= 2) {
                        if (typeof arguments[1] === "object") {
                            delete arguments[1]["toolbarGroups"];
                            delete arguments[1]["toolbar"];
                            delete arguments[1]["removeButtons"];
                        }
                    }
                    return oldreplace.apply(this, arguments);
                };
            }
            return ck;
        },
        set: function(x) {
            ck = x;
        }
    })
})();