0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

How to extend page editor of Confluene cloud

Posted at

Though I would like to extend the page editor of Confluence cloud with TinyMCE plugin, Confluence cloud add-on cannot extend it directly like a Confluence Server.

So I decided to use 'content script' of browser extension (I used Chrome extension).

The 'content script' can access page contents via dom, but cannot access js global variables.

To refer them, it has to inject scripts that will be executed in page context into page contents.

Note that public sample of registering TinyMCE plugin for Confluence Server is not available as it is, because the editor of Confluence Cloud(as of now) uses TinyMCE4.

It can be resolved by using AJS.Rte.BootstrapManager instead of tinymce-bootstrap, as following,

require(['confluence/module-exporter', 'com/excelimport/plugins', 'tinymce'], function(ex, ExcelImportPlugin, tinymce) {
 
        tinymce.create('tinymce.plugins.ExcelImportPlugin', ExcelImportPlugin);
 
        tinymce.PluginManager.add('excelimport', tinymce.plugins.ExcelImportPlugin);
 
        AJS.Rte.BootstrapManager.addTinyMcePluginInit(function(settings) {
            settings.plugins += ",excelimport";
            console.log(settings.plugins);
        });
 
    })

Additional note: In publishing Chrome addon, it will remains 'in review' unless you pay onetime registering fee($5). It is hard to notice it in new dashboard!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?