Commit graph

4987 commits

Author SHA1 Message Date
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
Raymond Hill
1b00490a4d
Import translation work from https://crowdin.com/project/ublock 2025-06-22 11:28:39 -04:00
Raymond Hill
001bd5841f
Import translation work from https://crowdin.com/project/ublock 2025-06-22 11:27:19 -04:00
Raymond Hill
527b4a201f
Fix broken reverse lookup of filter lists
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/discussions/3684

Regression from:
8b696a691a
2025-06-22 08:05:34 -04:00
Raymond Hill
6e466cf945
Add [trusted-]edit-inbound-object scriptlets
As discussed with filter list maintainers.

@scriptlet edit-inbound-object.js
  @description
  Prune properties from an object passed as argument to a specific method.
  Properties can only be removed.
  @param propChain
  Property chain of the method to trap.
  @param argPos
  0-based position of the argument. Use negative integer for position relative
  to the end.
  @param jsonq
  A uBO-flavored JSONPath query.

@scriptlet trusted-edit-inbound-object.js
  @description
  Edit properties of an object passed as argument to a specific method.
  Properties can be assigned new values.
  @param propChain
  Property chain of the method to trap.
  @param argPos
  0-based position of the argument. Use negative integer for position relative
  to the end.
  @param jsonq
  A uBO-flavored JSONPath query.
2025-06-21 06:47:03 -04:00
Raymond Hill
d853f036c7
Import translation work from https://crowdin.com/project/ublock 2025-06-19 17:35:58 -04:00
Raymond Hill
1f5b4ccc53
Import translation work from https://crowdin.com/project/ublock 2025-06-18 12:40:48 -04:00
Raymond Hill
b73034523f
Import translation work from https://crowdin.com/project/ublock 2025-06-17 12:12:14 -04:00
Raymond Hill
0a8ea58bb7
Improve remove-cookie scriptlet
Related discussion:
afc6ff52ff (commitcomment-160172503)
2025-06-16 15:19:01 -04:00
Raymond Hill
33b92f91cb
Import translation work from https://crowdin.com/project/ublock 2025-06-15 19:07:07 -04:00
Raymond Hill
87e0434c90
Add json-edit-related scriptlets
edit-outbound-object-.js
 @description
 Prune properties from an object returned by a specific method.
 Properties can only be removed.
 @param jsonq
 A uBO-flavored JSONPath query.

trusted-edit-outbound-object.js
 @description
 Edit properties from an object returned by a specific method.
 Properties can be assigned new values.
 @param jsonq
 A uBO-flavored JSONPath query.

json-edit-xhr-request.js
 @description
 Edit the object sent as the body in a XHR instance.
 Properties can only be removed.
 @param jsonq
 A uBO-flavored JSONPath query.
 @param [propsToMatch, value]
 An optional vararg detailing the arguments to match when xhr.open() is
 called.

trusted-json-edit-xhr-request.js
 @description
 Edit the object sent as the body in a XHR instance.
 Properties can be assigned new values.
 @param jsonq
 A uBO-flavored JSONPath query.
 @param [propsToMatch, value]
 An optional vararg detailing the arguments to match when xhr.open() is
 called.

json-edit-fetch-request.js
 @description
 Edit the request body sent through the fetch API.
 Properties can only be removed.
 @param jsonq
 A uBO-flavored JSONPath query.
 @param [propsToMatch, value]
 An optional vararg detailing the arguments to match when fetch() is
 called.

trusted-json-edit-fetch-request.js
 @description
 Edit the request body sent through the fetch API.
 Properties can be assigned new values.
 @param jsonq
 A uBO-flavored JSONPath query.
 @param [propsToMatch, value]
 An optional vararg detailing the arguments to match when fetch() is
 called.
2025-06-15 13:55:09 -04:00
Raymond Hill
3a2bb62519
Improve trusted-set-cookie scriptlet
Ability to use regex value for `, domain, value` vararg.

Related discussion:
afc6ff52ff (commitcomment-160035082)
2025-06-14 09:26:27 -04:00
Raymond Hill
b50341089d
[mv3] Expand "Develop" pane
Move "No filtering" section in "Settings" to "Develop" pane. It is
now possible to view/edit the list of hostnames for any of the
filtering mode. This takes care of these issues:
- https://github.com/uBlockOrigin/uBOL-home/issues/270
- https://github.com/uBlockOrigin/uBOL-home/issues/297

Add ability to see all rulesets (read-only), to assist in investigating
filtering issues.
2025-06-13 12:46:05 -04:00
Raymond Hill
43a883396d
[mv3] Fix regression in handling important option
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/368
2025-06-13 11:11:27 -04:00
Raymond Hill
7060be775c
Import translation work from https://crowdin.com/project/ublock 2025-06-11 15:23:14 -04:00
Raymond Hill
a960140c30
Import translation work from https://crowdin.com/project/ublock 2025-06-03 16:56:10 -04:00
Raymond Hill
4affe343dd
Force cache bypass reload when no-scripting switch is toggled
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3652
2025-06-01 13:48:23 -04:00
Raymond Hill
837451c17a
Import translation work from https://crowdin.com/project/ublock 2025-05-31 11:32:54 -04:00
Raymond Hill
55d45a6fb1
Code review: safer to split on official line separator
Will still join lines using the detected line separator.
2025-05-30 11:19:12 -04:00
Raymond Hill
ed9999efd6
Improve jsonl[...] suite of scriptlets
Reuse original line separator when reassembling JSONL lines.
2025-05-30 11:06:33 -04:00
Raymond Hill
fbb96c7234
Import translation work from https://crowdin.com/project/ublock 2025-05-30 08:06:25 -04:00
Raymond Hill
3d5d8e8220
Remove obsolete "shortcut" token from link rel="icon"
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3634
2025-05-30 06:56:10 -04:00
Raymond Hill
b69f809d91
Need this to distinguish FilterMessage instances 2025-05-29 15:19:03 -04:00
Raymond Hill
d8298bb067
Add support for network filter option message
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/1195
2025-05-29 13:23:56 -04:00
Raymond Hill
cac62c6dc0
Import translation work from https://crowdin.com/project/ublock 2025-05-29 10:05:13 -04:00