Try the fastest and simplest way to install ONLYOFFICE

Passing information to document editor plugin

Integration questions/issues

Passing information to document editor plugin

Postby ooeval » Thu Jul 19, 2018 4:10 pm


Using the Developer Edition and am writing a plugin for the document editor whose behaviour needs to change depending on some attributes about the document when editor session is launched. Editor is imbedded into a web application which is on a different host and port number to the web app.

I need to pass some information to the plugin window (iframe) when it is opened, or when it is opened it needs to read some information from the parent window containing the editor frame.

DOM structure is simplified as follows:

Web page (http://mywebapphost)
<div id=doceditor>..
<iframe name="frameEditor".. (src=http://docserverurl...)
<iframe name="pluginFrameEditor" ... (src=http://mywebapphost/sdkjs-plugins/pluginname....)
... plugin web page

I need to get some extra information I store in the top most web page regarding the document to the plugin. I have looked at postMessage as that can be used cross-domain if used correctly, however cannot get this to work.

What are the best strategies to get this information to the plugin and do you have any examples ?

I can make do with just the document editing "key" passed into the editor to start the session if that is available via the API...I can then make a web service call perhaps to get the additional information I need as I can derive this from the key. Ideally I would like to pass in as much information as I like to the plugin.

Posts: 4
Joined: Mon Nov 27, 2017 6:16 pm

Re: Passing information to document editor plugin

Postby Maxim » Fri Aug 10, 2018 9:27 am

Hello ooeval!
Try externallistener plugin
Posts: 1747
Joined: Tue Oct 11, 2016 2:34 pm

Return to API

Who is online

Users browsing this forum: No registered users and 2 guests