capture http requests using XMLHttpRequest.prototype.open Edit

Murugan Andezuthu Dharmaratnam | 30 August 2022 | 70

capture http requests using XMLHttpRequest.prototype.open

Sample Code

 var rawOpen = XMLHttpRequest.prototype.open;

XMLHttpRequest.prototype.open = function(m,url) {
	if (!this._hooked) {
		this._hooked = true;
		       if(url.includes(".ts"))
               {
                   console.log(url);
               }
        
	}
	rawOpen.apply(this, arguments);
}



XMLHttpRequest.prototype.open = rawOpen;