File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
extension/js/content_scripts/webmail/gmail Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -150,15 +150,13 @@ export class GmailElementReplacer extends WebmailElementReplacer {
150150 } ;
151151
152152 public setupSecureActionsOnGmailMenu = ( ) => {
153- $ ( ( ) => {
154- const observer = new MutationObserver ( ( ) => {
155- const gmailActionsMenu = $ ( this . sel . msgActionsMenu ) ;
156- if ( gmailActionsMenu . is ( ':visible' ) ) {
157- this . addSecureActionsToMessageMenu ( ) ;
158- }
159- } ) ;
160- observer . observe ( document . body , { childList : true , subtree : true } ) ;
153+ const observer = new MutationObserver ( ( ) => {
154+ const gmailActionsMenu = document . querySelector ( this . sel . msgActionsMenu ) ;
155+ if ( gmailActionsMenu && ( gmailActionsMenu as HTMLElement ) . offsetParent !== undefined ) {
156+ this . addSecureActionsToMessageMenu ( ) ;
157+ }
161158 } ) ;
159+ observer . observe ( document . body , { childList : true , subtree : true } ) ;
162160 } ;
163161
164162 private everything = ( ) => {
You can’t perform that action at this time.
0 commit comments