Index: include.preload.js |
=================================================================== |
--- a/include.preload.js |
+++ b/include.preload.js |
@@ -436,17 +436,17 @@ |
).join(", "); |
this.style.sheet.insertRule(selector + "{display: none !important;}", |
this.style.sheet.cssRules.length); |
} |
}, |
addSelectors(selectors, filters) |
{ |
- if (!selectors || selectors.length == 0) |
+ if (selectors.length == 0) |
return; |
if (this.inject) |
{ |
// Insert the style rules inline if we have been instructed by the |
// background page to do so. This is usually the case, except on platforms |
// that do support user stylesheets via the chrome.tabs.insertCSS API |
// (Firefox 53 onwards for now and possibly Chrome in the near future). |
@@ -496,20 +496,23 @@ |
this.style.parentElement.removeChild(this.style); |
this.style = null; |
if (response.trace) |
this.tracer = new ElementHidingTracer(); |
this.inject = response.inject; |
- if (this.inject) |
- this.addSelectors(response.selectors); |
- else if (this.tracer) |
- this.tracer.addSelectors(response.selectors); |
+ if (response.selectors) |
Manish Jethani
2017/09/17 13:51:38
Check for the existence of response.selectors sinc
|
+ { |
+ if (this.inject) |
+ this.addSelectors(response.selectors); |
+ else if (this.tracer) |
+ this.tracer.addSelectors(response.selectors); |
+ } |
this.elemHideEmulation.apply(); |
}); |
} |
}; |
if (document instanceof HTMLDocument) |
{ |