Synthetic: Add urlpattern filtering to setHeader and addHeader commands

4th July 2023 (UTC)

The requests that the setHeader and addHeader script commands apply to can now be restricted by adding a URL pattern to the command.

For example:|

setHeader x-header-name:value* adds the header to all requests to

setHeader x-header-name:value https://** adds the header to all requests to on SpeedCurve's subdomains e.g.,, etc.

setHeader x-header-name:value adds the header to just the request and not to any other pages, sub-resources, sub-domains etc.

Previously setHeader and addHeader relied on the Chrome DevTools Protocol Network.setExtraHTTPHeaders which adds the header to all requests in a test and this could lead to CORS issues.

If a urlpattern isn't specified then a default pattern of _://_/*' is used. This replicates the previous behaviour and applies the header to all requests.

In the future we may update this default to be the domain of the page being tested.