wxt icon indicating copy to clipboard operation
wxt copied to clipboard

fix: Make injectScript wait until loaded

Open ion1 opened this issue 8 months ago • 1 comments

[!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:

injectScript returns 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

ion1 avatar Jun 19 '25 16:06 ion1

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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Jun 19 '25 16:06 netlify[bot]