mirror of https://github.com/gorhill/uBlock.git
ba11a70013
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 |
||
---|---|---|
.. | ||
resources | ||
assets.json |