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

Unified Diff: include.preload.js

Issue 29367475: Issue 4659 - Incorporate element hiding emulation filters (Closed) Base URL: https://bitbucket.org/fhd/adblockpluschrome
Patch Set: Update adblockplusui dependency and combine common.js and elemHideEmulation.js content scripts Created Dec. 20, 2016, 2:30 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 | « dependencies ('k') | metadata.common » ('j') | metadata.common » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.preload.js
===================================================================
--- a/include.preload.js
+++ b/include.preload.js
@@ -425,23 +425,23 @@
}
function ElemHide()
{
this.shadow = this.createShadowTree();
this.style = null;
this.tracer = null;
- this.propertyFilters = new CSSPropertyFilters(
+ this.elemHideEmulation = new ElemHideEmulation(
window,
function(callback)
{
ext.backgroundPage.sendMessage({
type: "filters.get",
- what: "cssproperties"
+ what: "elemhideemulation"
}, callback);
},
this.addSelectors.bind(this)
);
}
ElemHide.prototype = {
selectorGroupSize: 200,
@@ -539,47 +539,47 @@
this.style.sheet.insertRule(selector + "{display: none !important;}",
this.style.sheet.cssRules.length);
}
},
apply: function()
{
var selectors = null;
- var propertyFiltersLoaded = false;
+ var elemHideEmulationLoaded = false;
var checkLoaded = function()
{
- if (!selectors || !propertyFiltersLoaded)
+ if (!selectors || !elemHideEmulationLoaded)
return;
if (this.tracer)
this.tracer.disconnect();
this.tracer = null;
if (this.style && this.style.parentElement)
this.style.parentElement.removeChild(this.style);
this.style = null;
this.addSelectors(selectors.selectors);
- this.propertyFilters.apply();
+ this.elemHideEmulation.apply();
if (selectors.trace)
this.tracer = new ElementHidingTracer(selectors.selectors);
}.bind(this);
ext.backgroundPage.sendMessage({type: "get-selectors"}, function(response)
{
selectors = response;
checkLoaded();
});
- this.propertyFilters.load(function()
+ this.elemHideEmulation.load(function()
{
- propertyFiltersLoaded = true;
+ elemHideEmulationLoaded = true;
checkLoaded();
});
}
};
if (document instanceof HTMLDocument)
{
checkSitekey();
« no previous file with comments | « dependencies ('k') | metadata.common » ('j') | metadata.common » ('J')

Powered by Google App Engine
This is Rietveld