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

Unified Diff: lib/child/cssProperties.js

Issue 29340718: Issue 3964 - Fix race condition, CSS property filters applying too early (Closed)
Patch Set: Created April 21, 2016, 12:56 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/cssProperties.js
===================================================================
--- a/lib/child/cssProperties.js
+++ b/lib/child/cssProperties.js
@@ -57,17 +57,17 @@
let onContentWindow = (subject, topic, data) =>
{
if (!(subject instanceof Ci.nsIDOMWindow))
return;
let onReady = event =>
{
- subject.removeEventListener("DOMContentLoaded", onReady);
+ subject.removeEventListener("load", onReady);
let handler = new scope.CSSPropertyFilters(subject, selectors =>
{
if (selectors.length == 0)
return;
addUserCSS(subject, selectors.map(
selector => selector + "{display: none !important;}"
).join("\n"));
@@ -76,17 +76,17 @@
// HACK: The content script just calls ext.backgroundPage.sendMessage
// without indicating which window this is about. We'll store the window
// here because we know that messaging happens synchronously.
senderWindow = subject;
handler.load(() => handler.apply());
senderWindow = null;
};
- subject.addEventListener("DOMContentLoaded", onReady);
+ subject.addEventListener("load", onReady);
};
Services.obs.addObserver(onContentWindow, "content-document-global-created",
false);
onShutdown.add(() =>
{
Services.obs.removeObserver(onContentWindow,
"content-document-global-created");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld