Commit graph

5011 commits

Author SHA1 Message Date
Raymond Hill
10e48d7ec5
Import translation work from https://crowdin.com/project/ublock 2025-09-27 12:31:08 -04:00
Raymond Hill
3e5ea3b03f
Fix removeparam for multiple query parameters with same name
Related issue:
https://github.com/uBlockOrigin/uAssets/issues/30090
2025-09-26 11:55:38 -04:00
Raymond Hill
34d202f79d
Import translation work from https://crowdin.com/project/ublock 2025-09-25 09:08:34 -04:00
Raymond Hill
4598ef3edc
Import translation work from https://crowdin.com/project/ublock 2025-09-24 10:48:18 -04:00
Raymond Hill
8af80be5b2
[mv3] Add dashboard pane to manage custom filters
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/418
2025-09-24 10:42:18 -04:00
Raymond Hill
9aa91ba111
Improve trusted-click-element scriptlet
Related discussion/issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2917
- https://github.com/uBlockOrigin/uAssets/discussions/30124

The "list of selectors" parameter is now a "list of steps". A step
can be:

- A selector, which tells the scriptlet to click a matching element. If
  no matching element is found, the scriptlet will wait for a matching
  element  to become available.
- An integer, which tells the scriptlet to wait n ms before processing
  the next step
- A directive, which is a string starting with `!` (not implemented yet)

If the last item in the list is an integer, this tells the scriplet to
override the built-in timeout value of 10s, such that the life time of
the scriptlet can now be extended beyond 10s.

Example:

  ..##+js(trusted-click-element, '1000, a, 500, b, c, 15000')

The scriptlet filter above will perform the following steps, in order:

- Prepare the scriptlet to timeout at 15s from now
- Wait 1000 ms
- Wait for element `a` to become available then click on it
- Wait 500 ms
- Wait for element `b` to become available then click on it
- Wait for element `c` to become available then click on it
- Abort if all the steps cannot be completed before 15s

The changes keep compatiblity with older syntax or with AdGuard
syntax.
2025-09-22 18:50:58 -04:00
Raymond Hill
705e6329eb
Import translation work from https://crowdin.com/project/ublock 2025-09-22 12:46:13 -04:00
Raymond Hill
8de47f250d
Improve google-ima shim
Related issue:
https://github.com/uBlockOrigin/uAssets/issues/30134
2025-09-22 10:41:36 -04:00
Raymond Hill
889c0eb208
Fix potential infinite loop when scanning for $ anchor
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3799

An infinite loop in the network filter parser was triggered when
the following conditions were fulfilled:

- There was a network option `$` anchor
- There were only whitespace character(s) preceding the anchor
- There was an invalid filter option following the anchor
2025-09-15 09:26:09 -04:00
Raymond Hill
30e5e8c8ce
Remove obsolete code 2025-09-08 14:09:55 -04:00
Raymond Hill
52dba4116e
Allow generic exception for replace= option
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3791
2025-09-08 07:32:03 -04:00
Raymond Hill
0936b9b8b7
Import translation work from https://crowdin.com/project/ublock 2025-09-06 08:23:05 -04:00
Raymond Hill
d2bce26e7d
Improve prevent-fetch scriptlet
Add vararg `throttle, n` where `n` is the time to wait in ms before
returning a response from proxied `fetch()`.

As discussed with filter list maintainers.
2025-09-02 10:00:27 -04:00
Raymond Hill
64858e9b9e
Minor 2025-08-30 09:58:33 -04:00
Raymond Hill
17c6334cbd
Import translation work from https://crowdin.com/project/ublock 2025-08-30 09:15:19 -04:00
Raymond Hill
6327aae56c
Add support to strict-block from ipaddress= option
As discussed with filter list maintainers.
2025-08-28 11:13:43 -04:00
Raymond Hill
5d7e5ee3a0
Improve rendering with high-contrast theme
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3385
2025-08-20 11:02:35 -04:00
Raymond Hill
807d1b6cdb
Fix checkbox visual when using high contrast
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3385
2025-08-19 11:50:58 -04:00
Raymond Hill
4814992c54
Import translation work from https://crowdin.com/project/ublock 2025-08-17 10:27:46 -04:00
Raymond Hill
9327e19233
Fix undue fetch from remote server at first install
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3761

Regression from:
69fce3aa6e
2025-08-17 08:01:51 -04:00
Raymond Hill
60ab2ad59c
Fix regression in static filtering parser
Related commit:
aaf35d9d71
2025-08-16 09:06:25 -04:00
Raymond Hill
aaf35d9d71
Improve compatibility of uritransform= with DNR syntax
The `uritransform=` option will now be converted to a proper DNR
rule when the following condition are fulfilled:

- The value of the `uritransform` option matches `//[replacement]/`,
i.e. the pattern to match is empty, and only the replacement part is
provided.

- The filter pattern is a regex.

Is such case, the DNR rule will be a `redirect` making use of the
`regexSubstitution` property.

In case the above conditions are not fulfilled, the filter will
be discarded as incompatible with DNR syntax (as was the case
before).

This is potentially a breaking change, in cases where a filter
assumed that the part to match was the start of the path part of
a URL.

A reminder that `uritransform` is an option which requires a
trusted source, otherwise it is rejected.
2025-08-15 15:55:33 -04:00
Raymond Hill
07e9f805bb
Allow usage of csp=/permissions= with resource type object
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3746
2025-08-10 09:22:17 -04:00
Raymond Hill
faff035203
JSONPath: Add ability to select root node for appending/modifying
As discussed with filter list maintainers.

Examples of usage:

  $ => result is `null`
  $+={"modifyOrCreate": "..."}

These expressions were not working with previous version.
2025-08-09 13:56:02 -04:00
Raymond Hill
38ca6d41ff
JSONPath: Add ability to substitute a pattern within a string value
As discussed with filter list maintainers.

Examples of JSON path expression to replace a pattern within a string
value:

  ..book.*.author=repl({"pattern": "Melville", "replacement": "Toto"})
  ..book.*.author=repl({"regex": "e", "replacement": "o"})
  ..book.*.author=repl({"regex": "e", "flags": "g", "replacement": "o"})

If the target value is not a string, no modification will occur.
2025-08-09 11:05:27 -04:00
Raymond Hill
1e0c64076f
[mv3] Fix regression with highly generic cosmetic filters CSS files
Regression from:
56ba93700c

Related feedback:
https://old.reddit.com/r/uBlockOrigin/comments/1mi8fd6/ublock_origin_lite_for_ios/n725s6l/
2025-08-05 13:25:14 -04:00
Raymond Hill
bbfe7400ac
[mv3] Support important option for removeparam option
Related discussion:
https://github.com/uBlockOrigin/uAssets/issues/29451#issuecomment-3150181993

When transposing a `removeparam` dilter to a DNR rule, the semantic of
the `important` option changes to "overrides ` allow` rules".
2025-08-04 10:09:39 -04:00
Raymond Hill
bb1d085c8c
Import translation work from https://crowdin.com/project/ublock 2025-08-03 16:04:17 -04:00
Raymond Hill
32bf5ebde3
[mv3] Add support for procedural cosmetic filters
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/325
2025-08-03 15:50:22 -04:00
Raymond Hill
7d9317bb17
Improve fingerprint2.js shim 2025-07-28 09:14:32 -04:00
Raymond Hill
1476ae4262
Import translation work from https://crowdin.com/project/ublock 2025-07-23 11:37:18 -04:00
Raymond Hill
348f151e36
Also report char segment size 2025-07-22 11:19:16 -04:00
Raymond Hill
47cbb43a0e
Make google-ima a valid injectable scriptlet
Related feedback:
https://www.reddit.com/r/uBlockOrigin/comments/1m4dbk1/ublock_being_detected_on_south_park_studios/
2025-07-20 10:53:56 -04:00
Raymond Hill
fef50e59f2
Improve abort-current-script scriptlet
Prevent webpages from tampering with `textContent`.

Borrow solution from:
c2d7378e4d/src/scriptlets/abort-current-inline-script.js (L98-L99)
2025-07-20 10:26:31 -04:00
Raymond Hill
8ae7c1501b
Import translation work from https://crowdin.com/project/ublock 2025-07-18 15:18:56 -04:00
Raymond Hill
e07e7bbd09
Fix potential exception in procedural operator :matches-attr
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3720
2025-07-18 10:23:11 -04:00
Raymond Hill
bb9e2c0fc7
Import translation work from https://crowdin.com/project/ublock 2025-07-17 10:30:22 -04:00
Raymond Hill
b7510eee61
Improve reporting of reason option in strict-blocked pages
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/1195#issuecomment-3072981070
2025-07-15 12:10:10 -04:00
Raymond Hill
255b143c80
Import translation work from https://crowdin.com/project/ublock 2025-07-11 08:49:58 -04:00
Raymond Hill
b0396029bd
Improve prevent-innerHTML scriptlet
Related issue:
https://github.com/uBlockOrigin/uAssets/issues/29148
2025-07-11 08:35:10 -04:00
Raymond Hill
28bc5905a8
Import translation work from https://crowdin.com/project/ublock 2025-07-08 07:55:56 -04:00
Raymond Hill
78305e11c9
Import translation work from https://crowdin.com/project/ublock 2025-07-06 16:59:43 -04:00
Raymond Hill
0b0294af4f
[mv3] Add support for custom CSS-based cosmetic filters
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/325

This is a first version, with support only for custom filters which are
plain CSS selectors. Future versions will extend support to style-based
and procedural cosmetic filters.

Manually text-editing existing custom filters is currently not supported,
this will be added in a future version in the Develop pane. To remove
existing custom filters, the "Remove a custom filter" tool can be used.
2025-07-06 16:43:22 -04:00
Raymond Hill
b398bd8487
[regression] Normalize header names to lowercase
Related commit:
https://github.com/gorhill/uBlock/commit/408b538e75
2025-07-05 10:59:22 -04:00
Raymond Hill
76b72c9e65
Import translation work from https://crowdin.com/project/ublock 2025-07-03 09:46:52 -04:00
Raymond Hill
eec2045645
[mv3] Fix calculation of priority value when converting redirect filters 2025-07-03 09:22:09 -04:00
Raymond Hill
e27bb85222
Import translation work from https://crowdin.com/project/ublock 2025-06-28 06:20:23 -04:00
Raymond Hill
66b68b4442
Reset important option flag at header evaluation time 2025-06-28 06:07:09 -04:00
Raymond Hill
3a473f8c48
Import translation work from https://crowdin.com/project/ublock 2025-06-24 10:56:43 -04:00
Raymond Hill
253ef7ade3
Complete support for reporing strict-block messages
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/1195
2025-06-22 11:28:54 -04:00