Hi Members,
I’m currently integrating an ONLYOFFICE document preview/editor into my website, and I’m experiencing an intermittent issue where the embedded document becomes unresponsive after a visitor navigates around the website and then returns to the page containing the ONLYOFFICE component. The document normally loads correctly when the page is opened for the first time, and users can view the document without any immediate problem. However, after moving to another page and returning to the document page, the embedded editor can sometimes remain stuck in its loading state or display the document interface without responding to normal interactions. A complete browser refresh usually causes it to load and behave normally again. The problem is therefore not a permanent failure of the ONLYOFFICE integration, because the same document can work correctly immediately after a fresh page load. What I’m trying to understand is why the embedded ONLYOFFICE instance does not consistently initialize correctly when the visitor returns to the page during the same browsing session. The website itself continues working normally during this process, so the issue appears to be specifically related to the lifecycle of the embedded ONLYOFFICE instance inside the webpage.
I have checked the basic integration configuration because I wanted to rule out an incorrect document URL or a permanently invalid editor configuration. The document can be opened successfully when the page is loaded directly, and the website is able to create the expected configuration for the embedded ONLYOFFICE component. I have also tested the same document several times without changing the underlying file, and the initial loading behavior is generally consistent. The problem begins when the existing page instance is left and the visitor later returns to the document page. Depending on how the navigation occurs, the editor may initialize normally or may appear to be left in a previous state. A full browser reload clears that state and allows the editor to initialize again, which makes me suspect that the issue could involve how the website handles the embedded editor when the surrounding page is unloaded or replaced. I’m not intentionally creating multiple editor instances on the same page, so I’m trying to determine whether an earlier ONLYOFFICE instance could still have some client-side state associated with it when the visitor returns. I would appreciate guidance on whether there is a recommended initialization and cleanup procedure for ONLYOFFICE integrations when the containing website uses repeated page navigation.
The behavior is especially noticeable when a visitor opens the document, leaves the page, visits another part of the website, and then returns to the document. During a successful load, the editor becomes available normally and the document can be interacted with as expected. During a failed load, however, the page may display the surrounding website correctly while the ONLYOFFICE area remains stuck or does not become fully interactive. There is not always a clear JavaScript exception in the browser console, which makes it difficult to identify the exact point where initialization stops. I have been comparing successful and unsuccessful attempts using the browser developer tools, particularly the network activity generated when the editor is initialized. I want to determine whether the required ONLYOFFICE resources are being requested again when the page is revisited or whether the browser is retaining an earlier instance of the editor. Since refreshing the entire browser page makes the issue disappear, I’m wondering whether the embedded editor expects a completely new document context or whether the integration needs to explicitly destroy the previous editor object before another instance is created. I don’t want to add arbitrary delays or force a complete browser reload as a workaround because that would make the website navigation less efficient for visitors.
I have also reviewed the way the website creates the ONLYOFFICE configuration because I want to make sure that each initialization receives the correct document information. The document identifier and related configuration values are generated as part of the page setup, and the document can be loaded correctly when the page is accessed directly. I have not intentionally changed the document configuration between successful and unsuccessful tests, so there does not appear to be a simple difference in the document itself that explains the behavior. My main concern is whether the embedded editor has a specific lifecycle that the surrounding website needs to respect. If an editor instance remains attached to a DOM element after navigation or if the same container is reused without properly cleaning up the previous instance, I can imagine that the second initialization might not behave the same way as the first. At the same time, I don’t want to assume this is the cause without confirmation because the issue could also be related to how the website’s navigation system recreates page content. I’m particularly interested in knowing whether ONLYOFFICE provides an officially recommended method for destroying an existing editor instance and initializing a new one when a page is revisited, and whether there are specific events or callbacks that should be monitored during this process.
For troubleshooting, I have been trying to reproduce the problem using the same document and navigation sequence rather than changing multiple parts of the integration at once. I open the document page, allow the editor to finish loading, navigate away, return to the same page, and then check whether the editor initializes normally. I repeat this process several times because the issue is intermittent and does not happen on every return to the page. When the problem occurs, a browser refresh generally restores normal behavior, which gives me a useful comparison between a fresh document context and a reused website session. I would like to know which logs or browser-side diagnostics are most useful for determining what ONLYOFFICE is doing during the failed initialization. For example, if there is a particular console message, API request, editor callback, or document-server response that should appear whenever an editor instance is successfully initialized, I could compare that with the failed case. I’m also interested in whether the document server has any relevant logs that can indicate whether the second initialization request actually reached it. My goal is to trace the problem from the website navigation event through the JavaScript initialization and finally to the ONLYOFFICE document server, so I can identify exactly where the reused page state causes the editor to stop responding.
Has anyone encountered a similar situation where an ONLYOFFICE editor or document preview works correctly on the initial website visit but can become stuck or unresponsive after navigating away from the page and returning without performing a full browser refresh? I’m mainly looking for the correct integration pattern for handling the editor lifecycle when the surrounding website repeatedly creates and removes the page containing the ONLYOFFICE component. If there is a recommended way to destroy the previous editor instance, clear its container, and initialize a fresh instance when the page becomes active again, I would appreciate an example of the expected approach. I would also like to know whether there are any specific considerations around browser caching, JavaScript initialization timing, iframe state, or document-server communication that could explain why a fresh browser reload consistently works while normal website navigation sometimes does not. The rest of the website continues operating correctly, and the document itself is valid, so I’m trying to keep the investigation focused specifically on the ONLYOFFICE embedded editor lifecycle. Any advice on which client-side events, callbacks, network requests, or document-server logs I should compare between a successful first load and a failed return to the page would be very helpful in identifying why the editor becomes unresponsive and how to make its initialization reliable without forcing visitors to manually refresh the entire website. Sorry for long post!