[Extension core]Wait for the document to be ready before calling the entrypoint.