Skip to content

Commit

Permalink
strip out rules with head\"
Browse files Browse the repository at this point in the history
  • Loading branch information
antonok-edm committed Jul 31, 2024
1 parent bf89221 commit 14bb1d4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/generateAdBlockRustDataFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 14bb1d4

Please sign in to comment.