For web editors

To develop a plugin for ONLYOFFICE web editors, follow the instructions below.

  1. Create a folder on your machine and put there the index.html and config.json files.

  2. Start distributing a folder. To do this, open the created folder and run the following commands:

    npm install http-server -g
    http-server -p <port> --cors
    

    where port is the port number with ONLYOFFICE Docs installed.

    CORS requests are needed so that plugin files can be loaded from any server.

  3. Open the developer console in any ONLYOFFICE web editor, go to the Console tab, choose the frameEditor from the drop-down list, and run the following command:

    Asc.editor.installDeveloperPlugin("https://<documentserver>:<port>/config.json");
    

    where documentserver is the name of the server, and port is the port number with the ONLYOFFICE Docs installed.

    Developer console

    The plugin will be displayed within the Plugins tab. You can edit the plugin and reload it to see the changes.

Debugging

To debug ONLYOFFICE plugins in the web editors, follow the instructions below.

  1. Add the debugger command to your script:
(function debugger(window, undefined){

 var text = "Hello world!";

 window.Asc.plugin.init = function init()
 {
     debugger;
     var variant = 2;

     switch (variant)
     {}
 };

 window.Asc.plugin.button = function button(id)
 {
 };

 })(window, undefined);
  1. Open the developer console by pressing the F12 button.

  2. Open the Plugins tab and run the plugin.

    Please note that the debugger command will only work if the development tools are open. Otherwise, the browser will ignore it.

    Builder debugger

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).