special pattern matching regex. capture groups can replace parts of the changeUrl
that use the special marker tokens $$0
, $$1
, etc on to $$9
.
Note You use changeCaptureRegex to construct custom marker tokens that can be used inside of your changeUrl string.
for example: if resourceUrl="http://google.com/somescript.js"
changeCaptureRegex="^.*?/(.*)$"
would create a match group for everything after the last /
character and changeUrl="http://example.com/$$1"
would then get evaluated to "http://example.com/somescript.js"
changes the current URL of the network request.
You can inject parts of the original URL into your changeUrl using one of the special marker tokens: $$port
$$protocol````
$$hostor
$$path```.
Note You can use changeCaptureRegex to construct custom marker tokens that can be used inside of your changeUrl string.
if true, blacklists the request unless a later matching resourceAdjustor changes it back to false (we process in a FIFO fashion) by default, we don't blacklist anything. You should keep it this way when rendering jpeg (where the visuals matter), if processing text/data, blacklisting .css files ['..css.'] will work fine. check the response.metrics for other resources you could blacklist (example: facebook, google analytics, ad networks)
new for Chrome
backend. (not available on WebKit
).
set to override the method.
new for Chrome
backend. (not available on WebKit
).
set to override the post body.
pattern used to match a resource's url.
can be used in instead of, or in addition to, the category or type property (results are additive)
examples: it really depends what the site is and what you are wanting to block, but for example to block anything with the text "facebook" or "linkedin" in the url:
javascript requestModifiers:[{regex:".*facebook.*",isBlacklisted:true},{regex:".*linkedin.*",isBlacklisted:true}]
It's especially useful if you just need the text, as you can block all css files from loading, such as: ".*\.css.*"
Don't use this to block images. instead, images are blocked by using the IRequestSettings.ignoreImages=true property```
optional key/value pairs for adjusting the headers of this resource's request. example: {"Accept-encoding":"gzip", "hello":"world"}
new for Chrome
backend. (not available on WebKit
).
set the response to be returned to the requesting page. warning: setting this to an empty object will force a blank response. to skip this, do not set it, or set to null.
set the response body
sets the Content-Type response header
set response headers
set response status code.
regex + adjustment parameters for modifying or rejecting resources being loaded by the webpage. Example:
{regex:".*css.*",isBlacklisted:true}