schickling / chromeless

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

.coverage API #38

Open joelgriffith opened 7 years ago

joelgriffith commented 7 years ago

Chrome exposes a mechanism in which to get coverage for scripts. This type of information is crucial to front-end devs as it exposes unused code-paths. Would love to see an API for this

schickling commented 7 years ago

This seems like a great idea. My suggestion would be, that we expose the underlying Chrome API, so people could use this for now until we found a good API.

joelgriffith commented 7 years ago

Chrome's API is fairly low-level (they return ranges of coverage with booleans indicating covered or note). It's not an entirely valuable API unless you do some of the calc'ing yourself. It's also not an easy thing to implement as you have to collect resources loaded, and match them when coverage is called (since Chrome references resources by a unique ID, and not by URI).