Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
#321 extended selector safari
  • Loading branch information
Mizzick committed Aug 19, 2016
1 parent ec01a50 commit dd28cba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions Extension/lib/filter/rules/css-filter.js
Expand Up @@ -146,8 +146,6 @@ CssFilter.prototype = {
},

/**
* Firefox only.
*
* Builds CSS to be injected to the page.
* This method builds CSS for CSS injection rules:
* http://adguard.com/en/filterrules.html#cssInjection
Expand All @@ -162,7 +160,7 @@ CssFilter.prototype = {
var injectDomainRules = [];
if (domainRules !== null) {
injectDomainRules = domainRules.filter(function (rule) {
return rule.isInjectRule && (!genericHide || !rule.isGeneric());
return (rule.isInjectRule || rule.extendedCss) && (!genericHide || !rule.isGeneric());
});
}

Expand Down
6 changes: 3 additions & 3 deletions Extension/tests/css-filter/test-css-filter.js
Expand Up @@ -304,15 +304,15 @@ QUnit.test("Extended Css Build Inject Css", function (assert) {
commonCss = filter.buildCss(null).css;
assert.equal(commonCss.length, 1);
assert.equal(css.length, 1);
assert.equal(extendedCss.length, 0);
assert.equal(extendedCss.length, 1);

selectors = filter.buildInjectCss("adguard.com", true);
css = selectors.css;
extendedCss = selectors.extendedCss;
commonCss = filter.buildCss(null).css;
assert.equal(commonCss.length, 1);
assert.equal(css.length, 1);
assert.equal(extendedCss.length, 0);
assert.equal(extendedCss.length, 1);

var exceptionInjectRule = new CssFilterRule('adguard.com#@$#.sponsored { display: none!important;}');
assert.ok(exceptionInjectRule.isInjectRule);
Expand All @@ -326,5 +326,5 @@ QUnit.test("Extended Css Build Inject Css", function (assert) {
commonCss = filter.buildCss(null).css;
assert.equal(commonCss.length, 1);
assert.equal(css.length, 1);
assert.equal(extendedCss.length, 0);
assert.equal(extendedCss.length, 1);
});

0 comments on commit dd28cba

Please sign in to comment.