w3c / webdriver-bidi

Bidirectional WebDriver protocol for browser automation
https://w3c.github.io/webdriver-bidi/
336 stars 35 forks source link

Ability to terminate worker realms #694

Open OrKoN opened 3 months ago

OrKoN commented 3 months ago

Puppeteer offers a way to terminate/close workers. For dedicated workers, it can be done by evaluating a script calling self.close() but for other worker types it might not be so easy since the WebDriver instrumentation may prevent workers from closing. Service workers do not support self.close() method as well.

Perhaps, WebDriver BiDi should specify a command for closing a worker realm:

1) for service workers, following https://w3c.github.io/ServiceWorker/#terminate-service-worker 2) for other workers, following the self.close() algorithm

This is a useful command when testing lifecycle behavior of workers. cc @Lightning00Blade