Then it seems to be in conflict with some addon I'm using.
// version 1 let body = document.createElement('body') body.innerHTML = document.body.innerHTML // version 2 let body = document.body.cloneNode(true)
This is wired, that code should not be mutating existing DOM.
Update: Below version of sandboxed clone doesn't break the youtube popup menu.
// version 3 let parser = new DOMParser() let doc = parser.parseFromString(document.body.outerHTML, 'text/html') let body = doc.body