schickling / chromeless

🖥 Chrome automation made simple. Runs locally or headless on AWS Lambda.
https://chromeless.netlify.com
MIT License
13.24k stars 576 forks source link

Offline Support (Dev Tools) #142

Open NathHorrigan opened 7 years ago

NathHorrigan commented 7 years ago

Great Library but I was hoping that it would be possible to turn off the network (In devtools this would be checking offline option under 'Network' tab) so that I can test service worker backed pages. Is this possible with Chromeless at the moment? If not it looks like this could be implemented using Network.emulateNetworkConditions of the Chrome DevTools protocol?

Edit: I have begun development of this!

timsuchanek commented 7 years ago

Hi @NathHorrigan, thanks for bringing this up! Currently it's not possible, it would be a very interesting addition, though.

76 goes in that direction.

I think .setOffline() would be a good name for this. Let's discuss this here.

Would you be interested in raising a PR?

NathHorrigan commented 7 years ago

@timsuchanek Yes, I'm working on this as we speak (comment). 👍

NathHorrigan commented 7 years ago

btw some notes to contributors about how the structure of the code works would be nice.

joelgriffith commented 7 years ago

Agreed. Might be able to catch that in the CONTRIBUTING.md file

NathHorrigan commented 7 years ago

@joelgriffith @timsuchanek with my current implementation the tests run but Offline mode doesn't seem to activate. Could you review my fork over at: https://github.com/NathHorrigan/chromeless/tree/feature/devtools-offline to see if any stands out to you guys as weird/broken. 👍

Edit: @timsuchanek @joelgriffith