Want to use this lib in a WebWorker, but there's a line using `window` object, which is not exists in WebWorker.