-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: mutation Failed to execute 'insertBefore' on 'Node': Only one do…
…ctype on document allowed (#1112) Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
- Loading branch information
1 parent
0627d4d
commit 174b9ac
Showing
3 changed files
with
167 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
import { EventType, IncrementalSource } from '@rrweb/types'; | ||
import type { eventWithTime } from '@rrweb/types'; | ||
|
||
const now = Date.now(); | ||
const events: eventWithTime[] = [ | ||
{ | ||
type: EventType.DomContentLoaded, | ||
data: {}, | ||
timestamp: now, | ||
}, | ||
{ | ||
type: EventType.Load, | ||
data: {}, | ||
timestamp: now + 100, | ||
}, | ||
{ | ||
type: EventType.Meta, | ||
data: { | ||
href: 'http://localhost', | ||
width: 1200, | ||
height: 500, | ||
}, | ||
timestamp: now + 100, | ||
}, | ||
// full snapshot: | ||
{ | ||
data: { | ||
node: { | ||
id: 1, | ||
type: 0, | ||
childNodes: [ | ||
{ id: 2, name: 'html', type: 1, publicId: '', systemId: '' }, | ||
{ | ||
id: 3, | ||
type: 2, | ||
tagName: 'html', | ||
attributes: { lang: 'en' }, | ||
childNodes: [ | ||
{ | ||
id: 4, | ||
type: 2, | ||
tagName: 'head', | ||
attributes: {}, | ||
childNodes: [], | ||
}, | ||
{ | ||
id: 5, | ||
type: 2, | ||
tagName: 'body', | ||
attributes: {}, | ||
childNodes: [], | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
initialOffset: { top: 0, left: 0 }, | ||
}, | ||
type: EventType.FullSnapshot, | ||
timestamp: now + 100, | ||
}, | ||
// mutation that replace the old document | ||
{ | ||
type: EventType.IncrementalSnapshot, | ||
data: { | ||
source: IncrementalSource.Mutation, | ||
texts: [], | ||
attributes: [], | ||
removes: [], | ||
adds: [ | ||
{ | ||
parentId: 1, | ||
nextId: null, | ||
node: { | ||
type: 2, | ||
tagName: 'html', | ||
attributes: {}, | ||
childNodes: [], | ||
id: 6, | ||
}, | ||
}, | ||
{ | ||
parentId: 6, | ||
nextId: null, | ||
node: { | ||
type: 2, | ||
tagName: 'body', | ||
attributes: {}, | ||
childNodes: [], | ||
id: 7, | ||
}, | ||
}, | ||
{ | ||
parentId: 1, | ||
nextId: 6, | ||
node: { | ||
type: 1, | ||
name: 'html', | ||
publicId: '', | ||
systemId: '', | ||
id: 8, | ||
}, | ||
}, | ||
{ | ||
parentId: 6, | ||
nextId: 7, | ||
node: { | ||
type: 2, | ||
tagName: 'head', | ||
attributes: {}, | ||
childNodes: [], | ||
id: 9, | ||
}, | ||
}, | ||
], | ||
}, | ||
timestamp: now + 500, | ||
}, | ||
]; | ||
|
||
export default events; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters