Isolated the access to the `window` context.