This example subscribes to unconfirmed transactions in a web worker and passes them back to the main window.

Support for loading ES5 modules outside of the "main" browser context is only supported in Chrome 80+, so although it may give you a worker that doesn't block the main thread, it might not be a good idea in 2020. This feature is (maybe) being added by firefox and maybe safari.