Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/child/elemHide.js

Issue 29347936: Issue 4211 - Improve detection of uninitialized documents for means of element hiding (Closed)
Patch Set: Created July 18, 2016, 2 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(({
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld