美文网首页
js Hook Ajax

js Hook Ajax

作者: 盖码范 | 来源:发表于2022-03-17 11:54 被阅读0次
(function() {
    var origOpen = XMLHttpRequest.prototype.open;
    
    XMLHttpRequest.prototype.open = function() {
        // console.log('request started!');
        this.addEventListener('load', function() {
            console.log(this.responseText); // 得到Ajax的返回内容
        });
        origOpen.apply(this, arguments);
    };
})();

相关文章

网友评论

      本文标题:js Hook Ajax

      本文链接:https://www.haomeiwen.com/subject/mrsvdrtx.html