wxt
wxt copied to clipboard
Function `createShadowRootUi` avoid render duplicated
Feature Request
If browser.scripting.executeScript all of extension script on chrome.runtime.OnInstalledReason.INSTALL or chrome.runtime.OnInstalledReason.UPDATE, we encounter this situation.
Is your feature request related to a bug?
N/A
What are the alternatives?
We have to wrap createShadowRootUi to check the name of the custom component used to host the ShadowRoot whether existed.
Additional context
N/A
After the problem is solved, I have to use global variable to control whether the ui is mounted, like window.__mountedNames. I think the implement should going on under the hood.
Interesting, the ContentScriptContext should be causing the UI to be removed if the install/update events are firing and when if it sees another version of the same script is being executed.
I'll double check this at some point, but it's a low priority rn since you have a work-around.
There was a bug in the content script context, so this should be fixed by #683!
Potential fix released in v0.18.4