4

If a web worker starts and then the user goes to another page or closes their browser, does the web worker still finish?

Andrius Naruševičius
  • 8,348
  • 7
  • 49
  • 78
Chad
  • 1,708
  • 1
  • 25
  • 44
  • possible duplicate of [What happens to an HTML5 web worker thread when the tab is closed while it's running?](http://stackoverflow.com/questions/8875310/what-happens-to-an-html5-web-worker-thread-when-the-tab-is-closed-while-its-run) – George Stocker Jun 06 '12 at 19:19

2 Answers2

3

The worker will terminate once all owners have been closed. If you have a shared worker it will stay alive until all owners are closed (it could exist in another tab, for example). Closing the browser will kill all workers always.

Jim
  • 2,300
  • 1
  • 19
  • 43
0

The web worker stops when the browser closes, since its not running on an external server.


Similar question

Community
  • 1
  • 1
Philip Kirkbride
  • 21,381
  • 38
  • 125
  • 225