Skip to content

Commit

Permalink
Feat: Add support for replaying :defined pseudo-class of custom eleme…
Browse files Browse the repository at this point in the history
…nts (rrweb-io#1155)

* Feat: Add support for replaying :defined pseudo-class of custom elements

* add isCustom flag to serialized elements

Applying Justin's review suggestion

* fix code lint error

* add custom element event

* fix: tests (rrweb-io#1348)

* Update packages/rrweb/src/record/observer.ts

* Update packages/rrweb/src/record/observer.ts

---------

Co-authored-by: Nafees Nehar <nafees87n@gmail.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
  • Loading branch information
3 people authored and billyvg committed Dec 8, 2023
1 parent 48102cf commit a6d2ed9
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 a6d2ed9

Please sign in to comment.