I want to write some javascript AJAX and Websocket hooking code in Chrome Extension.
Code is like below.
(function() {
        console.log("ajax hooking init");
    var origOpen = XMLHttpRequest.prototype.open;
    XMLHttpRequest.prototype.open = function() {
        ...  
    }
}
But, though above code do work, but it didn't hook any requests in current page. Do i something wrong? How to do hook some requests via chrome extension??
 
    