File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ export class Highlight {
6161 this . _glassPaneElement . style . right = '0' ;
6262 this . _glassPaneElement . style . bottom = '0' ;
6363 this . _glassPaneElement . style . left = '0' ;
64- this . _glassPaneElement . style . zIndex = '2147483646 ' ;
64+ this . _glassPaneElement . style . zIndex = '2147483647 ' ;
6565 this . _glassPaneElement . style . pointerEvents = 'none' ;
6666 this . _glassPaneElement . style . display = 'flex' ;
6767 this . _glassPaneElement . style . backgroundColor = 'transparent' ;
@@ -90,7 +90,9 @@ export class Highlight {
9090
9191 install ( ) {
9292 // NOTE: document.documentElement can be null: https://github.com/microsoft/TypeScript/issues/50078
93- if ( this . _injectedScript . document . documentElement && ! this . _injectedScript . document . documentElement . contains ( this . _glassPaneElement ) )
93+ if ( ! this . _injectedScript . document . documentElement )
94+ return ;
95+ if ( ! this . _injectedScript . document . documentElement . contains ( this . _glassPaneElement ) || this . _glassPaneElement . nextElementSibling )
9496 this . _injectedScript . document . documentElement . appendChild ( this . _glassPaneElement ) ;
9597 }
9698
Original file line number Diff line number Diff line change @@ -206,7 +206,11 @@ class RecordActionTool implements RecorderTool {
206206 return 'pointer' ;
207207 }
208208
209- install ( ) {
209+ private _installObserverIfNeeded ( ) {
210+ if ( this . _observer )
211+ return ;
212+ if ( ! this . _recorder . injectedScript . document ?. body )
213+ return ;
210214 this . _observer = new MutationObserver ( mutations => {
211215 if ( ! this . _hoveredElement )
212216 return ;
@@ -601,6 +605,7 @@ class RecordActionTool implements RecorderTool {
601605 }
602606
603607 private _updateModelForHoveredElement ( ) {
608+ this . _installObserverIfNeeded ( ) ;
604609 if ( this . _performingActions . size )
605610 return ;
606611 if ( ! this . _hoveredElement || ! this . _hoveredElement . isConnected ) {
You can’t perform that action at this time.
0 commit comments