Skip to content

Commit

Permalink
upstream: Feat: Add support for replaying :defined pseudo-class of cu…
Browse files Browse the repository at this point in the history
…stom elements (rrweb-io#1155) (#138)

cherry-picks rrweb-io#1155 which was
merged in our fork in #107 (prior
to rrweb-io#1155 being merged). This results in only 2 small stylistic changes.

Feat: Add support for replaying :defined pseudo-class of custom elements
rrweb-io#1155

Co-authored-by: Yun Feng <[email protected]>
Co-authored-by: Nafees Nehar <[email protected]>
Co-authored-by: Justin Halsall <[email protected]>
  • Loading branch information
4 people authored Jan 31, 2024
1 parent 403640b commit 120e802
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion packages/rrweb/src/record/iframe-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ export class IframeManager implements IframeManagerInterface {
}
}
}

return false;
}

Expand Down
8 changes: 2 additions & 6 deletions packages/rrweb/src/record/observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1242,12 +1242,8 @@ function initCustomElementObserver({
customElementCb,
}: observerParam): listenerHandler {
const win = doc.defaultView as IWindow;
if (!win || !win.customElements) {
return () => {
// do nothing
};
}

// eslint-disable-next-line @typescript-eslint/no-empty-function
if (!win || !win.customElements) return () => {};
const restoreHandler = patch(
win.customElements,
'define',
Expand Down

0 comments on commit 120e802

Please sign in to comment.