style(tracker): review code fixes

This commit is contained in:
Alex Kaminskii 2022-08-26 11:39:31 +02:00
parent d320aebc2d
commit fd24470c1f
2 changed files with 7 additions and 10 deletions

View file

@ -291,15 +291,12 @@ export default class DOMManager extends ListWalker<Message> {
if (host instanceof HTMLIFrameElement) {
const vDoc = new VDocument()
this.vRoots.set(msg.id, vDoc)
//host.onload = () => {
const doc = host.contentDocument
if (!doc) {
logger.warn("No iframe doc onload", msg, host)
return
}
vDoc.setDocument(doc)
//vDoc.applyChanges()
//}
const doc = host.contentDocument
if (!doc) {
logger.warn("No iframe doc onload", msg, host)
return
}
vDoc.setDocument(doc)
return;
} else if (host instanceof Element) { // shadow DOM
try {

View file

@ -15,7 +15,7 @@ function hasAdoptedSS(node: Node): node is StyleSheetOwner {
return (
isRootNode(node) &&
// @ts-ignore
typeof node.adoptedStyleSheets !== 'undefined'
!!node.adoptedStyleSheets
)
}