 Issue 29347936:
  Issue 4211 - Improve detection of uninitialized documents for means of element hiding  (Closed)
    
  
    Issue 29347936:
  Issue 4211 - Improve detection of uninitialized documents for means of element hiding  (Closed) 
  | Index: lib/child/elemHide.js | 
| =================================================================== | 
| --- a/lib/child/elemHide.js | 
| +++ b/lib/child/elemHide.js | 
| @@ -320,23 +320,24 @@ let observer = { | 
| }); | 
| }, | 
| observe: function(subject, topic, data) | 
| { | 
| if (topic != this.topic) | 
| return; | 
| - if (!subject.location || !subject.location.href) | 
| + if (subject.document.readyState == "uninitialized") | 
| { | 
| - // The window is in an invalid state - delay processing until it's ready. | 
| + // It would be nice to listen to the readystatechange event here. However, | 
| + // it doesn't fire when changing from "uninitialized" state. | 
| 
Thomas Greiner
2016/07/18 15:58:14
While the "unitialized" state is not mentioned in
 
Wladimir Palant
2016/07/18 18:07:18
Given that "uninitialized" means "too early to be
 | 
| Utils.runAsync(() => | 
| { | 
| if (!Cu.isDeadWrapper(subject)) | 
| - this.observe(subject, topic, data) | 
| + this.observe(subject, topic, data); | 
| }); | 
| return; | 
| } | 
| port.emitWithResponse("elemhideEnabled", { | 
| frames: getFrames(subject), | 
| isPrivate: isPrivate(subject) | 
| }).then(({ |