Check for window object existance, in WebWorker environment we do not have access to it