Atmosphere / atmosphere-javascript

atmosphere-javascript
Apache License 2.0
122 stars 98 forks source link

Synchronous ajax petition no more being supported by browsers #196

Closed Dawuid closed 5 years ago

Dawuid commented 8 years ago

With the introduction of workers in last browsers synchronous ajax petitions are no more supported (see https://xhr.spec.whatwg.org/#sync-warning). Present atmosphere client (v2.3.1) allows to perform ajax petitions in async and sync mode (see https://github.com/Atmosphere/atmosphere-javascript/blob/master/modules/javascript/src/main/webapp/javascript/atmosphere.js#L2163). When it's used in sync mode (for example for closing the channel in default mode, see https://github.com/Atmosphere/atmosphere-javascript/blob/javascript-project-2.3.1/modules/javascript/src/main/webapp/javascript/atmosphere.js#L197) Chrome (version 48.0.2564.116) writes a warning, but developers editions (for example, Firefox 46.0a) directly fails.

Easy solution (maybe?), all requests, including close (i.e. closeAsync: true), must be async by default.