How to filter incoming web request content?


We have the need to filter web content based upon several criterion.

For that we need to filter the content of incoming web requests done by the website (load, navigation, eg.). CEF provides the ability to create ResponseFilterHandler which will be called for every incoming chunk of a response.

Electron already provides events for navigation starts (will-navigate event) and starting responses (did-get-response-details event) which helps a lot (filtering done based upon the requested URL).

Is it possible to have such events for the finished or incoming web responses? If not, is it possible to manually add this ability by modifying a local version of the electron source code?

My goal is to see whether the content of a navigation result succeeds some checks before it is displayed. If the check fails the navigation should be aborted and a blank site or an error site (provided by me) is displayed. If the check succeeded the content is allowed to be displayed.