>The {mode: "open"} argument gives the page a way to break the encapsulation of your shadow DOM. If you don't want to give the page this ability, pass {mode: "closed"} instead, and then shadowRoot returns null.
>However, you should not consider this a strong security mechanism, because there are ways it can be evaded, for example by browser extensions running in the page. It's more of an indication that the page should not access the internals of your shadow DOM tree.
https://developer.mozilla.org/en-US/docs/Web/API/Web_compone...
This presentation talks about using window.find() and other methods:
https://speakerdeck.com/masatokinugawa/shadow-dom-and-securi...