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 as Document).defaultView?.Document
|
||||
: host.ownerDocument?.defaultView?.ShadowRoot;
|
||||
const originalPropertyDescriptor = Object.getOwnPropertyDescriptor(
|
||||
patchTarget?.prototype,
|
||||
'adoptedStyleSheets',
|
||||
);
|
||||
const originalPropertyDescriptor = patchTarget?.prototype
|
||||
? Object.getOwnPropertyDescriptor(
|
||||
patchTarget?.prototype,
|
||||
'adoptedStyleSheets',
|
||||
)
|
||||
: undefined;
|
||||
if (
|
||||
hostId === null ||
|
||||
hostId === -1 ||
|
||||
|
||||
Reference in New Issue
Block a user