Commit Graph

4774 Commits

Author SHA1 Message Date
Raymond Hill f645e8f0d2
Improve `googlesyndication_adsbygoogle.js` scriptlet
Related discussion:
https://github.com/uBlockOrigin/uBlock-discussions/discussions/321#discussioncomment-11000356
2024-10-30 09:12:58 -04:00
Raymond Hill c07db7553d
Fix `urlskip=` with `-blocked` directive for blocked requests
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3206#issuecomment-2441470631
2024-10-28 14:13:50 -04:00
Raymond Hill ac4506091e
Import translation work from https://crowdin.com/project/ublock 2024-10-28 12:04:34 -04:00
Raymond Hill 60a1dea0f6
Import translation work from https://crowdin.com/project/ublock 2024-10-27 14:49:14 -04:00
Raymond Hill 9b3e94b23f
Import translation work from https://crowdin.com/project/ 2024-10-27 14:46:25 -04:00
Raymond Hill 20b54185fa
Offer ability to skip redirects in strict-blocked page
Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/issues/3206#issuecomment-2439639215

If a strict-blocked page matches a `urlskip=` filter, the page
will show the user the destination URL as a result of applying the
`urlskip` filter should they choose to proceed with the
navigation.
2024-10-27 14:24:08 -04:00
Raymond Hill d04dc4c767
Add `-blocked` directive to `urlskip=` option
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
2024-10-26 12:56:52 -04:00
Raymond Hill 2621c908c3
Remove `64:ff9b:` as private network block
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3426
2024-10-22 19:49:29 -04:00
Raymond Hill b3408a46d1
Fix spurious error message re. bootstrap() not being present
Need `?.` before parenthesis for optional chaining to apply on
method call.

Related commit:
https://github.com/gorhill/uBlock/commit/5133991f7e
2024-10-19 12:09:48 -04:00
Raymond Hill d4f15ca635
[mv3] Fix regression in extended filtering with some lists
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/236

Regression from:
https://github.com/gorhill/uBlock/commit/58bfe4c846

Cosmetic- and scriptlet injection-based filters broke with filter
lists using AdGuard's `[$domain=/.../]` syntax.

Potentially affected filter lists:
- AdGuard Chinese
- AdGuard Turkish
2024-10-19 10:41:58 -04:00
Raymond Hill 0425bdfd35
Import translation work from https://crowdin.com/project/ublock 2024-10-17 12:44:02 -04:00
Raymond Hill 32f27c5131
Ensure `urlskip=` redirects only to `https:` 2024-10-16 08:25:56 -04:00
Raymond Hill ce9fc5dc14
Add support to `urlskip=` media resources
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3206#issuecomment-2406777654
2024-10-12 08:52:05 -04:00
Raymond Hill b8959dcca9
Comment 2024-10-11 09:04:23 -04:00
Raymond Hill 01eebffc1f
Add `-uricomponent` to `urlskip=` option
To unescape URI-encoded characters.

Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/issues/3206#issuecomment-2406479971
2024-10-11 08:56:50 -04:00
Raymond Hill e5d16a1883
Typo 2024-10-10 11:35:58 -04:00
Raymond Hill 9e3c978d55
Minor edit to comment 2024-10-10 11:31:57 -04:00
Raymond Hill c86ed5287b
Add regex extraction transformation step to `urlskip=` option
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.
2024-10-10 11:11:07 -04:00
Raymond Hill 58bfe4c846
Add support to parse Adguard's `[$domain=/.../]` regex-based modifier
The modifier will be converted to one that is compatible with uBO, i.e.:

    [$domain=/^trgoals\d+\.xyz$/]##+js(set-constant, isShow, true)

Will parsed as equivalent of:

    /^trgoals\d+\.xyz$/##+js(set-constant, isShow, true)

Related issue:
https://github.com/AdguardTeam/FiltersCompiler/issues/204

Reference:
https://adguard.com/kb/general/ad-filtering/create-own-filters/#non-basic-domain-modifier
2024-10-08 19:19:08 -04:00
Raymond Hill ec3852b745
Re-word: it's timing per request, not per call to SNFE.match()
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.
2024-10-07 15:06:12 -04:00
Raymond Hill c746633693
Validate result type of XPath expressions
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3403

To ensure XPath expressions not meant to return a nodeset are
discarded at compile time.
2024-10-06 14:27:55 -04:00
Raymond Hill 818cb2d801
Fix npm test suite
Related commits:
- https://github.com/gorhill/uBlock/commit/02cba63331
- https://github.com/gorhill/uBlock/commit/41693407b2
2024-10-06 11:15:08 -04:00
Raymond Hill 64b2086ba4
Add ability to lookup parameter name in `urlskip=`
Relate case:
https://github.com/uBlockOrigin/uBlock-issues/issues/3206#issuecomment-2395121619

