You could additionally check that doc2.createElement('x-frame') instanceof [the constructor generated by document.register].