web worker console.log

ejang picture ejang · Aug 31, 2011 · Viewed 19.2k times · Source

Is it just me, or is console.log() too much to ask for from HTML5 web workers?

I know that manipulating the DOM is blocked because it is potentially dangerous, but is there really any possibility that console.log() could be maliciously exploited by a multithreaded worker?

Answer

ebidel picture ebidel · Aug 31, 2011

Agreed things would be a lot nicer, but it's not too hard to hack up a primitive console.log using postMessage. David Flanagan has a nice wrapper here.