skip to Main Content

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.

2

Answers


  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

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search