Commit graph

128 commits

Author SHA1 Message Date
Raymond Hill
df0d21d92e
[mv3] Avoid instantiating regexes by using simple needle first
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/223
2025-12-27 09:45:25 -05:00
Raymond Hill
377cf9d86b
[mv3] Add support for regex-based extended filters
Related issues:
- https://github.com/uBlockOrigin/uBOL-home/issues/223
- https://github.com/uBlockOrigin/uAssets/issues/31261
2025-12-25 12:34:21 -05:00
Raymond Hill
0fb845d1ac
[mv3] Load specific cosmetic filtering data on-demand only
The cosmetic filtering data embedded in the content scripts has been
extracted in corresponding JSON files. When a list is enabled, the
corresponding cosmetic filtering data from the JSON files, if any, is
persisted into the extension's local storage.

The cosmetic filtering-related content scripts will load the data
from these JSON files on-demand only and matching cosmetic filters
will be extracted, then the result is cached in the session storage,
ensuring there is no longer a need to perform lookup for the rest
of the browser session.

As a result this further reduces the time to First Contentful Paint.

Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/557
2025-12-09 15:32:02 -05:00
Raymond Hill
0aa0d81caf
[mv3] Re-work specific cosmetic filtering-related content scripts
To minimize delay to First Contentful Paint. The idea is to avoid
complex data structures such as Map in order to speed up first content
script execution. Use stringified arrays where practical and
instanciate those arrays from their stringified representation only
when there are actual cosmetic filters to apply.

Related commit:
https://github.com/gorhill/uBlock/commit/6039ef2b6d
2025-12-05 08:54:34 -05:00
Raymond Hill
6039ef2b6d
[mv3] Generate at most two scriptlet-related files per rulesets
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/557
2025-12-04 12:57:25 -05:00
Raymond Hill
d1987f88ee
[mv3] Shorten output in build script 2025-11-14 12:47:28 -05:00
Raymond Hill
be14670b76
[mv3] Decrease granularity of hashes of generic cosmetic selectors
This reduces the size of content scripts with no downside.
2025-10-04 13:32:16 -04:00
Raymond Hill
2943ef5112
[mv3] Don't use push() when large collections are possible
Otherwise this opens potential stack overflow issues.
2025-09-11 09:29:39 -04:00
Raymond Hill
4fbcabbc66
[mv3] Move redirect/removeParams/modifyHeaders rules to static rulesets
Since permissions are now managed by the browsers, the browser will take
care whether to enforce those "usafe" rules according to the permissions
in effect on a given site.
2025-09-02 12:29:41 -04:00
Raymond Hill
fad0af591f
[mv3] Add support for regexSubstitution from uritransform
Related commit:
aaf35d9d71
2025-08-16 15:36:52 -04:00
Raymond Hill
4f273c4284
[mv3] Temporarily comment out empty list as error 2025-07-28 10:00:25 -04:00
Raymond Hill
fed7f4a0b8
[mv3] Merge all :style() filters with procedural filters 2025-07-19 13:15:43 -04:00
Raymond Hill
e33bfc1f01
[mv3] Add support to exclude lists from specific platforms
Related discussion:
https://github.com/uBlockOrigin/uBOL-home/issues/358#issuecomment-2993687480
2025-06-22 12:07:06 -04:00
Raymond Hill
9f3282d74f
[mv3] Safari: expand rsach requestDomains entries into own rule
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/358
2025-06-10 15:18:47 -04:00
Raymond Hill
76d8b97869
[mv3] Collect/apply highly generic cosmetic exceptions across lists
Related issues:
- https://github.com/uBlockOrigin/uBOL-home/issues/365
- https://github.com/uBlockOrigin/uAssets/issues/28770
- https://github.com/uBlockOrigin/uAssets/issues/28129
2025-06-10 15:03:14 -04:00
Raymond Hill
408b538e75
[mv3] Add support to convert header= option to DNR rules
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/157

The `header=` option will be converted into DNR's `responseHeaders`
condition.

There will be an attempt to convert regex-based values into DNR-
compatible syntax. Not all regex-based patterns can be converted to
use DNR's patterns with `*` and `?` special characters.

The implementation of `header=` option in uBO has been revisited to
improve compatibility with DNR syntax to minimize burden for list
maintainers when creating `header=` filters compatible with both
uBO and uBOL.

The changes:
- Header names are now case-insensitive by default
- Occurrences of `*` in non-regex-based header values now mean
  "matches any number of characters"
- Occurrences of `?` in non-regex-based header values now mean
  "matches zero or one character"

At time of commit, and as per MDN, only Chromium-based browsers
currently support filtering on repsonse headers:
https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest/HeaderInfo

Also as per MDN, Chromium 121-127 silently ignore the `responseHeaders`
condition, potentially causing undue blocking of network requests.
Currently uBOL support Chromium 122 and later, meaning we need to mind
potential false positives in Chromium 122-127 for filters using
`header=` option.
2025-05-22 11:46:08 -04:00
Raymond Hill
7ee99e6875
[mv3] Add fallback fetch in case main one fails 2025-05-20 07:34:05 -04:00
Raymond Hill
a83be19987
[mv3] Remove equivalence between chromium and safari 2025-05-10 12:32:09 -04:00
Raymond Hill
1c98faf46c
[mv3] Safari works; use 3-component version for uBOL
uBOL doesn't pass validation when using 4-component versioning,
so falling back to 3-component versioning for all platforms to
avoid special case.
2025-05-08 16:53:07 -04:00
Raymond Hill
0e5dec7fbb
[mv3] Separate EasyList, EasyPrivacy, PGL lists from uBlock filters
Additionally, remember `badfilter` filters across conversion of
filter lists to DNR rulesets.
2025-04-24 09:58:31 -04:00
Raymond Hill
2bd09e6f84
[mv3] Code review of conversion to DNR ruleset
- Ensure no duplicates in domain collection fields
- Sort rules according to the number of entries in their
  domain collections
