Ignore the console line, I'll remove that. The detach event is sent when the window unloads or the worker is destroyed. I'm not sure if that means that we have to destroy the worker here or not, happy to put it in if you think it's necessary though.