amplesdk icon indicating copy to clipboard operation
amplesdk copied to clipboard

Synchronous XMLHttpRequest on the main thread is deprecated.

Open h6w opened this issue 10 years ago • 2 comments

My new upgrade to Chrome this morning threw a warning: "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/."

This is because https://github.com/clientside/amplesdk/blob/bf07c65f3c14fe000642e6feb1e4cd08c3975f19/ample/runtime/browser.js#L873 uses a synchronous XmlHttpRequest (by passing false as the third parameter).

I tend to agree with whatwg here. Synchronous HTTP requests cause the whole API to freeze for longer than necessary.

If we want to ensure that things are done before other things, I'd recommend using the waterfall function from the async library instead: https://github.com/caolan/async

h6w avatar Feb 12 '15 23:02 h6w

@h6w, what version of chrome did you update to? I can imagine google choses to break web, so we might need to land a patch in Ample SDK

ilinsky avatar Feb 14 '15 19:02 ilinsky

@ilinsky Chromium Version 40.0.2214.111 Ubuntu 14.10

h6w avatar Feb 16 '15 00:02 h6w