New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
history.back() breaks connection in chrome browser #21
Comments
Seems, Chrome stops request and fires abort event... |
similar problem with native EventSource |
It is better to establish SSE connection in worker |
Putting SSE in a worker does not help. The same behavior exists: hitting the back button aborts the connection and causes SSE to reconnect after the heartbeat timeout. Using the native EventSource, it will never reconnect. Another annoying behavior with Chrome is that while the SSE is running in one frame, and you navigate to other pages in a different frame, the page load will stall until the SSE connection is manually broken from the server side. Only then will it continue to load the rest of the elements on the page. It looks like all the GET's (to fetch images, etc) are pending and will not continue until either the SSE request completes or is broken. It's like the browser thinks all of the concurrent connections are in use and won't continue to load until the SSE completes even though its the only active connection. It seems that SSE is not well suited for frames. This is unfortunate as this seems like an ideal place to create a persistent connection to the server. I want a static frame that is always around to receive events while the user navigates through the site in another frame. Any other ideas/suggestions? |
Try SHARED web worker new SharedWorker("file.js"); it is separated from page context and back button can't affect this type of workers |
That seems to work for Chrome. However, SharedWorkers are not yet common in all current browsers so that means I'll have to do some custom browser detection. |
with frames you will have issues not only with EventSource, but with XHR and may be some other staff too |
Chrome should reconnect after "retry" delay now |
I have the sse running in a frame to maintain the persistent connection while navigating to various pages in a different frame. Whenever I click the "back" button, the connection to the server is lost. It will reconnect after the heartbeat timeout. Is this expected behavior? This does not happen when using IE.
The text was updated successfully, but these errors were encountered: