Commit graph

4891 commits

Author SHA1 Message Date
Raymond Hill
8632cd6072
Fix typo causing regression in uritransform=
Related feedback:
https://github.com/uBlockOrigin/uAssets/discussions/27802
2025-03-30 16:56:04 -04:00
Raymond Hill
9adedbc30e
Remove the need for parethesis for JSONPath filter selectors
As per official proposed standard:
https://www.rfc-editor.org/rfc/rfc9535.html#name-filter-selector
2025-03-30 13:57:04 -04:00
Raymond Hill
5587111d21
Add support for union syntax in JSONPath
This immediately useful to list maintainers.

Related commits:
- https://github.com/gorhill/uBlock/commit/d5fd1de150
- https://github.com/gorhill/uBlock/commit/b18daa53aa
- https://github.com/gorhill/uBlock/commit/caa25cdaf3
2025-03-30 12:36:37 -04:00
Raymond Hill
97e740bd2c
Code viewer shouldn't be maximizable
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3161#issuecomment-2764549781
2025-03-30 09:34:22 -04:00
Raymond Hill
b381ceda72
Mind other old constructs for scriptlets
Related feedback:
https://old.reddit.com/r/uBlockOrigin/comments/1jmcqhn/

Related commit:
https://github.com/gorhill/uBlock/commit/44c038b9a1
2025-03-29 09:54:41 -04:00
Raymond Hill
44c038b9a1
Fix for old scriptlet syntax
Related feedback:
https://old.reddit.com/r/uBlockOrigin/comments/1jmcqhn/
2025-03-29 09:06:07 -04:00
Raymond Hill
564f3f3442
English 2025-03-28 10:24:21 -04:00
Raymond Hill
caa25cdaf3
Add minimal in-code documentation for JSONPath 2025-03-28 10:20:21 -04:00
Raymond Hill
b18daa53aa
Add json-edit suite of scriptlets; extend replace= option
Scriptlets added:
- json-edit
- trusted-json-edit
- json-edit-xhr-response
- trusted-json-edit-xhr-response
- json-edit-fetch-response
- trusted-json-edit-fetch-response
- jsonl-edit-xhr-response
- trusted-jsonl-edit-xhr-response
- jsonl-edit-fetch-response
- trusted-jsonl-edit-fetch-response

These scriptlets are functionally similar to their `json-prune` counterpart,
except that they all use the new uBO-flavored JSONPath syntax, and the
`trusted-` versions allow to modify values instead of just removing them.

The `replace=` filter option has been extended to support applying
uBO-flavored JSONPath syntax to the response body. If the `replace=`
value starts with `json:` or `jsonl:`, the remaining of the value will
be interpreted as a JSONPath directive, which can be used to either
remove or modify property in a JSON document.
2025-03-28 09:51:38 -04:00
Raymond Hill
1ce00e4fda
Import translation work from https://crowdin.com/project/ublock 2025-03-27 22:51:48 -04:00
Raymond Hill
d5fd1de150
Use JSONPath-like syntax for new jsonl- scriptlets 2025-03-26 11:47:56 -04:00
Raymond Hill
760bd23c5e
Minor 2025-03-25 12:29:46 -04:00
Raymond Hill
68a256bdde
Improve trusted-prevent-dom-bypass scriptlet 2025-03-25 12:12:00 -04:00
Raymond Hill
e100f9e85c
Import translation work from https://crowdin.com/project/ublock 2025-03-25 08:20:43 -04:00
Raymond Hill
d18311213d
Improve jsonl-prune-... scriptlets 2025-03-24 12:16:10 -04:00
Raymond Hill
0fce659bb0
Use Object.hasOwn instead of Object.prototype.hasOwnProperty
Reference:
https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn
2025-03-24 08:15:09 -04:00
Raymond Hill
0c8de6b550
Fix prevent-innerHTML scriptlet 2025-03-24 07:33:21 -04:00
Raymond Hill
8f78faf980
Import translation work from https://crowdin.com/project/ublock 2025-03-22 16:11:10 -04:00
Raymond Hill
95a3be9d56
Add jsonl-prune-xhr-response/jsonl-prune-fetch-response scriptlets
As discussed internally with filter list volunteers.
2025-03-22 16:01:43 -04:00
Raymond Hill
7a2f4960d0
Import translation work from https://crowdin.com/project/ublock 2025-03-21 13:29:30 -04:00
Raymond Hill
88fa550a96
Improve [json-prune|trusted-replace]-fetch-response scriptlets
Output more information to the logger in verbose mode.
2025-03-20 12:06:58 -04:00
Raymond Hill
5b81369fc2
bidiTrie is hardcoded
Thus no need to threat it as if it was a changing parameter.
2025-03-20 12:03:17 -04:00
Raymond Hill
76b80baaea
Fix TypedArray overflow
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3582
2025-03-20 07:14:38 -04:00
Raymond Hill
18349292a6
Improve logging ability in new prevent-innerHTML scriptlet 2025-03-19 12:43:36 -04:00
Raymond Hill
fe744816f1
Add prevent-innerHTML scriptlet
@description
Conditionally prevent assignment to `innerHTML` property.

@param [selector]
Optional. The element must matches `selector` for the prevention to take
place.

@param [pattern]
Optional. A pattern to match against the assigned value. The pattern can be
a plain string, or a regex. Prepend with `!` to reverse the match condition.

As discussed with filter list volunteers.
2025-03-19 12:34:03 -04:00
Raymond Hill
98b011f64c
[mv3] Add support for explicit generichide filter option
`generichide` option is implicitly enforced on all sites unless an
exception overrides `generichide`. Though rare, sometimes a
`generichide` exception needs to be overridden so that generic
cosmetic filtering is made possible on a specific site.

