| Index: include.preload.js |
| =================================================================== |
| --- a/include.preload.js |
| +++ b/include.preload.js |
| @@ -425,17 +425,18 @@ function ElemHide() |
| window, |
| callback => |
| { |
| ext.backgroundPage.sendMessage({ |
| type: "filters.get", |
| what: "elemhideemulation" |
| }, callback); |
| }, |
| - this.addSelectors.bind(this) |
| + this.addSelectors.bind(this), |
| + this.hideElements.bind(this) |
| ); |
| } |
| ElemHide.prototype = { |
| selectorGroupSize: 200, |
| createShadowTree() |
| { |
| // Use Shadow DOM if available as to not mess with with web pages that |
| @@ -536,16 +537,27 @@ ElemHide.prototype = { |
| this.style.sheet.insertRule(selector + "{display: none !important;}", |
| this.style.sheet.cssRules.length); |
| } |
| if (this.tracer) |
| this.tracer.addSelectors(selectors, filters || selectors); |
| }, |
| + hideElements(elements, filters) |
| + { |
| + for (let element of elements) |
| + { |
| + element.style.display = "none"; |
|
Sebastian Noack
2017/04/04 10:14:45
We should use the same logic as we have in checkCo
hub
2017/04/05 09:05:53
Done.
|
| + } |
| + // XXX first arg is supposed to be selectors |
| + if (this.tracer) |
| + this.tracer.addSelectors(filters, filters); |
|
Sebastian Noack
2017/04/04 10:14:45
ElementHidingTracer.addSelectors() will search for
hub
2017/04/05 09:05:53
Done.
|
| + }, |
| + |
| apply() |
| { |
| ext.backgroundPage.sendMessage({type: "get-selectors"}, response => |
| { |
| if (this.tracer) |
| this.tracer.disconnect(); |
| this.tracer = null; |