gimite / web-socket-js

HTML5 Web Socket implementation powered by Flash
BSD 3-Clause "New" or "Revised" License
2.73k stars 488 forks source link

Flash WebSocket initialization fails when trying to load dynamically after page has loaded. #3

Closed TooTallNate closed 14 years ago

TooTallNate commented 14 years ago

I've been trying to get this working with Safari (4.0.4, Snow Leopard), with no success. This is from both a file:/// URI and when hosted on a web server. Works perfectly so far with IE and Firefox however...

gimite commented 14 years ago

Hmm it works fine with my Safari 4.0.4 on WinXP. I don't have Mac so I cannot debug it further myself... A few questions:

TooTallNate commented 14 years ago

Ok, so after some investigation, I realized that WebSocket.__initialize() was not being called, due to the fact that I was loading "web_socket.js" after the "onload" event had already fired, and thus

window.addEventListener("load", WebSocket.__initialize, false);

wasn't doing the trick. I ended up calling it manually and it worked fine in Safari.

gimite commented 14 years ago

I see. So do you use some technique to load web_socket.js dynamically, not with static script tag? I'll try to find way to make it work properly in that case too. Thanks.

TooTallNate commented 14 years ago

Precisely, I wasn't using your sample.html, I was using my own test file that was appending the needed Githubissues.

  • Githubissues is a development platform for aggregating issues.