fix: Make injectScript wait until loaded
[!NOTE] The patch series in which each PR builds on top of the previous one: #1761, #1762, #1763 (you are here), #1838, #1765.
In case some of the changes are rejected, I will rebase the subsequent PRs on top of main.
Overview
The documentation states:
injectScriptreturns a promise, that when resolved, means the script has been evaluated by the browser and you can start communicating with it.
However, currently injectScript returns as soon as the script element has been added to the DOM.
This PR makes injectScript behave according to the documentation.
Manual Testing
Invoke injectScript and observe that it will wait until the script has loaded.
Related Issue
N/A
Deploy Preview for creative-fairy-df92c4 ready!
| Name | Link |
|---|---|
| Latest commit | a52b234d96e85208bb8d11e75eed928d0545404a |
| Latest deploy log | https://app.netlify.com/projects/creative-fairy-df92c4/deploys/688fc2f88ac37d00086c2f74 |
| Deploy Preview | https://deploy-preview-1763--creative-fairy-df92c4.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.