Hacker News new | ask | show | jobs
by masklinn 4953 days ago
> The problem is that while in a loop, the browser's event loop is not fired.

So by "the event loop is not fired" you mean "the event loop does not run" when you're already being run by the event loop? That seems to be... logical.

> You have to use setTimeout and break out of the loop.

You can also use e.g. window.postMessage. but yes to make the event loop run you do indeed have to yield to the event loop.

> and sometimes the browser chugs along even when you do use setTimeout.

Again, I'm not exactly clear on what you mean. Javascript has a toplevel event loop and a queue of fired events, when you yield to the event loops it runs the event queue in order, not sure what's surprising about this.

Hell, I'm not even sure this discussion makes sense as part of ECMAScript comments either, the event loop is not part of ECMAScript and it's perfectly possible to have JS runtimes with no event loops (the tracemonkey console for instance)

> Screengrabbing does make sense, and is required for web conferencing. All other features are there (audio/video/canvas), screengrabbing is the only one missing.

Reading comprehension. It happens to be a thing.

I didn't say screengrabbing made no sense, I said it made no sense as part of ECMAscript. It might make sense as part of WebRTC or as part of some DOM API, as part of ECMAScript it does not make any.