Newly supported step: `&i`, meant to lookup a parameter's name at
position `i` (1-based). The parameter name will be used as the
URL (whereas `?` is meant to lookup a parameter's value).
2024-10-05 14:59:43 -04:00
Raymond Hill 02cba63331
Partially revert 4169340 2024-10-05 14:51:38 -04:00
Raymond Hill 6d2b3375f8
Mind that BroadcastChannel contructor can throw in Firefox
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.
2024-10-05 12:42:30 -04:00
Raymond Hill 41693407b2
Fix npm test suite
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().
2024-10-05 11:32:59 -04:00
Raymond Hill d24ffe6bb8
Import translation work from https://crowdin.com/project/ublock 2024-10-04 12:30:37 -04:00
Raymond Hill 5133991f7e
Fix spurious error in content script
No guarantee vAPI.bootstrap will still be present when callback
executes.
2024-10-04 08:57:10 -04:00
Ilya (Marshal) 9f4123a4e2
Fix AdGuard Knowledge Base URLs 2024-10-04 11:27:24 +02:00
Raymond Hill 73ce4e6bcf
Blocking large media elements also prevents autoplay, regardless of size
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3394

When the "No large media elements" per-site switch is toggled on,
it will also act to prevent autoplay of video/audio media, regardless
of their size. This also works for xhr-based media streaming.

If blocking by size is not desirable while blocking autoplay is
desired, one can toggle on "No large media elements" switch while
setting "Block media elements larger than ..." to a very high value.
2024-10-02 13:39:36 -04:00
Raymond Hill 6cac645830
Do not discard `!#else` block for unknown preprocessor tokens
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3393
2024-09-30 10:16:48 -04:00
Raymond Hill 3d6984aeaf
Import translation work from https://crowdin.com/project/ublock 2024-09-29 17:06:51 -04:00
Raymond Hill c6baa2fb51
Import translation work from https://crowdin.com/project/ublock 2024-09-29 11:15:04 -04:00
Raymond Hill e81e70937f
Add ability to decode base64 in `urlskip=`
Related case:
https://github.com/uBlockOrigin/uAssets/issues/25467

New step: `-base64`
Purpose: to decode base64-encoded output of previous step
2024-09-29 10:51:56 -04:00
Raymond Hill 99191d1363
Import translation work from https://crowdin.com/project/ublock 2024-09-28 14:12:13 -04:00
Raymond Hill aec0bd39e3
Fix images not properly downloading on click
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/1670#issuecomment-2372048056

The issue affected images supporting `srcset` attribute without
the presence of `src` attribute. This commit takes add fallback
onto `srcset` attribute when the `src` attribute is not present.
2024-09-26 13:27:06 -04:00
Raymond Hill 4c5a9353b0
Import translation work from https://crowdin.com/project/ublock 2024-09-22 11:50:20 -04:00
Raymond Hill bd6d9c3296
Fix benchmark quirk related to new `ipaddress` option 2024-09-22 11:16:57 -04:00
Raymond Hill e7c783cefa
Code review for new DNS cache code
Prevent discarding DNS cache entries looked up during a passive
read. Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/discussions/3376#discussioncomment-10711948

Add advanced setting `dnsCacheTTL` to control the TLL (in
seconds) of DNS cache entries. Default to 600 (10 minutes).
2024-09-22 10:02:45 -04:00
Raymond Hill 1c97ca10fc
Minor code review
Use class fields to declare/initialize instance and static
properties.
2024-09-21 12:41:57 -04:00
Raymond Hill 055973cc3f
Import translation work from https://crowdin.com/project/ublock 2024-09-20 09:16:32 -04:00
Raymond Hill 59487b189c
Add `+https` directive to `urlskip=` option
When present, the `+https` directive will force the protocol of the
resulting URL to be `https:`.

Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3206#issuecomment-2363392357
2024-09-20 08:15:31 -04:00
Raymond Hill 4f181b0bc5
Support matching against list of IP addresses
Related commit:
6acf97bf51
2024-09-20 07:20:55 -04:00
Raymond Hill 760b2ffce6
Add advanced setting `dnsResolveEnabled`
Default to `true`.

Set to `false` to wholly disable calls to `dns.resolve()` (Firefox-
only). Disabling calls to `dns.resolve()` will prevent cname-uncloaking
and will limit ability to enforce `ipaddress` filter option.
2024-09-19 08:43:54 -04:00
Raymond Hill b01a418073
Add filtering output expressions`replace`/`urlskip` to logger
Additioanlly, removed `uritransform` as it is currently barely used,
if at all.
2024-09-19 08:08:49 -04:00
Raymond Hill e98fdeb0a5
Mind `urlskip=` in built-in benchmark 2024-09-18 12:24:04 -04:00
Raymond Hill 0a6dc47a72
Fix contextual menu quirks
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3382
2024-09-18 11:33:31 -04:00
Raymond Hill 62d74d4f1d
Add trailing wildcard syntax to `ipaddress=` option
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3381
2024-09-18 09:56:46 -04:00
Raymond Hill 3238fe48db
Import translation work from https://crowdin.com/project/ublock 2024-09-17 17:48:45 -04:00
Raymond Hill ef1e134460
Import translation work from https://crowdin.com/project/ublock 2024-09-15 13:27:32 -04:00