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 {
61
61
this . _glassPaneElement . style . right = '0' ;
62
62
this . _glassPaneElement . style . bottom = '0' ;
63
63
this . _glassPaneElement . style . left = '0' ;
64
- this . _glassPaneElement . style . zIndex = '2147483646 ' ;
64
+ this . _glassPaneElement . style . zIndex = '2147483647 ' ;
65
65
this . _glassPaneElement . style . pointerEvents = 'none' ;
66
66
this . _glassPaneElement . style . display = 'flex' ;
67
67
this . _glassPaneElement . style . backgroundColor = 'transparent' ;
@@ -90,7 +90,9 @@ export class Highlight {
90
90
91
91
install ( ) {
92
92
// 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 )
94
96
this . _injectedScript . document . documentElement . appendChild ( this . _glassPaneElement ) ;
95
97
}
96
98
Original file line number Diff line number Diff line change @@ -206,7 +206,11 @@ class RecordActionTool implements RecorderTool {
206
206
return 'pointer' ;
207
207
}
208
208
209
- install ( ) {
209
+ private _installObserverIfNeeded ( ) {
210
+ if ( this . _observer )
211
+ return ;
212
+ if ( ! this . _recorder . injectedScript . document ?. body )
213
+ return ;
210
214
this . _observer = new MutationObserver ( mutations => {
211
215
if ( ! this . _hoveredElement )
212
216
return ;
@@ -601,6 +605,7 @@ class RecordActionTool implements RecorderTool {
601
605
}
602
606
603
607
private _updateModelForHoveredElement ( ) {
608
+ this . _installObserverIfNeeded ( ) ;
604
609
if ( this . _performingActions . size )
605
610
return ;
606
611
if ( ! this . _hoveredElement || ! this . _hoveredElement . isConnected ) {
You can’t perform that action at this time.
0 commit comments