views:

48

answers:

1
+2  Q: 

Debug a Webworker

What's the best way to debug a webworker? My worker appears to be failing somewhere, but I don't appear to be able to log things to the console to figure out what's going on. Is there a way using firebug, or webkit's inspector I can run javascript in the webworker context? Is there a better way of doing this?

A: 

At the moment no browser supports debugging of web workers. I've tested

  • Chrome 7.0.517.24 dev
  • Firefox 3.6.10
  • WebKit nightly r68636

There is a nice article by Nicholas Zakas about debugging web workers.

Fabian Jakobs
This is essentially what I already had. Chrome has a pseudo-debugger for webworkers, but it basically just puts them in an iframe and connects the onmessage/postMessage handlers properly.
Michael