You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's an interesting idea technology wise, though I haven't encountered too many projects that use time-based web workers. Is there a specific site or use case that you have in mind? Without a use case, it's unclear whether a new feature would adequately support it.
Some things to consider to implement this feature:
requestAnimationFrame, setTimeout, setInterval, Date, and performance functions are implemented in Web Workers
To sync with the parent web page (running at least in a regular web browser, and not a headless one), there'd need to be some coordination. postMessage is the traditional way of doing this (with a message channel to notify the parent when it's finished), but automatically doing this may interfere with existing code. Headless browsers like puppeteer or playwright, may already have ways of evaluating code in a web worker context (puppeteer has WebWorker.evaluate, and playwright has Worker.evaluate)
Workers traditionally import code via the importScripts function, which may serve as the way to include timeweb into a worker. For puppeteer and playwright, while there are ways to evaluate code inside web workers, there doesn't seem to be a way to evaluate it before any other code is run (contrasted with page.evaluateOnNewDocument or page.addInitScript which runs code on web pages before any other code is run)
No description provided.
The text was updated successfully, but these errors were encountered: