move into recorder
This commit is contained in:
parent
7c04cfbca0
commit
2e37a9e131
|
|
@ -42,7 +42,6 @@ export type HighlightOptions = {
|
||||||
export class Highlight {
|
export class Highlight {
|
||||||
private _glassPaneElement: HTMLElement;
|
private _glassPaneElement: HTMLElement;
|
||||||
private _glassPaneShadow: ShadowRoot;
|
private _glassPaneShadow: ShadowRoot;
|
||||||
private _glassPaneInterval?: NodeJS.Timeout;
|
|
||||||
private _highlightEntries: HighlightEntry[] = [];
|
private _highlightEntries: HighlightEntry[] = [];
|
||||||
private _highlightOptions: HighlightOptions = {};
|
private _highlightOptions: HighlightOptions = {};
|
||||||
private _actionPointElement: HTMLElement;
|
private _actionPointElement: HTMLElement;
|
||||||
|
|
@ -91,12 +90,8 @@ export class Highlight {
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
this._injectedScript.document.documentElement.appendChild(this._glassPaneElement);
|
if (!this._injectedScript.document.documentElement.contains(this._glassPaneElement))
|
||||||
|
this._injectedScript.document.documentElement.appendChild(this._glassPaneElement);
|
||||||
this._glassPaneInterval = setInterval(() => {
|
|
||||||
if (!this._injectedScript.document.documentElement.contains(this._glassPaneElement))
|
|
||||||
this._injectedScript.document.documentElement.appendChild(this._glassPaneElement);
|
|
||||||
}, 500);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setLanguage(language: Language) {
|
setLanguage(language: Language) {
|
||||||
|
|
@ -113,7 +108,6 @@ export class Highlight {
|
||||||
uninstall() {
|
uninstall() {
|
||||||
if (this._rafRequest)
|
if (this._rafRequest)
|
||||||
cancelAnimationFrame(this._rafRequest);
|
cancelAnimationFrame(this._rafRequest);
|
||||||
clearInterval(this._glassPaneInterval);
|
|
||||||
this._glassPaneElement.remove();
|
this._glassPaneElement.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1036,7 +1036,13 @@ export class Recorder {
|
||||||
addEventListener(this.document, 'focus', event => this._onFocus(event), true),
|
addEventListener(this.document, 'focus', event => this._onFocus(event), true),
|
||||||
addEventListener(this.document, 'scroll', event => this._onScroll(event), true),
|
addEventListener(this.document, 'scroll', event => this._onScroll(event), true),
|
||||||
];
|
];
|
||||||
|
|
||||||
this.highlight.install();
|
this.highlight.install();
|
||||||
|
const recreationInterval = setInterval(() => {
|
||||||
|
this.highlight.install();
|
||||||
|
}, 500);
|
||||||
|
this._listeners.push(() => clearInterval(recreationInterval));
|
||||||
|
|
||||||
this.overlay?.install();
|
this.overlay?.install();
|
||||||
this.document.adoptedStyleSheets.push(this._stylesheet);
|
this.document.adoptedStyleSheets.push(this._stylesheet);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue