0

I need to create one more response filter during one test scenario. But now when I do this both filters work at the same time. How could I stop or override the previous one without stopping current browser instance?

Code example:

proxy.addResponseFilter((response, contents, messageInfo) -> {
        if (messageInfo.getOriginalUrl().contains(keyWord)) {
            contents.setTextContents(newResponse);
        }
    });

1 Answers1

1

It's not currently possible to remove a javascript filter after you've added it, unfortunately. The new REST API that is currently in development will support this, though. There's an issue open to track this: https://github.com/lightbody/browsermob-proxy/issues/326

Jason Hoetger
  • 7,543
  • 2
  • 16
  • 18