gimite / web-socket-js

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

web socket not working in frameset #155

Open eyalzf opened 9 years ago

eyalzf commented 9 years ago

Hi,

I'm trying to dynamically inject the web-socket-js scripts into a frameset based page and the scripts are not running. I'm guessing it has to do with the fact the script creates some elements on the body which are not being created since the body is frameset.

Any suggestions?

Thanks, Eyal

gimite commented 9 years ago

Hmm I have no idea. I haven't tried running it in a frameset, so there may be some issue. It would be great if you follow steps in "Troubleshooting" section of README: https://github.com/gimite/web-socket-js#troubleshooting Especially the output of Step 2 may give a hint.

rfox90 commented 9 years ago

You are correct: https://github.com/gimite/web-socket-js/blob/master/web_socket.js#L296

Shows where the swf holder is added to the document.

You could probably fork the repo and add a target option/function which could handle it.

Not using framesets would probably be best though. I don't have any idea of your project constraints though so :)

eyalzf commented 9 years ago

I'm injecting the code dynamically and I don't really have control over the underlying application structure.

Currently, as a workaround, I inject the script to one of the frames, create the WebSocket object through that frame and from that point I can use it in script in the top document.

I guess the same solution can be applied internally in the web_socket.js but I'm not sure it's the right way. On Nov 12, 2014 4:51 AM, "Richard Fox" notifications@github.com wrote:

You are correct: https://github.com/gimite/web-socket-js/blob/master/web_socket.js#L296

Shows where the swf holder is added to the document.

You could probably fork the repo and add a target option/function which could handling it.

Not using framesets would probably be best though. I don't have any idea of your project constraints though so :)

— Reply to this email directly or view it on GitHub https://github.com/gimite/web-socket-js/issues/155#issuecomment-62661664 .

rfox90 commented 9 years ago

Fork the repo, add some sort of user customizable way of specifying where the swf goes, defaulting to the current behaviour.

And chuck a pull request in.

Other people may find it handy :)