ID:1746339
 
BYOND Version:507
Operating System:Windows 8 64-bit
Web Browser:Chrome 37.0.2062.120
Applies to:Webclient
Status: Open

Issue hasn't been assigned a status value.
When clicking the popout button in the bottom right-hand corner of the WebClient interface it doesn't actually pop out. It just redirects to the BYOND website that contains /embeded/play for the current game's link and adds ?popout=2 to the end of the URL (i.e. http://quaintsquad.tv/games/magick --> http://www.byond.com/play/embed/ qs3.quaintsquad.tv:7000?popout=2 ). It keeps the user logged in under the same username... However.. It causes them to relog, saying "Another connection has been made using your login key. This session has been terminated.". Which is just about the only flaw I can see.
This is all expected behavior--though we could possibly clarify it some more.

If the page is on our site directly in the regular play link, instead of play/embed, our site has scripting that allows the iframe to take up the full browser window. We have no such option in an embedded format. (I would like however to add something that would allow our embed frame to communicate with the outer page and find out if it has any webclient hooks, possibly providing the webclient a way to use that.) Right now all the embed can do is offer a link that will create a new window/tab.
I did some research. This allows the iframe to take up the whole window. There are probably some parameters in there that could be done away with. But, overall, this works.

Full iframe version:
<iframe src="http://www.byond.com/play/embed/embeded/qs3.quaintsquad.tv:7000" style="position:fixed; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;">
Your browser doesn't support IFrames
</iframe>

Simplified iframe version that I tested:
<iframe src="http://www.byond.com/play/embed/embeded/qs3.quaintsquad.tv:7000" style="position:fixed; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%; border:none;">
Your browser doesn't support IFrames
</iframe>


As for popping out, this is what I've found (I'll try looking for something that doesn't cause the iframe to reload):
<a href="http://www.byond.com/play/embed/embeded/qs3.quaintsquad.tv:7000" onclick="javascript:void window.open('http://www.byond.com/play/embed/embeded/qs3.quaintsquad.tv:7000','1419571960690','width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0');return false;">Pop-up Window</a>
I used a link with target=_blank for the popout specifically because window.open() can't be trusted. It's the engine that drives popup ads and is therefore blocked by many browsers.
Well, something for the "late" future would be to customize the buttons on the player. Even the buttons for controls. It's just not important now.

My question is... could you elaborate on what you mean by "webclient hooks"? My only guess would be to send a message to the server hosting the game? Topic() (who knows, I don't...)? Thus, telling it that the user is switching. As such, when the user logs in again from the same IP, it replaces the client information instead of attempting to make a new connection. What I'm probably saying is stupid by all means. But, it's a thought.
In response to Xirre
Xirre wrote:
Well, something for the "late" future would be to customize the buttons on the player. Even the buttons for controls. It's just not important now.

My question is... could you elaborate on what you mean by "webclient hooks"? My only guess would be to send a message to the server hosting the game? Topic() (who knows, I don't...)? Thus, telling it that the user is switching. As such, when the user logs in again from the same IP, it replaces the client information instead of attempting to make a new connection. What I'm probably saying is stupid by all means. But, it's a thought.

The hooks I'm referring to are on the client end. I'd like for the embed to be able to query the hosting page for functions that it can call via a window message. Right now that kind of thing is working in only a limited way.

But no, there's really no way to hand off the frame so that the websocket connection is maintained in another window. Browsers have certain limitations for security.