diff --git a/scripts/generateAdBlockRustDataFiles.js b/scripts/generateAdBlockRustDataFiles.js index 837f29f0..2d27883e 100644 --- a/scripts/generateAdBlockRustDataFiles.js +++ b/scripts/generateAdBlockRustDataFiles.js @@ -52,12 +52,18 @@ const enforceBraveDirectives = (title, data) => { } const removeIncompatibleRules = (listBuffer) => { - // Prior to adblock-rust 0.8.7, scriptlet arguments with trailing escaped commas can cause crashes. listBuffer.data = listBuffer.data.split('\n').filter(line => { line = line.trim() + // Prior to adblock-rust 0.8.7, scriptlet arguments with trailing escaped commas can cause crashes. if (line.indexOf('+js(') >= 0 && line.endsWith('\\,)')) { return false } + // The rules from this commit don't include valid CSS; at the time of writing, + // Brave throws an error from the generic filter injection script if any CSS is invalid. + // https://github.com/uBlockOrigin/uAssets/commit/6eaa9dd46371478d76371426cb99f75d99c7402d + if (line.startsWith('##') >= 0 && line.indexOf('head\\"') >= 0) { + return false + } return true }).join('\n') return listBuffer