diff --git a/src/js/contentscript.js b/src/js/contentscript.js index 211ed881a..b66a2fb82 100644 --- a/src/js/contentscript.js +++ b/src/js/contentscript.js @@ -209,7 +209,7 @@ vAPI.domFilterer = { if ( this.newCSSRules.length ) { styleTag = document.createElement('style'); styleTag.setAttribute('type', 'text/css'); - styleTag.textContent = ':root ' + this.newCSSRules.join(',\n:root '); + styleTag.textContent = ':root ' + this.newCSSRules.join('\n:root '); document.head.appendChild(styleTag); this.styleTags.push(styleTag); this.newCSSRules.length = 0; diff --git a/src/js/cosmetic-filtering.js b/src/js/cosmetic-filtering.js index 2b974249e..4fd41c57f 100644 --- a/src/js/cosmetic-filtering.js +++ b/src/js/cosmetic-filtering.js @@ -388,6 +388,10 @@ FilterParser.prototype.translateAdguardCSSInjectionFilter = function(raw) { if ( matches === null ) { return ''; } + // For now we do not allow generic CSS injections (prolly never). + if ( matches[1] === '' && matches[2] !== '@' ) { + return ''; + } return matches[1] + '#' + matches[2] + '#' + matches[3].trim() +