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

Unified Diff: chrome/content/elemHideEmulation.js

Issue 29375888: [adblockpluscore] Issue 4911 - Merge ElemHideEmulation.load/apply into one function (Closed)
Patch Set: Created Feb. 18, 2017, 11:08 a.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: chrome/content/elemHideEmulation.js
diff --git a/chrome/content/elemHideEmulation.js b/chrome/content/elemHideEmulation.js
index 82912c51cfdff241d5cc886ee49c0422b082cb0c..d800c3de92c99c4848fef48b94df8c2a8cc3adc5 100644
--- a/chrome/content/elemHideEmulation.js
+++ b/chrome/content/elemHideEmulation.js
@@ -121,7 +121,7 @@ ElemHideEmulation.prototype = {
this.addSelectors([stylesheet]);
},
- load: function(callback)
+ apply: function(callback)
Sebastian Noack 2017/02/18 11:28:13 The callback parameter is unused now.
wspee 2017/02/18 12:49:50 Done.
{
this.getFiltersFunc(function(patterns)
{
@@ -150,17 +150,12 @@ ElemHideEmulation.prototype = {
});
}
- callback();
+ if (this.patterns.length > 0)
+ {
+ var document = this.window.document;
+ this.addSelectors(document.styleSheets);
+ document.addEventListener("load", this.onLoad.bind(this), true);
+ }
}.bind(this));
- },
-
- apply: function()
- {
- if (this.patterns.length > 0)
- {
- var document = this.window.document;
- this.addSelectors(document.styleSheets);
- document.addEventListener("load", this.onLoad.bind(this), true);
- }
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld