Thanks Robbi,
I guess I have no other choice now :(
It was already running in the background script, but having it in a worker would prevent background script from being stuck while the operation was running. Now when it starts, no other background operation can run.
I wish I could have more than one service worker. Or some quick WebAssembly versions of those slow libraries I use :).
Anyway, thanks!