ferrum icon indicating copy to clipboard operation
ferrum copied to clipboard

Service worker support

Open johncoates-st opened this issue 2 years ago • 3 comments

browser.network.traffic isn't working for traffic that happens in service workers. Has this been considered? I could put together a pull request if pointed in the right direction for implementing this feature.

johncoates-st avatar Aug 16 '23 20:08 johncoates-st

@johncoates-st you could check https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/ and then:

  1. Add ServiceWorker.enable feature in https://github.com/rubycdp/ferrum/blob/main/lib/ferrum/page.rb#L357. Though I'm not sure about behavior or if it even fits well network domain.

  2. Run one of the specs for network with log debug like: FERRUM_DEBUG=true rspec spec/network_spec.rb:5 and see how CDP communication works for Chrome.

  3. For service workers I think you need to add one more endpoint to our test application with some custom JS, and also test the communication.

route avatar Aug 17 '23 04:08 route

Thanks for the references and guidance @route

johncoates-st avatar Aug 17 '23 21:08 johncoates-st

Just created a draft PR based on your guidance.

  • https://github.com/rubycdp/ferrum/pull/391

johncoates-st avatar Aug 22 '23 07:08 johncoates-st