Hi Bob, Bob Thulfram <[email protected]> 於 2013/11/28 下午4:23 寫道: > My questions is this: if an app is open (but not in the foreground), is it > "running" or "halted"? Does it take up resources? Or like some other phone > systems, does it start shutting down older "open" apps when it runs out of > memory? What is the application lifecycle about for a Firefox OS app? Anyone > know? Any references to this? What does an app do when no one is looking?
There's no 'halted' states for web apps. We only have foreground/background states and in most cases it's app's duty to pause something when it knows it's at background by 'visibilitychange' event. If you want to know more about app life cycle, please see my WIP presentation. https://docs.google.com/presentation/d/1JKe6locw6sjq7KBkEUZrCqVKrjb2Ew4HcnFZL_a_k4Y/edit?usp=sharing NOTE: Really WIP and skip many things now. My next task is improving this. > So my real question is, should we be allowed to quit an app in our code? My > idea is to put a button that says "Quit" on one of the main screens. Or is > this undesirable or a security risk? No, you could query 'window.close' in gaia code base then you would see many apps are using this way to close. Any web app, actually, is a "special" iframe embedded in b2g system app, so what b2g does to app calls window.close is just to remove the app's iframe from the DOM tree. -- Alive C. Kuo, Front-end Engineer, FirefoxOS, MoCo. Taiwan, Taipei office. [email protected] _______________________________________________ dev-b2g mailing list [email protected] https://lists.mozilla.org/listinfo/dev-b2g
