-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The new scriptlet allows to defuse calls to fetch() by returning a promise which always resolve to an empty response. There is only one argument, which is a space-separated list of conditions which must be ALL fulfilled in order for the defusing to take place. Each condition is a pair of property name and property value separated by a column. Valid property names are those documented as valid `init` options: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch The URL of the fetch() is a special case and does not have to be associated with a property name. Example of usage: ...##+js(no-fetch-if, method:HEAD) Which means: defuse the call to fetch() if there is an explicit option which contains `HEAD`. Another example: ...##+js(no-fetch-if, adsbygoogle.js) Which means: defuse the call to fetch() if the URL contains `adsbygoogle.js`. Multiple conditions can be provided: ...##+js(no-fetch-if, adsbygoogle.js method:HEAD) If at least one condition does not match, the defusing will not take place. The string against which to match can be a literal regular expression: ...##+js(no-fetch-if, /adsbygoogle.js$/ method:/HEAD|POST/) Additonally, the following deprecated scriplets have been removed: - requestAnimationFrame-if.js - setInterval-defuser.js - setTimeout-logger.js
- Loading branch information
Showing
1 changed file
with
60 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Seems adding second alias causes the first alias to be considered invalid --