Skip to content Skip to sidebar Skip to footer

Use Javascript To Intercept Data Received In A Webpage

I have a webpage that will receive data in JSON format for every x minutes. I want to get its URL and content. Manually I can do by using Network tab in Chrome DevTools to view it

Solution 1:

Monkey patch?

XMLHttpRequest.prototype.open = (function(fopen){
    return function(){
        //do something, intercept here
        return fopen.apply(this,arguments); 
    }
})(XMLHttpRequest.prototype.open)

Post a Comment for "Use Javascript To Intercept Data Received In A Webpage"