Currently we have a chat service (a third party library which we cannot see the source code) to give custom support for clients. We would like to intercept the receiving messages at client side (Http requests) to create a funcionality based on this chat: when someone sends a video link trough the chat, it will be displayed in the middle of the page trough Javascript.
Is there a way to intercept all http messages received in a page? To do something like this:
function onEachHttpReceived(message){
console.log(message);
if(isUrlVideo(message)){
showVideo(message);
}
}
I need a solution based in angularJs or plain javascript.