fix: update worker-script innerHTML implementation
I noticed that setting innerHTML does not work as expected for nested script tags.
Take a look at this code:
div = document.createElement('div');
div.innerHTML = '<script>console.log(42);</script>';
console.log(div.firstChild.innerHTML);
It should log the content of the script. Unfortunately when run inside Partytown it returns empty string.
In addition to the above, I added descriptor for text property, via https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement:
HTMLScriptElement.text A string that joins and returns the contents of all Text nodes inside the element (ignoring other nodes like comments) in tree order. On setting, it acts the same way as the textContent IDL attribute.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated |
|---|---|---|---|
| partytown | ✅ Ready (Inspect) | Visit Preview | Sep 2, 2022 at 3:49PM (UTC) |
@adamdbradley just to clarify, did you close this MR intentionally, or was it closed by mistake automatically, when you merged #235?