On Friday, November 22, 2013 10:38:50 AM UTC-8, Daniel Roesler wrote:
> You can force close applications by pressing and holding the Home
> 
> button. This will show the list of open windows (swipe side to side),
> 
> and you can close the ones you want by tapping the "X" in the corner.
> 
> 
> 
> Thought window.close() does work. Do you have an example app that
> 
> shows how window.close() doesn't work, because I would love to see it.
> 
> Can you please link to a bug report? Thanks!
> 
> 
> 
> On Fri, Nov 22, 2013 at 10:34 AM, Bob Thulfram <thulf...@gmail.com> wrote:
> 
> > On Thursday, November 21, 2013 1:02:19 AM UTC-8, Bob Thulfram wrote:
> 
> >> When I have an app running on the phone and it stops (because I killed a 
> >> timing loop), is there a way to refresh it? If I hit the home button and 
> >> restart the app, it just seems to come back where it was.
> 
> >>
> 
> >>
> 
> >>
> 
> >> Also, is there a way to pro grammatically through JavaScript stop an app 
> >> from running? Or restart it?
> 
> >>
> 
> >>
> 
> >>
> 
> >> Finally, neither cancelAnimationFrame or mozCancelAnimationFrame seem to 
> >> work. Anyone know what the story is? They work fine in the browser and in 
> >> the emulator, but not on the 1.0 ZTE Open phone.
> 
> >>
> 
> >>
> 
> >>
> 
> >> Thanks!
> 
> >
> 
> > I've done more thought and research, and here are my conclusions.
> 
> >
> 
> > 1. window.close() is not an option.
> 
> >
> 
> > 2. cancelAnimationFrame just doesn't seem to work right now.
> 
> >
> 
> > 3. but wrapping my calls to requestAnimationFrame in a setTimeout timer 
> > works because I can stop the setTimeout timer. I'll write this up on Monday 
> > on my blog at http://firefoxosgaming.blogspot.com/.
> 
> >
> 
> > I still wish ZTE/Firefox OS had some equivalent of a task manager so I 
> > could stop apps but not uninstall them.
> 
> > _______________________________________________
> 
> > dev-b2g mailing list
> 
> > dev-b2g@lists.mozilla.org
> 
> > https://lists.mozilla.org/listinfo/dev-b2g

Sorry for the confusion about window.close(). It works just fine, but the 
behavior is different from what I have been used to. I can't just close the 
page, I can only close a page if I opened it separately from my main page. The 
documentation is very clear, so not a bug. 
https://developer.mozilla.org/en-US/docs/Web/API/Window.close.

Try this:

<DOCTYPE! html>
<html>
<head>
</head>
<body>
<h1 onclick="window.close();">CLOSE ME</h1>
</body>
</html>

Click on the heading "CLOSE ME". In Chrome and Safari, it closes the window. In 
IE, it closes the window but asks you first. In Firefox (all versions) it does 
nothing. This is a feature, not a bug. There is probably a security feature 
here somewhere. 

I didn't understand that pressing the Home button brought up the task manager! 
If I just tap the Home button, the app goes away (but is still "running"?). But 
if I give a long press to the Home button, I can see what's running and kill. 

Is this like some other phone OS concepts where the app stays in memory until 
there's no room and then the oldest app dies? 

Thanks for the tip. This will help me a lot when I have a runaway app, though I 
wonder about performance if I close an app like mine (by tapping Home) and it's 
still running in the background. Or is it running? 

Anyway, I'm going to see if I can kill all my timers and halt execution. Still 
can't kill requestAnimationFrame, though.



_______________________________________________
dev-b2g mailing list
dev-b2g@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to