Skip to content
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

setting the overflow style on the body breaks flash socket #67

Open
brettkiefer opened this issue Apr 15, 2011 · 5 comments
Open

setting the overflow style on the body breaks flash socket #67

brettkiefer opened this issue Apr 15, 2011 · 5 comments

Comments

@brettkiefer
Copy link

Repro

  1. Connect to a server via flash sockets in Firefox 4 on Windows 7 (and maybe elsewhere)
  2. Open Firebug
  3. Run document.body.setAttribute('style', 'overflow:auto');

. . . and for some reason, the socket disconnects.

@gimite
Copy link
Owner

gimite commented Apr 20, 2011

It seems Flash object is reloaded on setting overflow attribute in Firefox for unknown reason.
One workaround is to set the overflow attribute before loading WebSocketMain.swf. If you do that in window.onload or even before, it's probably fine. Or you can set

WEB_SOCKET_DISABLE_AUTO_INITIALIZATION = true;

before loading web_socket.js and manually call WebSocket.__initialize(); after setting the attribute.

Please let me know if you find any better workaround.

@bobbygrace
Copy link

Thanks for the workaround! Our issue is that we have to set the overflow attribute after the flash socket has been initialized and sent messages. We're experimenting with using a top level div so we don't have to set overflow on the body. Thanks again!

@scottschiller
Copy link

A side note to this - setting display:none or switching position: between absolute/relative on the element, or its parents will cause the SWF to reload or partially restart, and that will break things (I've seen this with SoundManager 2, which uses JS/Flash extensively as well.) Firefox may also not actually start the SWF if wmode is set to transparent/opaque and the SWF is outside of the current view (ie., bottom of the page or off-screen.) Oh, fun! :)

@brettkiefer
Copy link
Author

Okay, got it - 10-year-old bug: https://bugzilla.mozilla.org/show_bug.cgi?id=90268
Thank you for the workarounds; as Bobby says, we can't use 'em in this case, but I appreciate the help all the same!

@gimite
Copy link
Owner

gimite commented Apr 22, 2011

This is definitely an issue (of Firefox, though), so I'll keep it open but label it as "will not fix". Thanks for the information.

@gimite gimite reopened this Apr 22, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants