mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-07 03:12:33 +01:00
remove stray comma separator in injected CSS declarations
This commit is contained in:
parent
3752ac4880
commit
87d0cce9b2
@ -209,7 +209,7 @@ vAPI.domFilterer = {
|
|||||||
if ( this.newCSSRules.length ) {
|
if ( this.newCSSRules.length ) {
|
||||||
styleTag = document.createElement('style');
|
styleTag = document.createElement('style');
|
||||||
styleTag.setAttribute('type', 'text/css');
|
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);
|
document.head.appendChild(styleTag);
|
||||||
this.styleTags.push(styleTag);
|
this.styleTags.push(styleTag);
|
||||||
this.newCSSRules.length = 0;
|
this.newCSSRules.length = 0;
|
||||||
|
@ -388,6 +388,10 @@ FilterParser.prototype.translateAdguardCSSInjectionFilter = function(raw) {
|
|||||||
if ( matches === null ) {
|
if ( matches === null ) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
// For now we do not allow generic CSS injections (prolly never).
|
||||||
|
if ( matches[1] === '' && matches[2] !== '@' ) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
return matches[1] +
|
return matches[1] +
|
||||||
'#' + matches[2] + '#' +
|
'#' + matches[2] + '#' +
|
||||||
matches[3].trim() +
|
matches[3].trim() +
|
||||||
|
Loading…
Reference in New Issue
Block a user