This commit is to add support for restoring generic cosmetic
filtering on sites which were excluded through a `generichide`
exception.

Concretely, this is needed to ensure the test suite can properly
verify that generic cosmetic filtering is working when the
filtering mode is set to "complete":

||ublockorigin.github.io^$generichide,important
2025-03-18 17:15:35 -04:00
Raymond Hill
d36ea89a02
Improve prevent-set[Timeout|Interval] scriptlets 2025-03-17 08:02:30 -04:00
Raymond Hill
4aebdbb0a9
Add quit button to element zapper mode
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/1968

Given the availability of this new quit button, the element zapper
will now default to stick around after zapping an element.
2025-03-16 05:50:53 -04:00
Raymond Hill
9e946ce0c3
Improve trusted-override-element-method scriptlet
As discussed with filter list maintainers:
https://github.com/uBlockOrigin/uBlock-discussions/discussions/933
2025-03-15 07:50:28 -04:00
Raymond Hill
db7210a24a
Import translation work from https://crowdin.com/project/ublock 2025-03-14 10:59:26 -04:00
Raymond Hill
34cea70924
Disable obsolete cache-control workaround for Firefox
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3576

This is the first step, a trivial code change which disable the
injection of `Cache-Control` header in Firefox.

In the next dev cycle, the second step will be to remove all
the code related to `Cache-Control` injection.
2025-03-14 10:47:14 -04:00
Raymond Hill
a009623d97
[mv3] Improve generic cosmetic filtering
Specifically, properly exclude generic cosmetic filters according to
specific cosmetic exceptions.

Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/181
2025-03-13 13:15:27 -04:00
Raymond Hill
7db84ef13d
Do not blindly force https in urlskip
Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/issues/3206#issuecomment-2708584507
2025-03-11 09:15:40 -04:00
Raymond Hill
bf9549115c
Import translation work from https://crowdin.com/project/ublock 2025-03-08 17:22:46 -05:00
Raymond Hill
31d82c494b
Fix typo in variable name 2025-03-06 14:15:02 -05:00
Raymond Hill
03fb6ee059
Import translation work from https://crowdin.com/project/ublock 2025-03-06 09:59:35 -05:00
Raymond Hill
fc231998b9
Improve overlay-buster scriptlet
Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/discussions/3470
2025-03-06 09:50:37 -05:00
Raymond Hill
a483f7955f
Add ability to inject scriptlets according to origin of ancestor contexts
New syntax for scriptlet-based filtering: it is now possible to
inject a scriptlet in a context according to whether an ancestor
origin matches a specific hostname. Example:

  example.com>>##+js(set, iAmEmbeddedInExampleDotCom, true)

The new `>>` specifier means that the scriptlet will not be injected
in `example.com`, but will be injected in all direct and indirect
embedded contexts in pages loaded from `example.com`

The new ancestor domain specifier also works for entity directives:

  example.*##+js(set, iAmEmbeddedInExampleDotEffectiveTLD, true)

This is an experimental feature, to be further evaluated and
discussed by filter list maintainers. This is not a complete
implementation, by choice. Do not open issues regarding this
new syntax, the current shortcomings are known.

The new syntax is being discussed internally at:
https://github.com/uBlockOrigin/uBlock-discussions/discussions/244
2025-03-06 08:57:27 -05:00
Raymond Hill
e636c32f2a
Fix range parser in prevent-setTimeout scriptlet
Related feedback:
https://github.com/uBlockOrigin/uBlock-discussions/discussions/925#discussioncomment-11940830
2025-03-04 07:12:56 -05:00
Raymond Hill
987ddad1fd
[mv3] Adjust as per feedback
Related discussion:
https://github.com/uBlockOrigin/uBOL-home/issues/156#issuecomment-2696060398
2025-03-04 07:02:41 -05:00
Raymond Hill
1dbd280ba3
[mv3] Convert domain= to to= for csp=/permissions= options
Related discussion:
https://github.com/uBlockOrigin/uBOL-home/issues/156#issuecomment-2694741399
2025-03-03 11:45:54 -05:00
Raymond Hill
34df044808
Add filter option synonyms for strict1p/strict3p
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3554
2025-03-01 16:26:46 -05:00
Raymond Hill
36404543e4
Increase URL buffer size to 8192 (from 2048)
Related:
https://github.com/easylist/easylist/commit/777d7ba9
2025-03-01 14:48:51 -05:00
Raymond Hill
cff88d547f
Import translation work from https://crowdin.com/project/ublock 2025-03-01 09:26:44 -05:00
Raymond Hill
ea8853cda3
Use onmessage/postMessage instead of BroadcastChannel in diff updater 2025-02-28 17:18:48 -05:00
Raymond Hill
d41989e62a
Improve disable-newtab-links scriptlet
Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/discussions/3551
2025-02-25 13:02:44 -05:00
Raymond Hill
9c26a07b53
Improve prevent-addEventListener scriptlet
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3360
2025-02-24 12:47:54 -05:00
Raymond Hill
e56ca0f612
Import translation from https://crowdin.com/project/ublock 2025-02-23 12:20:17 -05:00
Raymond Hill
0013e04fd3
Import translation work from https://crowdin.com/project/ublock 2025-02-22 07:47:33 -05:00
Raymond Hill
ce724d5c47
Import translation work from https://crowdin.com/project/ublock 2025-02-20 15:19:57 -05:00