Question

Our web application uses EventSource for server-sent events. In FireFox and Chrome everything's fine and everything works.

However, when I try to run a simple JAVA-application using WebKit (NetBeans JavaFX sample application "WebViewBrowser") the onmessage handler seems not to get called.

I tried to run the w3schools EventSource sample page and get the same result: FireFox and Chrome is fine. The sample "WebViewBrowser" is not.

Does anyone have any idea why?!

Update 1

(see comment below) I just noticed, that the constructor func EventSource is available but the object is not created.

var eventSrc = new EventSource('...');
// eventSrc is undefined now

I'm using JavaDK 1.7.0 (51)

Was it helpful?

Solution

Your version of WebKit is too old, is the first thought that comes to mind. (E.g. I've never got EventSource to work in PhantomJS 1.x for that reason.)

Try having your code connect to http://html5test.com/ and study the result (If that page says you do have EventSource support in your WebKit instance, let us know as it would mean something else is up.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top