strip-fetch-query-parameter
Last updated
Last updated
The strip-fetch-query-parameter
strips a query string parameter from fetch()
calls.
You can use this snippet to remove parameters from fetch
calls that mach a urlPattern
, if provided. If urlPattern
isn't provided, the parameter gets stripped from all fetch
calls.
Name | Description | Mandatory |
---|---|---|
The following table lists examples that use the strip-fetch-query-parameter
snippet:
Filter | Result |
---|---|
name
The parameter's name.
Yes
urlPattern
An optional pattern that the URL must match. If the string begins and ends with a slash (/), the text in between is treated as a regular expression.
No
strip-fetch-query-parameter ads
Strips the ads
param from all fetch
calls.
strip-fetch-query-parameter ads someadsserver.com/get-ads
Strips the ads
param from fetch
calls whose source matches the someadsserver.com/get-ad
s pattern.