If the code below is run in DevTools or in the browser’s address bar, the h1
element will be inserted at the end of a website’s page.
const elm = document.createElement('h1')
const txt = document.createTextNode('New text')
elm.appendChild(txt)
document.body.appendChild(elm)
Can any site prevent this from happening using, for example, MutationObserver
?