From 14bb1d47d3fa4c892a74fd90cf19fef518fde547 Mon Sep 17 00:00:00 2001 From: Anton Lazarev Date: Wed, 31 Jul 2024 12:12:06 -0700 Subject: [PATCH] strip out rules with head\" --- scripts/generateAdBlockRustDataFiles.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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