There is a less brute force way to upgrade the elements: no need for checking intervals or upgrading the whole DOM when something changes. MutationObserver already tells you exactly what's changed.
window.addEventListener('load', function() {
var observer = new MutationObserver(function (mutations) {
mutations.forEach(function( mutation ) {
if (mutation.addedNodes)
window.componentHandler.upgradeElements(mutation.addedNodes);
})
});
observer.observe(document.body, {
childList: true,
subtree: true
});
});