fix(recorder): check that glass pane is in the current document (#8891)

This commit is contained in:
Pavel Feldman 2021-09-13 16:17:34 -07:00 committed by GitHub
parent b79be5d98d
commit 478a7bcc90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,7 +130,8 @@ export class Recorder {
}
private _refreshListenersIfNeeded() {
if (this._outerGlassPaneElement.parentElement)
// Ensure we are attached to the current document, and we are on top (last element);
if (this._outerGlassPaneElement.parentElement === document.documentElement && !this._outerGlassPaneElement.nextElementSibling)
return;
removeEventListeners(this._listeners);
this._listeners = [