`injectScript` should wait for script to load
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 564
- PR merge metrics
- No merged PRs in 30d
Description
Feature Request
Currently, injectScript returns immediately after appending a script. It would make sense to wait until "load" event is fired, so the caller knows that the script is injected and ready to use.
Is your feature request related to a bug?
N/A
What are the alternatives?
One alternative is to add a new option to options to enable such behavior. This way it can be opt-in and won't change current behavior.
Another way is to return script from the function and allow users to do whatever they want with the object.
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 locating the injectScript entry point and reading how it appends scripts and returns. Compare the proposed load-waiting behavior with the opt-in and returned-script alternatives, then define and verify the chosen API behavior, including when callers can safely use the injected script.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100