sitespeed.io icon indicating copy to clipboard operation
sitespeed.io copied to clipboard

Retrieve a run context inside a pre/post script

Open Amerousful opened this issue 5 months ago • 3 comments

Feature/improvement

According to the fact that a pre/post-script runs for each URL, it would be useful to have the ability to retrieve the context of the run, such as the URL. My real-life example is that I have logic in a pre-script with try-catch, and there's no way to log details about which specific URL the error occurred on.


fileWithUrls.txt:

https://www.sitespeed.io/
https://www.sitespeed.io/examples/
https://www.sitespeed.io/documentation/
https://www.sitespeed.io/blog/

Command for run:

sitespeed.io --target fileWithUrls.txt --preScript someScript.mjs 

Amerousful avatar Sep 12 '24 09:09 Amerousful