adoptedCallback is a seldom-used Web Components lifecycle callback for when a custom element is adopted into a different document. It rounds out the component lifecycle alongside constructor, connectedCallback, attributeChangedCallback, observedAttributes, and disconnectedCallback. section 4.0 section 4.3
Adopting an element from an iframe
A DOM adoption scenario begins by selecting a custom element from an iframe document and passing it to document.adoptNode(el). This is the situation in which adoptedCallback becomes relevant. section 4.3
const frame = document.getElementsByTagName("iframe")[0]
const el = frame.contentWindow.document.getElementsByTagName(
"my-custom-component")[0];
const adopted = document.adoptNode(el);
Inspect the compact adoption example, which obtains an element from an iframe and adopts it into the current document. section 4.3
