Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3452
Use blob-based injection only when direct injection fails because
of a page's CSP. This is a mitigation until a better approach is
devised.
Such future better approach to investigate:
- Use `MAIN` world injection supported by contentScript.register()
since Firefox 128
- Investigate registering script to inject ahead of time thru
some heuristic
Add support for range for the `delay` paramater:
---
@param [delay]
A value to match against the delay. Can be a single value for exact match,
or a range:
- `min-max`: matches if delay >= min and delay <= max
- `min-`: matches if delay >= min
- `-max`: matches if delay <= max
No delay means to match any delay value.
Prepend with `!` to reverse the match condition.
---
As discussed with filter list maintainers.
As discussed with filter list maintainers, added ability to
partially replace an argument using the `repl:` prefix. Updated
documentation:
---
@scriptlet trusted-replace-argument.js
@description
Replace an argument passed to a method. Requires a trusted source.
@param propChain
The property chain to the function which argument must be replaced when
called.
@param argposRaw
The zero-based position of the argument in the argument list. Use a negative
number for a position relative to the last argument.
@param argraw
The replacement value, validated using the same heuristic as with the
`set-constant.js` scriptlet.
If the replacement value matches `json:...`, the value will be the
json-parsed string after `json:`.
If the replacement value matches `repl:/.../.../`, the target argument will
be replaced according the regex-replacement directive following `repl:`
@param [, condition, pattern]
Optional. The replacement will occur only when pattern matches the target
argument.
---
Aditionally, more scriptlets moved into their own files.
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/229
Add "Filter lists" pane in dashboard
The DNR API now supports enabling 50 static rulesets put of a
maximum of 100 (instead of 10 out of 50 originally). Thus given
the potentially growing number of static rulesets, the available
stock rulesets has been moved to its own pane, with the following
improvements:
- Support sublists
- Support search
Aditionally, "RU AdList: Counter" has been added as a stock
ruleset.
Other changes:
- Do not re-evaluate regexes which failed validation
- Better reduce `removeparam` rules
Potentially breaking change:
`urlskip=` option will no longer apply by default to blocked network
requests, only network requests which are not blocked can be skipped
through a `urlskip=` filter.
The new `urlskip=` directive `-blocked` can be used to explicitly
allow a `urlskip=` filter to also apply to blocked network requests.
Example: given the filter `||example.com^`, the filter:
||example.com/path/to/tracker$urlskip=?url
Will not prevent strict-blocking when navigating to:
https://example.com/path/to/tracker?url=https://example.org/
However, the filter:
||example.com/path/to/tracker$urlskip=-blocked ?url
Will cause the strict-blocking to be ignored and allow navigation
to proceed to the URL extracted as a result of applying the `urlskip=`
filter:
https://example.org/
Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/issues/3206#issuecomment-2439627386
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3206#issuecomment-2403795984
The first capture group of the regex will be used as the result of the
transformation. Example:
||podtrac.com/pts/redirect.mp3/$urlskip=/podtrac\.com\/pts\/redirect\.mp3\/(.*?\.mp3\b)/ +https
If the regex is invalid, or if it fails to extract a first capture
group, no redirection will occur.
A single request can require multiple calls to the static network
filtering engine (SNFE). The reported timing is the result of
going through *all* the required calls to SNFE. In effect, a
single call to SNFE.match() is a fraction of the reported timing.
BroadcastChannel constructor throws in Firefox when Enhanced
Tracking Protection is set to "strict".
This behavior could cause scriptlet injection to wholly break
when uBO's logger was opened, as BroadcastChannel() is used
by scriptlets to report information to the logger.
This commit ensures that exceptions from BroadcastChannel
constructor are properly handled.
The scriptlets will fall back to report at the console should
they be unable to report to the logger through BroadcastChannel.
Ensure serialization returns copy of data rather than live
references to data. This allows to immediately deserialize() the
result of serialize().
Also, adjust code to modified behavior of filterQuery().