sitespeedio / sitespeedio/sitespeed.io

Retrieve a run context inside a pre/post script

Open
#4,274 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5k
Forks
624
Avg merge
4h 8m
Merged PRs (30d)
2

Description

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 

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the CLI handling for --preScript and follow the per-URL execution path to see how the script is invoked. Determine how the current run context could be exposed to the script, then verify that a pre-script can identify the URL for each run and that existing script behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.