Mind exception filters for `replace=` option

Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/discussions/2952
This commit is contained in:
Raymond Hill 2023-11-10 10:45:24 -05:00
parent a986a03b97
commit 15e3f763a3
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
4 changed files with 15 additions and 9 deletions

View File

@ -15,7 +15,7 @@ To benefit the much shorter update period enabled by differential updates, you m
## Fixes / changes
- [Ensure CSSTree does not hold a reference onto last parsed string](https://github.com/gorhill/uBlock/commit/1dba557c9a)
- [Lower maximum Expires value to 4h](https://github.com/gorhill/uBlock/commit/2360bc02f3)
- [Lower minimum Expires value to 4h](https://github.com/gorhill/uBlock/commit/2360bc02f3)
- [Properly reset needle length in unserialized buffer](https://github.com/gorhill/uBlock/commit/8ed1ad9c9d)
- [Add additional flags to regional lists](https://github.com/gorhill/uBlock/commit/0962366524) (by @DandelionSprout)
- [Harden scriptlets which need to serialize function code into string](https://github.com/gorhill/uBlock/commit/7823d98070)

View File

@ -271,7 +271,7 @@
"ublock-cookies-adguard": {
"content": "filters",
"group": "annoyances",
"parent": "AdGuard Annoyances|AdGuard/uBO Cookie Notices",
"parent": "AdGuard Annoyances|AdGuard/uBO Cookie Notices",
"off": true,
"title": "uBlock filters Cookie Notices",
"tags": "annoyances cookies",
@ -392,7 +392,7 @@
"ublock-cookies-easylist": {
"content": "filters",
"group": "annoyances",
"parent": "EasyList Annoyances|EasyList/uBO Cookie Notices",
"parent": "EasyList Annoyances|EasyList/uBO Cookie Notices",
"off": true,
"title": "uBlock filters Cookie Notices",
"tags": "annoyances cookies",
@ -820,8 +820,9 @@
"lang": "be kk tt ru uk uz",
"contentURL": "https://raw.githubusercontent.com/easylist/ruadlist/master/RuAdList-uBO.txt",
"cdnURLs": [
"https://cdn.jsdelivr.net/gh/easylist/ruadlist@master/RuAdList-uBO.txt",
"https://cdn.statically.io/gh/easylist/ruadlist/master/RuAdList-uBO.txt"
"https://cdn.jsdelivr.net/gh/dimisa-RUAdList/RUAdListCDN@main/lists/ruadlist.ubo.min.txt",
"https://cdn.statically.io/gh/dimisa-RUAdList/RUAdListCDN/main/lists/ruadlist.ubo.min.txt",
"https://raw.githubusercontent.com/dimisa-RUAdList/RUAdListCDN/main/lists/ruadlist.ubo.min.txt"
],
"supportURL": "https://forums.lanik.us/viewforum.php?f=102",
"instructionURL": "https://forums.lanik.us/viewtopic.php?f=102&t=22512"

View File

@ -272,7 +272,7 @@
"ublock-cookies-adguard": {
"content": "filters",
"group": "annoyances",
"parent": "AdGuard Annoyances|AdGuard/uBO Cookie Notices",
"parent": "AdGuard Annoyances|AdGuard/uBO Cookie Notices",
"off": true,
"title": "uBlock filters Cookie Notices",
"tags": "annoyances cookies",
@ -393,7 +393,7 @@
"ublock-cookies-easylist": {
"content": "filters",
"group": "annoyances",
"parent": "EasyList Annoyances|EasyList/uBO Cookie Notices",
"parent": "EasyList Annoyances|EasyList/uBO Cookie Notices",
"off": true,
"title": "uBlock filters Cookie Notices",
"tags": "annoyances cookies",
@ -821,8 +821,9 @@
"lang": "be kk tt ru uk uz",
"contentURL": "https://raw.githubusercontent.com/easylist/ruadlist/master/RuAdList-uBO.txt",
"cdnURLs": [
"https://cdn.jsdelivr.net/gh/easylist/ruadlist@master/RuAdList-uBO.txt",
"https://cdn.statically.io/gh/easylist/ruadlist/master/RuAdList-uBO.txt"
"https://cdn.jsdelivr.net/gh/dimisa-RUAdList/RUAdListCDN@main/lists/ruadlist.ubo.min.txt",
"https://cdn.statically.io/gh/dimisa-RUAdList/RUAdListCDN/main/lists/ruadlist.ubo.min.txt",
"https://raw.githubusercontent.com/dimisa-RUAdList/RUAdListCDN/main/lists/ruadlist.ubo.min.txt"
],
"supportURL": "https://forums.lanik.us/viewforum.php?f=102",
"instructionURL": "https://forums.lanik.us/viewtopic.php?f=102&t=22512"

View File

@ -613,6 +613,10 @@ function textResponseFilterer(session, directives) {
const applied = [];
for ( const directive of directives ) {
if ( directive.refs instanceof Object === false ) { continue; }
if ( directive.result !== 1 ) {
applied.push(directive);
continue;
}
const { refs } = directive;
if ( refs.$cache === null ) {
refs.$cache = sfp.parseReplaceValue(refs.value);