EventSource and the infinite spinner

172 views
Skip to first unread message

Luigi Montanez

unread,
Mar 2, 2011, 6:37:55 PM3/2/11
to Chromium HTML5
I'm trying out EventSource:

http://www.html5rocks.com/tutorials/eventsource/basics/

When I open an EventSource connection and leave it open, Chrome's page-
is-loading spinner in the tab spins as long as the connection is open.
Similarly, the user is presented the X for stop button -- the refresh
button never renders. To the user, it looks like the page never fully
loads.

So it seems that for as long as I keep an EventSource connection open,
Chrome doesn't think that the page is loaded, even though I wait to
open the EventSource connection upon DOM ready. If I press the X for
stop button, the EventSource connection closes, which isn't really
what I want.

Is this the correct behavior? When I was using WebSockets, the spinner
wouldn't spin when the socket connection was open.

- Luigi

Luigi Montanez

unread,
Mar 3, 2011, 11:04:08 AM3/3/11
to Chromium HTML5
Follow-up: If I open the EventSource connection from the console, I
don't get the spinner (good!).

But the problem persists if I open the connection inside jQuery's $
(window).load(), which I think should be effectively the same thing as
opening the connection from the console.

PhistucK

unread,
Mar 4, 2011, 3:58:03 AM3/4/11
to Luigi Montanez, Chromium HTML5
Perhaps hack it up with setTimeout(function_to_create_an_event_source, 40); (inside $(window).load()) to make it asynchronous and unrelated to the loading of the page.

PhistucK



--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To post to this group, send email to chromiu...@chromium.org.
To unsubscribe from this group, send email to chromium-html...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-html5/?hl=en.


Luigi Montanez

unread,
Mar 4, 2011, 9:31:58 AM3/4/11
to Chromium HTML5
Thanks, that worked.

On Mar 4, 3:58 am, PhistucK <phist...@gmail.com> wrote:
> Perhaps hack it up with setTimeout(function_to_create_an_event_source, 40);
> (inside $(window).load()) to make it asynchronous and unrelated to the
> loading of the page.
>
> ☆*PhistucK*
> > To post to this group, send email to chromium-ht...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-html5+unsubscr...@chromium.org.
Reply all
Reply to author
Forward
0 new messages