reproduce step
-
use node > 22.12+ (because of vite)
-
pnpm install
-
cd packages/slave && pnpm run dev
-
cd packages/master && pnpm run dev
-
click button
start recordto start rrweb record -
click button
count is 0to increase count and generate MutationObserver -
click button
stop recordto stop rrweb record, generate events and show the replay -
All dom in
wujie slave pageis missing when replay
but when you change packages/master/src/App.vue with below changes, and repeat the step above, it works!
// import * as rrweb from 'rrweb';
import * as rrweb from './rrweb-alpha.18'; // I updated it with commit changesome related logs:
const iframe = window.document.querySelector('IFRAME');
const head = iframe.contentDocument.querySelector('head');
// updated code simulate output
iframe.contentDocument.contains(head); // true
// Previous code simulate output
window.Node.prototype.contains.call(iframe.contentDocument, head); // false
iframe.contentWindow.Node.prototype.contains.bind(iframe.contentDocument)(head); // false