ExecuteSoon was used in the Mork connector because the Mork connector isn't designed to be asynchronous. ExecuteSoon allows us to defer a function to the next tip to achieve asynchronicity.

But you don't have that problem, because XMLHttpRequests are asynchronous.

You can drop the executeSoon, and just attach onload event handlers on the XMLHttpRequest object to do your resolve / reject.

See: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Synchronous_and_Asynchronous_Requests?redirectlocale=en-US&redirectslug=DOM%2FXMLHttpRequest%2FSynchronous_and_Asynchronous_Requests