Last active
          May 18, 2018 20:15 
        
      - 
      
- 
        Save honsa/5d6840958d8b981cbb87ede2e5e737f4 to your computer and use it in GitHub Desktop. 
    xhr interception
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | (function (open) { | |
| XMLHttpRequest.prototype.open = function (method, url, async, user, pass) { | |
| this.addEventListener("readystatechange", function () { | |
| let state = this.readyState; | |
| console.log(this); | |
| if (this.readyState === 4) { | |
| //here you go | |
| } | |
| }, false); | |
| open.call(this, method, url, async, user, pass); | |
| }; | |
| })(XMLHttpRequest.prototype.open); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment