For web editors
To develop a plugin for ONLYOFFICE web editors, follow the instructions below.
-
Create a folder on your machine and place the index.html and config.json files there.
-
Start serving the folder. To do this, open the created folder and run the following commands:
npm install http-server -g
http-server -p <port> --corswhere
portis the port number on which to serve the plugin files.noteCORS requests are needed so that plugin files can be loaded from any server.
-
Open the developer console in any ONLYOFFICE web editor, go to the Console tab, choose the
frameEditorfrom the drop-down list, and run the following command:Asc.editor.installDeveloperPlugin("https://<documentserver>:<port>/config.json");where
documentserveris the server address where the plugin files are being served (e.g.,localhost), andportis the port number from step 2.noteIf you're using
http-serverwithout SSL configuration, usehttp://instead ofhttps://in the URL.
The plugin will be displayed within the Plugins tab. You can edit the plugin and reload it to see the changes.