ONLYOFFICE / sdkjs-plugins

The add-ons for ONLYOFFICE Document Server and ONLYOFFICE Desktop Editors.
https://www.onlyoffice.com
Apache License 2.0
136 stars 134 forks source link

Can't run callCommand function in plugin when document is opened in view mode #164

Open oszymanski opened 3 years ago

oszymanski commented 3 years ago

What is the current behavior?

Hello, I cannot get this code to work when document editor mode is set to 'view'.

window.Asc.plugin.callCommand(function () { var activeSheet = Api.GetActiveSheet() var currentPage = Api.GetCurrentVisiblePage(); }

What is the expected behavior?

I assume that callCommand is blocked in view mode in order to prevent the file from being edited, but sadly it also prevents me from getting any information about the document (I need current page/sheet the most but getting page size would be very useful).

DocumentServer version:

I've pulled the latest docker image of Developer Edition so I assume it's version 6.4

Operating System:

Windows running Docker Desktop

Browser version:

Chrome, but it doesn't really work on any browser.

PS. Is there any way around this? I'd appreciate any suggestion. Thank you :)

ShockwaveNN commented 3 years ago

Hi, first of all - please fill out issue template correctly - specify version of product and host os

oszymanski commented 3 years ago

Hi, first of all - please fill out issue template correctly - specify version of product and host os

Done, edited, sorry for the inconvenience

ShockwaveNN commented 3 years ago

@askonev please take a look, I think we already had some discussion about plugins in view mode, but I'm not sure

askonev commented 2 years ago

@oszymanski Hi! Wrote enhancement in our internal repository #55230

ShockwaveNN commented 2 years ago

This issue is closely related to https://github.com/ONLYOFFICE/sdkjs-plugins/issues/164

anti-the-social commented 1 year ago

Any progress/plans with this issue?