Skip to content

Commit

Permalink
fix adcheck dhowe#1338
Browse files Browse the repository at this point in the history
  • Loading branch information
cqx931 committed Mar 15, 2018
1 parent e6ff3fd commit 7ab660d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions platform/webext/vapi-usercss.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,14 @@ vAPI.DOMFilterer.prototype = {
userStylesheet.add(
entry.selectors + '\n{' + entry.declarations + '}'
);

}
// Adcheck
var nodes = document.querySelectorAll(entry.selectors + '');
for ( var node of nodes ) {
vAPI.adCheck && vAPI.adCheck(node);
}

}

this.addedCSSRules.clear();
Expand Down Expand Up @@ -127,7 +134,7 @@ vAPI.DOMFilterer.prototype = {
this.addedCSSRules.add(entry);
}

// ADN adCheck
// ADN adCheck
var nodes = document.querySelectorAll(selectorsStr);
for ( var node of nodes ) {
vAPI.adCheck && vAPI.adCheck(node);
Expand Down Expand Up @@ -184,7 +191,7 @@ vAPI.DOMFilterer.prototype = {
hideNode: function(node) {
if ( this.excludedNodeSet.has(node) ) { return; }
if ( this.hideNodeAttr === undefined ) { return; }

node.setAttribute(this.hideNodeAttr, '');
if ( this.hideNodeStyleSheetInjected === false ) {
this.hideNodeStyleSheetInjected = true;
Expand Down

0 comments on commit 7ab660d

Please sign in to comment.