Created
August 14, 2019 05:26
-
-
Save bencmbrook/2fdafbb96665d6c41725803eeb42510b to your computer and use it in GitHub Desktop.
Log XHR URLs on your site to build a CSP
This file contains 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(XHR) { | |
var open = XHR.prototype.open; | |
var send = XHR.prototype.send; | |
XHR.prototype.open = function(method, url, async, user, pass) { | |
this._url = url; | |
open.call(this, method, url, async, user, pass); | |
}; | |
XHR.prototype.send = function(data) { | |
var url = this._url; | |
console.log(url); | |
send.call(this, data); | |
} | |
})(XMLHttpRequest); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment