Wait for window to be loaded.