Adding plugins to ONLYOFFICE Cloud
You can add a plugin to the Cloud service as a Chrome extension.
- Create a main folder on your computer and put manifest.json
and main.js extension files.
- Create a subfolder with the plugin files.
-
In the main.js file, change the directory to the necessary plugin:
(function(window, undefined){
if ("frameEditor" == window.name)
{
var _url = chrome.extension.getURL("main.js");
_url = _url.substr(0, _url.lastIndexOf("main.js"));
var _baseUrl = _url + "helloworld/";
var _configUrl = _baseUrl + "config.json";
...
}
})(window, undefined);
-
Change the plugin name and description, the paths to the plugin icons and all the necessary plugin resources in the manifest.json file:
{
"name": "Asc.helloworld",
"description": "Plugin for ONLYOFFICE. helloworld",
"version": "1.0",
"manifest_version": 2,
"background": {
},
"browser_action": {
"default_icon": {
"19": "/helloworld/resources/img/icon.png",
"38": "/helloworld/resources/img/icon@2x.png"
}
},
"web_accessible_resources": [
"/main.js",
"/helloworld/scripts/helloworld.js",
"/helloworld/config.json",
"/helloworld/resources/img/icon.png",
"/helloworld/resources/img/icon@2x.png",
"/helloworld/index.html",
"/helloworld/index_about.html"
],
...
}
-
Launch your Chrome browser and go to chrome://extensions/. Turn on the Developer mode,
click the Load unpacked button and select the created main extension folder:
The new extension is now available in your browser:
-
Launch ONLYOFFICE Cloud and open any document to check if the new plugin is available in the editors:
Removing plugins from ONLYOFFICE Cloud
Click the Remove button on the extension tab and in the opened window confirm your action:
The plugin will be removed from ONLYOFFICE Cloud after its start.