fix: Fix checking for patchTarget in initAdoptedStyleSheetObserver (#1327)
This commit is contained in:
5
.changeset/calm-oranges-sin.md
Normal file
5
.changeset/calm-oranges-sin.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'rrweb': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: Fix checking for `patchTarget` in `initAdoptedStyleSheetObserver`
|
||||||
@@ -900,10 +900,12 @@ export function initAdoptedStyleSheetObserver(
|
|||||||
host.nodeName === '#document'
|
host.nodeName === '#document'
|
||||||
? (host as Document).defaultView?.Document
|
? (host as Document).defaultView?.Document
|
||||||
: host.ownerDocument?.defaultView?.ShadowRoot;
|
: host.ownerDocument?.defaultView?.ShadowRoot;
|
||||||
const originalPropertyDescriptor = Object.getOwnPropertyDescriptor(
|
const originalPropertyDescriptor = patchTarget?.prototype
|
||||||
patchTarget?.prototype,
|
? Object.getOwnPropertyDescriptor(
|
||||||
'adoptedStyleSheets',
|
patchTarget?.prototype,
|
||||||
);
|
'adoptedStyleSheets',
|
||||||
|
)
|
||||||
|
: undefined;
|
||||||
if (
|
if (
|
||||||
hostId === null ||
|
hostId === null ||
|
||||||
hostId === -1 ||
|
hostId === -1 ||
|
||||||
|
|||||||
Reference in New Issue
Block a user