msgEditApi allows to use simple function calls to create and edit thread messages & comments. Currently supported: article comments, blogs, forum threads and message wall threads (which technically are forum threads).


When ready, the script fires nmsgeditapi.ready hook via mw.hook, with interface object as first parameter. Exports: getMessage, setMessage, settings.

get active message content. Returns proxy to string and jQuery deferred object. Use getMessage().promise to access to the promise. String is keeped for backward-compatibility reasons, don't use it.
set active message content to "msg", if no active message found, add new message.
currrently, only "debug" parameter is exposed.

Note: in order to avoid headache with dealing with weird RTE content, getMessage and setMessage turns editor to source mode.


mw.hook('nmsgeditapi.ready').add(function (editApi) {
    editApi.setMessage(editApi.getMessage() + ' hi there');


Importing multiple scripts? This quick guide shows how to combine the imports.
  • For site-wide use, an administrator can add the line below to the wiki's MediaWiki:ImportJS page.
  • For personal use, add the code snippet below to your global.js page (for use on all wikis) or your common.js page on your wiki (for use on a single wiki). Note that personal JS must be enabled for your account.
    type: 'script',
    articles: [
Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+