Customize context menu

I want to achieve the following functions in onlyoffice, but I can’t find the corresponding functions. Please guide me, thank you.

  1. Select a paragraph of text in interface onlyoffice, right click to open context menu, select a custom option in context menu to send the selected text back to the backend service.
  2. After the return is successful, replace the selected text with the returned content.

Additionaly, how can i hide the toolbar (in the red field) by using doc api.

Hello @ZangHoang,
Please take a look at these plugin methods:

As for hiding the View tab, it is not possible in Docs Community Edition.

currently, im using developer edition to display document file, how can i attach an event handler when selecting that option. Here is my code snippet

You can use this event for clicks on context menu options:

Please note that if you have a developer license, it is better to post requests via helpdesk.onlyoffice.com.