8

I'm coming up with the idea of detaching elements onto popup windows. Make a popup with window.open(), set up some elements in that document and add event listeners to serve the original purpose, but as a popup window component. All of this works, and it seems that the created window is handled by the same thread.

Is this "technique" bug-prone by any chance? I.g: If I create a canvas in the popup window and get a WebGL context from it, will it work flawlessly? If I set a bunch of event listeners there, will I get callbacks from them without any delay?

I couldn't do my research on this one because almost no one does this. Through my life, I've seen many sites use popup windows for user inputs but not for interactive or real timey stuff. I'm building a web app that's complex that utilising multiple monitors would benefit in user experience. You know, at least I know how painful it is to have two monitors and be unable to use both of them because all the component of the app is cramped in a single window. Just imagine using an MDI version of Photoshop where all the toolbox is within the MDI area and you can't get them out of the app window. A web page is exactly that.

  • 1
    Microsoft Dynamics CRM does this extensively. It's quite "real-timey". Doubt this will help you research their techniques further, but it's one example that comes to mind. FWIW, I have two monitors yet Dynamics CRM can still be frustrating to use with all its multiple windows; you still need to carefully think through _how_ these multiple windows work or it might end up worse than a single window UI. – Roman Starkov Nov 20 '17 at 11:44
  • It's a public facing web app or an internal one? In other words, you have control of the environment? – fruggiero Nov 20 '17 at 14:54
  • @fruggiero No. It's targeted the general public. Talking about a flight sim like Kerbal Space Program. –  Nov 21 '17 at 14:05
  • @RomanStarkov Thanks. I'll be sure to use the demo. –  Nov 21 '17 at 14:08

2 Answers2

1

Although this is non-conventional it definitely seems to suit the requirement you mentioned. I don't see any issues when it comes to the browser support for handling rendition or communication across the windows, it's just that you will need to be more careful with your code. Something like make frequent checks in case user has closed one of your pop-ups(or register a window close callback so that you can make necessary adjustments).

Eventing across the windows should also be fine. Refer http://help.dottoro.com/ljrwrqew.php which has exactly same example of attaching the event callback from one window to another.

Another good read is http://www.infimum.dk/HTML/JSwindows.html

Anurag Sinha
  • 1,014
  • 10
  • 17
0

One possible drawback could be that the popup can be blocked by the browser popup blocker (but yes, you could inform the user to don't block the popup coming from your web application)

Another one could be that the dimensions of the popup that you specify on your javascript code could be not respected (this is at the discretion of the browser), so for example one browser could open anytime the popup in a new tab or a new maximized window.

Here you will find some ready made experiments with multi-window: https://experiments.withgoogle.com/chrome?tag=Multi-Window

For data sharing between your main window and your popup you shouldn't have any problem.

Something to keep in mind is that not every browser use the same threading model, so you must do some performance tests as well on all the browser you will want to support and see the differences.

fruggiero
  • 943
  • 12
  • 20