Search code examples
javascriptckeditorgreasemonkeyinvision-power-board

Use Greasemonkey to block CKEditor in "Invision Power Board" forums?


I'm quite sick of having to deal with CKEditor in Invision Power Board (IPB) and I'd like to use another editor.

I have already the other editor ready in a Greasemonkey script. The problem now is that I don't know how to prevent CKEditor from loading or just turn it off after loading so that my editor may execute in its place.

How do I "turn off" CKEditor?

For the ones who need:

Here's an IPB forum using CKEditor. It requires registering, though.

Here's a demo forum, but it's currently offline.


Solution

  • On the later versions of IPB (not the earlier free ones) if you block the load of the CKEditor javascript, IPB will present you with a plain <textarea> instead.

    In Firefox+Greasemonkey, you can block the CKEditor javascript with the brilliant checkForBadJavascripts utility. Like so:

    // ==UserScript==
    // @name        _Block CKEditor on the selected site(s)
    // @include     http://YOUR_SERVER.COM/YOUR_PATH/*
    // @require     https://gist.github.com/raw/2620135/checkForBadJavascripts.js
    // @run-at      document-start
    // @grant       GM_addStyle
    // ==/UserScript==
    /*- The @grant directive is needed to work around a design change
        introduced in GM 1.0.   It restores the sandbox.
    */
    
    checkForBadJavascripts ( [
        [true,  /ckeditor/i,  null ]
    ] );
    


    When you do that, IPB presents you with a <textarea> with class ipsEditor_textarea. For example:

    <textarea class="ipsEditor_textarea input_text" name="Post" id="editor_50b6f145efdd7">
    </textarea>
    


    You can then attach your editor to that.