You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
Race condition on multiple instances of running app #100
Do we even allow having two windows from the same running application instance open? Note that this is different than having multiple instances of the same application running.
(not really related, but interesting: I was able to set "locaStorage" to a value in the window.open("test.html") window and then get it from the application once the pop-up window was closed).
window.open() opens another viewport, scripts in the originating context keep running
external links are not blocked
localStorage works as expected - same origin documents share the same DB
Actually, depending on configuration, external links may or may not be blocked or opened in platform browser (separate process, no access to system APIs).
In mobile, the window management is fairly trivial. If you open a new window, it is stacked on top of the old one. And you need to close the topmost window it in order to go back to the 'old/original' window.
However, in desktop the situation is more complex. That is, if window 'A' opens another window 'B', both of the windows can be visible at the same time. Also, the use can close either of the window at any time.
Currently, the specification does not deal with this (multi-window desktop case) at all. I think it is an important use case we need to address.
IMO the "Application" interface design may make the app development tough in multiple-windows environment.
For instance, an application with multiple windows opened may want to save some log (i.e. application termination time) when terminate. Then every window needs to register the onterminate handler for the Application interface, in order to make sure the callback happens even when other windows were closed. And the handler itself could be difficult to write too, it will be developer's responsibility to make the log saving only happens once a time.
related to #98, in multiple-windows environment what's the difference between a window.open(app_home_page), and a new instance of app with app_home_page? Will the Application interface reference to the same application?
IMO the "Application" interface design may make the app development tough in multiple-windows environment.
You made a really good point here. I think the original design concept was that there can be only one Application object per application, and all references should point to it. In multiple-windows-per-app scenario we run into trouble, as any of the contexts can:
call the hide() method, which should logically hide all the windows belonging to that app
register a handler for any of the events, in which case even after a window is closed, the UA must keep it alive as long as the handler is registered.
related to #98, in multiple-windows environment what's the difference between a window.open(app_home_page), and a new instance of app with app_home_page? Will the Application interface reference to the same application?
I think if you do window.open(app_home_page) from within that app, you should get a new window running as part of the same app.
@poussa I am studying the design principle of multiple window support in combination with chrome event page, and will work out an investigation report.
Activity
marcoscaceres commentedon Apr 29, 2013
See also/related: #98
jmajnert commentedon Apr 29, 2013
Do we even allow having two windows from the same running application instance open? Note that this is different than having multiple instances of the same application running.
marcoscaceres commentedon Apr 29, 2013
Firefox OS currently does allow this (window.open() opens another viewport). Can you check in Tizen?
Here is the code I used (for a hosted web app):
Note that in firefox OS the open() causes the document to be overlaid ontop of the original application.
marcoscaceres commentedon Apr 29, 2013
Note also that I can open both internal and external links.
marcoscaceres commentedon Apr 29, 2013
(not really related, but interesting: I was able to set "locaStorage" to a value in the window.open("test.html") window and then get it from the application once the pop-up window was closed).
jmajnert commentedon Apr 30, 2013
In Tizen:
jmajnert commentedon Apr 30, 2013
Actually, depending on configuration, external links may or may not be blocked or opened in platform browser (separate process, no access to system APIs).
poussa commentedon May 8, 2013
In mobile, the window management is fairly trivial. If you open a new window, it is stacked on top of the old one. And you need to close the topmost window it in order to go back to the 'old/original' window.
However, in desktop the situation is more complex. That is, if window 'A' opens another window 'B', both of the windows can be visible at the same time. Also, the use can close either of the window at any time.
Currently, the specification does not deal with this (multi-window desktop case) at all. I think it is an important use case we need to address.
seanlong commentedon May 8, 2013
IMO the "Application" interface design may make the app development tough in multiple-windows environment.
For instance, an application with multiple windows opened may want to save some log (i.e. application termination time) when terminate. Then every window needs to register the onterminate handler for the Application interface, in order to make sure the callback happens even when other windows were closed. And the handler itself could be difficult to write too, it will be developer's responsibility to make the log saving only happens once a time.
seanlong commentedon May 8, 2013
related to #98, in multiple-windows environment what's the difference between a window.open(app_home_page), and a new instance of app with app_home_page? Will the Application interface reference to the same application?
jmajnert commentedon May 9, 2013
You made a really good point here. I think the original design concept was that there can be only one Application object per application, and all references should point to it. In multiple-windows-per-app scenario we run into trouble, as any of the contexts can:
I think if you do window.open(app_home_page) from within that app, you should get a new window running as part of the same app.
seanlong commentedon May 10, 2013
Agree. I think maybe that's why Chromium has event page for its packaged app.
Then how about Application interface for multiple application instances? How to identify which Application refer to which instance?
jmajnert commentedon May 10, 2013
Yes. This interface and system message handling fits nice with the event page concept
poussa commentedon May 10, 2013
Chrome event page model for the packaged apps is handling the multi-windows case nicely. I think we should take a look of that and learn from it.
hmin commentedon Jun 20, 2013
@poussa I am studying the design principle of multiple window support in combination with chrome event page, and will work out an investigation report.
marcoscaceres commentedon Jun 20, 2013
@hmin @poussa yeah, we are thinking the same thing over on the Moz side. See @annevk's email on public-webapps.