Replace XHR by postMessage