This could perhaps be cleaner if we `waitFor` and move this into an `executeAsyncScript` call but this is okay too if you prefer