fix(player): fix vroot context getter (#1190)

Co-authored-by: nick-delirium <nikita@openreplay.com>
This commit is contained in:
Shekar Siri 2023-04-20 15:17:43 +02:00 committed by GitHub
parent 4abd69e0e2
commit ada7e74aed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -315,7 +315,7 @@ export class OnloadStyleSheet extends PromiseQueue<CSSStyleSheet> {
return new OnloadStyleSheet(new Promise((resolve, reject) =>
vRoot.onNode(node => {
let context: typeof globalThis | null
if (node instanceof Document) {
if (node instanceof Document || node.nodeName === '#document') {
context = node.defaultView
} else {
context = node.ownerDocument.defaultView