Blocking requests to pre-defined page objects, such as 3rd party libraries and metrics extensions, can be done through the agent's proxy (HttpClient). Requests will be sent to the proxy by the browser but always returned with the specified HTTP code at 0 bytes.
1. Define an object using the HttpClient class
var c = test.openHttpClient();
2. Use the blacklistRequests method with a regex string containing the pattern you wish to blacklist
// This example uses Google Analytics and will always return a 200 response
c.blacklistRequests("http(s)?://[^/]+\\.google-analytics\\.com/.*", 200);
3. All requests to URIs and hosts of google-analytics.com will now be filtered out of your monitoring/load testing load