If we really want to start using the HTTP code on the main thread (which is probably ok), I think we want to move it and the corresponding tests out of the worker directories, ensure that there's no worker-specific code there, and also add some comments to the code and/or test files about where things are expected to run, so that it's slightly harder for someone to inadvertently introduce a DOM dependency into the HTTP code in the future.

Another option here might be to just use the equivalent jQuery functionality for the sidebar app.