### Update
The only way to intercept/interact before `attributeChangedCallback` or `connectedCallback` are triggered is by using `DOMNodeInsterted` event on the `document`.
However, these events have been deprecated, but `MutationObserver` would not be notified before the component upgrade, always after.
```js
check('sync template'); // fails
customElements.whenDefined('test-case').then(() => {
check('async template'); // fails
document.addEventListener('DOMNodeInsterted', e => {
if (e.target === target) console.log('got it before checks');
});
// triggers attribute and conected
document.body.appendChild(target);
check('sync live'); // OK
customElements.whenDefined('test-case').then(() => {
check('async live'); // OK
console.log(target.outerHTML);
});
});
```
Accordingly, there's still no way to intercept a Custom Element upgrade.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/671#issuecomment-332837080