xdomain pollutes the global namespace. In particular, it overrides window.FormData. This can break sites on which other scripts use FormData in fetch calls to submit forms via AJAX. To be more precise, consider the following call:
const myForm = document.getElementById('myForm')
myForm.addEventListener('submit', evt => {
evt.preventDefault()
fetch(form.dataset.ajaxUri, {
method: 'POST',
body: new FormData(form)
}).then(result => {
// do something with the result
})
})
The payload of that request sent when submitting the form will not be the actual form data, but [object Object].
xdomain pollutes the global namespace. In particular, it overrides
window.FormData
. This can break sites on which other scripts useFormData
infetch
calls to submit forms via AJAX. To be more precise, consider the following call:The payload of that request sent when submitting the form will not be the actual form data, but
[object Object]
.