-
-
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.
part of #38 1. observe DOM mutations in shadow DOM 2. rebuild DOM mutations in shadow DOM
- Loading branch information
Showing
12 changed files
with
680 additions
and
48 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
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
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,43 @@ | ||
import { mutationCallBack, blockClass } from '../types'; | ||
import { MaskInputOptions, SlimDOMOptions } from 'rrweb-snapshot'; | ||
import { IframeManager } from './iframe-manager'; | ||
import { initMutationObserver } from './observer'; | ||
|
||
type BypassOptions = { | ||
blockClass: blockClass; | ||
blockSelector: string | null; | ||
inlineStylesheet: boolean; | ||
maskInputOptions: MaskInputOptions; | ||
recordCanvas: boolean; | ||
slimDOMOptions: SlimDOMOptions; | ||
iframeManager: IframeManager; | ||
}; | ||
|
||
export class ShadowDomManager { | ||
private mutationCb: mutationCallBack; | ||
private bypassOptions: BypassOptions; | ||
|
||
constructor(options: { | ||
mutationCb: mutationCallBack; | ||
bypassOptions: BypassOptions; | ||
}) { | ||
this.mutationCb = options.mutationCb; | ||
this.bypassOptions = options.bypassOptions; | ||
} | ||
|
||
public addShadowRoot(shadowRoot: ShadowRoot, doc: Document) { | ||
initMutationObserver( | ||
this.mutationCb, | ||
doc, | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Yuyz0112
Author
Member
|
||
this.bypassOptions.blockClass, | ||
this.bypassOptions.blockSelector, | ||
this.bypassOptions.inlineStylesheet, | ||
this.bypassOptions.maskInputOptions, | ||
this.bypassOptions.recordCanvas, | ||
this.bypassOptions.slimDOMOptions, | ||
this.bypassOptions.iframeManager, | ||
this, | ||
shadowRoot, | ||
); | ||
} | ||
} |
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
Oops, something went wrong.
Why are we passing in
doc
here (the parent document)?My naive assumption is that we need to add an observer which observes the shadow document (i.e. pass
shoadowRoot
instead ofdoc
here).