Skip to content

Instantly share code, notes, and snippets.

@evansolomon
Created May 21, 2015 18:46
Show Gist options
  • Save evansolomon/1fcf01178193ea22426d to your computer and use it in GitHub Desktop.
Save evansolomon/1fcf01178193ea22426d to your computer and use it in GitHub Desktop.
Chrome 43 changed the way XMLHttpRequest objects get serialized to JSON. Almost all of the fields as missing now.
var xhr = new XMLHttpRequest()
xhr.open('GET', 'http://requestb.in/155pmaz1')
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) return
var jsonifiedXhr = JSON.parse(JSON.stringify(xhr))
console.log(Object.keys(jsonifiedXhr))
}
xhr.send()
// Chrome 42
// ["statusText", "status", "responseURL", "response", "responseType", ...]
// Chrome 43
// ["response", "responseText"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment