Commit Graph

12673 Commits

Author SHA1 Message Date
Raymond Hill 79ea85dbc4
More fine tuning of cache storage-related code 2024-02-27 21:47:06 -05:00
Raymond Hill a9211cfa2f
Make Firefox dev build auto-update 2024-02-27 18:51:05 -05:00
Raymond Hill 96d45f12d2
New revision for dev build 2024-02-27 18:42:43 -05:00
Raymond Hill b0fc5d3d21
Fix race condition when saving cache registry
Related to new cache storage code.
2024-02-27 18:41:10 -05:00
Raymond Hill e8b7037ba8
Make Firefox dev build auto-update 2024-02-27 15:11:11 -05:00
Raymond Hill ac665ba7cc
New revision for dev build 2024-02-27 15:05:25 -05:00
Raymond Hill 7590c0711d
Fine-tune cache storage related-code
Related discussion:
https://github.com/uBlockOrigin/uBlock-discussions/discussions/876

Related commit:
086766a924
2024-02-27 15:04:05 -05:00
Raymond Hill 4d88b5121c
Fine tune publishing scripts 2024-02-27 07:09:02 -05:00
Raymond Hill 65ab026f25
Make Firefox dev build auto-update 2024-02-26 18:21:19 -05:00
Raymond Hill 30036ad36f
New revision for dev build 2024-02-26 18:02:38 -05:00
Raymond Hill 385bc21ef1
Update changelog 2024-02-26 17:57:03 -05:00
Raymond Hill 086766a924
Redesign cache storage
In uBO, the "cache storage" is used to save resources which can
be safely discarded, though at the cost of having to fetch or
recompute them again.

Extension storage (browser.storage.local) is now always used as
cache storage backend. This has always been the default for
Chromium-based browsers.

For Firefox-based browsers, IndexedDB was used as backend for
cache storage, with fallback to extension storage when using
Firefox in private mode by default.

Extension storage is reliable since it works in all contexts,
though it may not be the most performant one.

To speed-up loading of resources from extension storage, uBO will
now make use of Cache API storage, which will mirror content of
key assets saved to extension storage. Typically loading resources
from Cache API is faster than loading the same resources from
the extension storage.

Only resources which must be loaded in memory as fast as possible
will make use of the Cache API storage layered on top of the
extension storage.

Compiled filter lists and memory snapshot of filtering engines
(aka "selfies") will be mirrored to the Cache API storage, since
these must be loaded into memory as fast as possible, and reloading
filter lists from their compiled counterpart is a common
operation.

This new design makes it now seamless to work in permanent private
mode for Firefox-based browsers, since extension storage now
always contains cache-related assets.

Support for IndexedDB is removed for the time being, except to
support migration of cached assets the first time uBO runs with
the new cache storage design.

In order to easily support all choices of storage, a new serializer
has been introduced, which is capable of serializing/deserializing
structure-cloneable data to/from a JS string.

Because of this new serializer, JS data structures can be stored
directly from their native representation, and deserialized
directly to their native representation from uBO's point of view,
since the serialization occurs (if needed) only at the storage
interface level.

This new serializer simplifies many code paths where data
structures such as Set, Map, TypedArray, RegExp, etc. had to be
converted in a disparate manner to be able to persist them to
extension storage.

The new serializer supports workers and LZ4 compression. These
can be configured through advanced settings.

With this new layered design, it's possible to introduce more
storage layers if measured as beneficial (i.e. maybe
browser.storage.session)

References:
- https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/local
- https://developer.mozilla.org/en-US/docs/Web/API/Cache
- https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
2024-02-26 16:50:11 -05:00
Raymond Hill 2262a129ec
Don't match network filter-derived regexes against non-network URIs
Context: element picker

Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3142
2024-02-26 16:08:12 -05:00
Raymond Hill f7e00e4223
[mv3] Fix rule id-salvaging task 2024-02-25 20:49:25 -05:00
Raymond Hill fcc77e7c92
[mv3] Add ability to manually add filters to a ruleset 2024-02-25 20:39:21 -05:00
Raymond Hill c4d2dcd835
Add ability to clean dist/build/[assets-related folders] 2024-02-25 18:27:07 -05:00
Raymond Hill 439a059cca
Remove obsolete trusted directives
All supported browsers now have the concept of priviledged
pages, there is no need for these extra trusted-site directives.

Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3101
2024-02-19 11:06:39 -05:00
Raymond Hill e527a8f9af
Support logging details of calls to `json-prune-fetch-response`
Example:

    example.com##+js(json-prune-fetch-response)

This will output to the logger details of all fetch() with a
Response.json() call.

Related discussion:
https://github.com/uBlockOrigin/uAssets/discussions/22556
2024-02-19 10:59:12 -05:00
Raymond Hill fef26e234d
Make the "untrusted sources" warning always visible
It won't disappear when vertical space is restricted.
2024-02-18 08:00:34 -05:00
Raymond Hill 9666eeb9cf
Do not treat selectors as "common" when char 0x09-0x0D are in attr value 2024-02-17 20:25:41 -05:00
Raymond Hill 0096b74d46
Make Firefox dev build auto-update 2024-02-17 20:06:02 -05:00
Raymond Hill a7e8485b32
Update changelog 2024-02-17 20:01:42 -05:00
Raymond Hill e6e01d96a4
New revision for dev build 2024-02-17 19:59:53 -05:00
Raymond Hill be3e366019
Escape special whitespace characters in attribute values
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3127

Reference:
https://mathiasbynens.be/notes/css-escapes
2024-02-17 19:57:44 -05:00
Raymond Hill 33749d2d3f
Use requestIdleCallback() in `href-sanitizer` scriptlet
Instead of requestAnimationFrame().
2024-02-17 12:53:57 -05:00
Raymond Hill 4af57e3e60
Import translation work from https://crowdin.com/project/ublock 2024-02-17 09:34:41 -05:00
Raymond Hill 557d8075a2
New version for stable release 2024-02-17 09:28:38 -05:00
Raymond Hill d8fc4b6c68
Make Firefox dev build auto-update 2024-02-15 14:46:13 -05:00
Raymond Hill f6d68be858
New revision for release candidate 2024-02-15 14:40:25 -05:00
Raymond Hill 0f4078901a
Update changelog 2024-02-15 14:39:50 -05:00
Raymond Hill 2a5a444482
Mind that multiple `uritransform` may apply to a single request
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3125
2024-02-15 14:34:50 -05:00
Raymond Hill 9bff0c2f94
Fix incorrect built-in filtering expression in logger
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3126
2024-02-15 14:03:15 -05:00
Raymond Hill 4832821715
Minor code review 2024-02-15 10:05:10 -05:00
Raymond Hill 84481fcd98
Fix typo in log message 2024-02-15 09:47:15 -05:00
Raymond Hill 7e00046b8e
[mv3] Salvage rule ids for all rulesets 2024-02-15 08:02:46 -05:00
Raymond Hill 8d47eac6e6
[mv3] Indent rulesets with fewer rules 2024-02-14 15:48:59 -05:00
Raymond Hill 88d9064a30
Put back proper account id 2024-02-14 15:09:03 -05:00
Raymond Hill c6eefe3992
Make Firefox dev build auto-update 2024-02-14 15:06:10 -05:00
Raymond Hill 57c387af36
Update changelog 2024-02-14 14:57:56 -05:00
Raymond Hill a2ced90398
Update changelog 2024-02-14 14:54:13 -05:00
Raymond Hill bc0248bd07
Merge remote-tracking branch 'origin/master' 2024-02-14 14:51:43 -05:00
Raymond Hill 41511726dc
Further improve detection of forbidden `report-xxx` usage in filters
As per feedback from https://github.com/distinctmondaylila

Related commit:
https://github.com/gorhill/uBlock/commit/db5656f607
2024-02-14 14:48:31 -05:00
Raymond Hill e8194aecf0
Further improve detection of forbidden `report-xxx` usage in filters
As per feedback from https://github.com/distinctmondaylila
2024-02-14 14:43:29 -05:00
Raymond Hill 1ef2ea0e93
Update changelog 2024-02-14 14:34:23 -05:00
Raymond Hill b39dac34b1
New revision for release candidate 2024-02-14 14:33:25 -05:00
Raymond Hill 21ec5a277c
Fix improper invalidation of valid `uritransform` exception filters
Related feedback:
https://github.com/uBlockOrigin/uBlock-discussions/discussions/831#discussioncomment-8461847
2024-02-14 14:30:05 -05:00
Raymond Hill f2d7413a42
[mv3] Reuse rule ids across release where possible
This is to reduce the diff size of rulesets in new
releases. Beside smaller diff size, this also makes it
easier to investigate rule changes across releases.
2024-02-14 14:27:36 -05:00
Raymond Hill d6b88d5d6e
Make Firefox dev build auto-update 2024-02-14 11:50:43 -05:00
Raymond Hill 65b71f2e19
New revision for release candidate 2024-02-14 11:43:39 -05:00
Raymond Hill ebb110fb3e
Fix logging code in `trusted-replace-argument` scriptlet
Related feedback:
https://github.com/uBlockOrigin/uBlock-discussions/discussions/859#discussioncomment-8368839
2024-02-14 11:41:58 -05:00