Better way to detect if in a web worker.