1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-22 02:12:44 +01:00
Commit Graph

4786 Commits

Author SHA1 Message Date
Raymond Hill
f9ce06977d
[mv3] Fix removeparam potentially causing invalid DNR rules 2024-11-18 14:05:19 -05:00
Raymond Hill
c95b08d760
Import translation work from https://crowdin.com/project/ublock 2024-11-18 10:24:08 -05:00
Raymond Hill
ae4754415c
[mv3] Re-work dashboard: move list of rulesets in its own pane
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
2024-11-17 17:27:27 -05:00
Raymond Hill
947602d4fe
[mv3] Slightly mitigate DNR flaw re. removeparam filters
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/140

This will allow more specific `removeparam` filters to override
generic ones. This doesn't fix the related issue but should help
more specific `removeparam` filters to be applied.

Related webextensions issue:
https://github.com/w3c/webextensions/issues/468
2024-11-15 10:01:29 -05:00
Raymond Hill
2e66d7bd55
Import translation work from https://crowdin.com/project/ublock 2024-11-14 10:40:55 -05:00
Raymond Hill
4c299bfca9
Better handle unexpected conditions when deserializing
For example, when deserialzing from corrupted storage.
2024-11-14 10:32:15 -05:00
Raymond Hill
ff5fc61753
Add support for EasyList { remove: true } cosmetic filter syntax
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3451
2024-11-14 10:24:50 -05:00
Raymond Hill
335d947c10
Fix potential infinite async loop
Related issue:
https://bugzilla.mozilla.org/show_bug.cgi?id=1929326

As identified by @Rob--W:
https://bugzilla.mozilla.org/show_bug.cgi?id=1929326#c9

Truncated or otherwise corrupted asset content in extension storage
could lead to infinite async loop causing high CPU usage in uBO and
its workers.

Likely related to the issue of the asset content returned as
`undefined`:
652f178787/src/js/cachestorage.js (L98)
2024-11-11 15:17:19 -05:00
Raymond Hill
e5a088738d
Keep moving related scriptlets into separate files 2024-11-08 11:22:31 -05:00
Raymond Hill
54ed02e302
Import translation work from https://crowdin.com/project/ublock 2024-11-05 09:25:01 -05:00
Raymond Hill
d401527e83
Import translation work from https://crowdin.com/project/ublock 2024-10-31 11:28:06 -04:00
Raymond Hill
34771d02d1
Fine tune visuals in document-blocked page
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3206#issuecomment-2449415643
2024-10-31 11:18:42 -04:00
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