swagger-api / swagger-api/swagger-ui
Detect when page is fully loaded
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Q&A (please complete the following information)
n/a swagger works correctly
- Swagger-UI version: [e.g. 3.10.0] whichever is bundled with swashbuckle
- Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0] as above
- Swashcbuckle: 6.2.3 (latest version)
How can we help?
I first searched StackOverflow, and past issues.
I'm trying to inject jQuery and some custom scripts into the swagger page, and have it run after swagger ui loads (after the spinner loads, etc.). There are all sorts of way to do that, polling, MutationObserver, etc.
But I was wondering if swagger-ui itself fires a "loaded" event of some kind, once the page is fully loaded? Or maybe there is a class/id/attribute that I can check once the page is loaded?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing Swagger UI's loading lifecycle, including the spinner and the point where injected scripts would need a completion signal. Check existing lifecycle events and state hooks before deciding how a reliable loaded signal could be exposed and documented; done means a custom script can detect that the UI has finished loading without polling or observing DOM mutations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100