2025-04-20 12:14:29 -04:00
Raymond Hill
b5651417aa
[mv3] Merge Safari branch
Safari version of uBO Lite can now be built from master branch.

Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/327
2025-04-19 13:08:59 -04:00
Raymond Hill
8016e7733a
[mv3] Move ruleset details into external config file 2025-04-19 08:37:29 -04:00
Raymond Hill
63ea23f334
[mv3] Minor change to build script 2025-04-18 07:57:21 -04:00
Raymond Hill
e20e6addf0
[mv3] Mind excluded to= hostnames in strict-block rules 2025-04-16 08:18:26 -04:00
Raymond Hill
b5eea3ce3a
[mv3] Fix Github Actions 2025-04-13 15:45:39 -04:00
Raymond Hill
e11335f5ad
[mv3] Fix Github Actions 2025-04-13 15:37:07 -04:00
Raymond Hill
50f87c21ea
[mv3] Provide console feedback that work is ongoing when building 2025-04-13 09:04:13 -04:00
Raymond Hill
595f9fd469
[mv3] Loosen requirements to qualify for strict-blocking 2025-04-03 12:09:20 -04:00
Raymond Hill
d7ae3a185e
[mv3] Test filters are trusted 2025-03-25 12:58:26 -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
fba662421d
[mv3] Make it easier to add filters for testing purpose 2025-03-15 15:06:51 -04:00
Raymond Hill
b98a8d5c02
[mv3] Remove stray test filters 2025-03-14 12:29:01 -04:00
Raymond Hill
68962453ff
[mv3] Eliminate false positives in new generic cosmetic exception code
Related commit:
a009623d97
2025-03-13 19:02:20 -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
94db43c4ad
[mv3] Minor changes to account for Edge build 2025-03-08 11:31:31 -05:00
Raymond Hill
d006fd06e7
[mv3] Add support for ancestor context syntax in scriptlets
Related commit:
a483f7955f
2025-03-07 17:04:02 -05:00
Raymond Hill
536f0fba25
[mv3] Add test suite list to available rulesets
Microsoft Edge for Android requires a "link to the core function
test cases for your Edge Android extension" to verify that the
extension function properly.
2025-03-06 17:39:15 -05:00
Raymond Hill
6ca28a5b3f
[mv3] Improve output og log.txt 2025-02-22 07:38:12 -05:00
Raymond Hill
1d2378e74e
[mv3] Workaround for permissions dialog preventing proper mode change
This is a Chromium-specific issue.

Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/280
2025-02-21 08:23:27 -05:00
Raymond Hill
f8975e3a6a
Better integrate latest eslint version 2025-01-10 10:25:15 -05:00
Raymond Hill
217d001d71
[mv3] Minor changes 2024-12-30 13:40:18 -05:00
Raymond Hill
61922da24b
[mv3] Extend strict-blocking coverage; improve URL-skip behavior
This extends coverage of strict-blocking to pattern-based filters
with `doc` filter option.

When proceeding with a URL-skip URL present, no temporary bypass
will be created when the "Don't warn me again about this site" is
left unchecked. The idea is to avoid the intermediate redirects
if we navigate again on the same strict-blocked site, while a
temporary bypass would prevent this.

uBO's "Badware risks" list has been spinned off as its own list.
The idea is that should a site be strict-blocked from that list,
we would want to know the strict-block is due to the
"Badware risks" list.
2024-12-29 16:38:56 -05:00
Raymond Hill
27a72b8eef
[mv3] Hopefully this fixes Edge submission issue
Submission to Edge Addons store fails with:

----
The following checks failed:
Package acceptance validation error:
Manifest file reference 'urlhaus.full' does not exist in the zip archive.
(Note: File locations are case-sensitive)
Package acceptance validation error:
Manifest file reference 'openphish.domains' does not exist in the zip archive.
(Note: File locations are case-sensitive)
----

Guessing the use of period in ruleset file path is causing the
issue.
2024-12-23 09:57:57 -05:00
Raymond Hill
89e44131a0
[mv3] Enable OpenPhish ruleset by default
As discussed with filter list maintainers.
2024-12-21 08:57:12 -05:00
Raymond Hill
ac9e12e17c
[mv3] Add "Malware protection, security" section in "Filter lists" pane
Additionally, add "Openphish Domain Blocklist" as stock list.
2024-12-14 08:45:17 -05:00
Raymond Hill
0f373b7639
Use HOSTS version of "Malicious URL Blocklist"
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/256
2024-12-13 11:18:18 -05:00
Raymond Hill
439d608d03
Revert "Use HOSTS version of "Malicious URL Blocklist""
This reverts commit 54ebea31f7.
2024-12-13 11:15:36 -05:00
Raymond Hill
54ebea31f7
Use HOSTS version of "Malicious URL Blocklist"
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/256
2024-12-12 20:00:08 -05:00
Raymond Hill
b7bacc0fc1
Fix bad filter in urlhaus
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/256
2024-12-12 19:47:48 -05:00