Fix unsafeWindow for the newer versions of Chrome. #968