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

1619 Commits

Author SHA1 Message Date
Raymond Hill
2a40e67577
[mv3] Various fixes and code review
Fixed trusted sites not being excluded from declarative
scripting.

Assign "uBOL_"-prefixed name to anonymous scripting functions
so that they can be easily found in performance profiler results
in dev tools.

Imrpove spread of chunks of filters across declarative scripting
files.
2022-09-30 14:55:36 -04:00
Raymond Hill
1a9a19a91f
[mv3] Open options page at first install
To be sure first time users are properly informed about the
possibility to enable broad permissions for better filtering.
2022-09-30 09:18:52 -04:00
Raymond Hill
28aee736a5
[mv3] Add support for removeparam= filter option
Consequently, AdGuard URL Tracking Protection (AUTP) has been
added to the set of available filter lists.

However, removeparam= equivalent DNR rules can only be enforced
when granting uBOL broad permissions. If broad permissions are
not granted, removeparam= equivalent DNR rules are ignored.

Exception removeparam= filters are not supported, and these are
present in AUTP and meant to unbreak some websites which are
known to break as a result of removing query parameters.

This is issue might be mitigated in the future by making the
conversion from filters to DNR rules more complicated but this
can never replace the accuracy of uBO's filtering engine being
able to fully enforce arbitrary exception removeparam= filters.

Also, it is not possible to translate regex-based removeparam=
values to DNR rules, so these are dropped at conversion time.

As with other filters to DNR rules conversion, the converter
coallesce many distinct removeparam= filters into fewer DNR
rules.
2022-09-29 19:51:33 -04:00
Raymond Hill
b5e2ca8826
Import translation work from https://crowdin.com/project/ublock 2022-09-28 10:40:55 -04:00
Raymond Hill
a20273c582
[mv3] Don't wait on fullfilled promise when registring scriptlets
This can interfere with user interface responsiveness when
registring all scriptlets in broad-permissions mode.
2022-09-28 10:20:57 -04:00
Raymond Hill
a47484bc33
[mv3] Fix reflecting proper state when denied 2022-09-27 20:19:59 -04:00
Raymond Hill
61e9a6e9c9
Import translation work from https://crowdin.com/project/ublock 2022-09-27 20:00:06 -04:00
Raymond Hill
f652cc9855
[mv3] Add ability to grant/revoke permissions on all sites 2022-09-27 19:51:38 -04:00
Raymond Hill
d4b7169421
Fix bad rules making it into the final ruleset files 2022-09-27 10:57:43 -04:00
Raymond Hill
51c2e22c7a
[mv3] Fix procedural operator matches-media()
The failure was caused by the fact that there is no
window.matchMedia() API available in Nodejs. The validation
is now done using cssTree.
2022-09-27 07:46:24 -04:00
Raymond Hill
e29e760b43
Use higher resolution favicons
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2287
2022-09-26 10:18:24 -04:00
Raymond Hill
f19fd391de
[mv3] Fix bad call in nostif 2022-09-24 18:43:15 -04:00
Raymond Hill
ffc46534ac
[mv3] Skip some regional lists for the time being 2022-09-24 18:36:28 -04:00
Raymond Hill
4755a6094e
[mv3] Add support for more scriplets: abort-on-property-write, no-settimeout-if 2022-09-24 18:22:44 -04:00
Raymond Hill
07178e6416
Fix typo 2022-09-24 14:10:29 -04:00
Raymond Hill
a7b5f5127f
[mv3] Do not include lists with empty ruleset 2022-09-24 12:23:01 -04:00
Raymond Hill
f638da41d6
Import translation work from https://crowdin.com/project/ublock 2022-09-24 12:14:02 -04:00
Raymond Hill
966a157d19
[mv3] Add support for procedural cosmetic filtering 2022-09-24 11:33:04 -04:00
Raymond Hill
a71b71e4c8
New cosmetic filter parser using CSSTree library
The new parser no longer uses the browser DOM to validate
that a cosmetic filter is valid or not, this is now done
through a JS library, CSSTree.

This means filter list authors will have to be more careful
to ensure that a cosmetic filter is really valid, as there is
no more guarantee that a cosmetic filter which works for a
given browser/version will still work properly on another
browser, or different version of the same browser.

This change has become necessary because of many reasons,
one of them being the flakiness of the previous parser as
exposed by many issues lately:

- https://github.com/uBlockOrigin/uBlock-issues/issues/2262
- https://github.com/uBlockOrigin/uBlock-issues/issues/2228

The new parser introduces breaking changes, there was no way
to do otherwise. Some current procedural cosmetic filters will
be shown as invalid with this change. This occurs because the
CSSTree library gets confused with some syntax which was
previously allowed by the previous parser because it was more
permissive.

Mainly the issue is with the arguments passed to some procedural
cosmetic filters, and these issues can be solved as follow:

Use quotes around the argument. You can use either single or
double-quotes, whichever is most convenient. If your argument
contains a single quote, use double-quotes, and vice versa.

Additionally, try to escape a quote inside an argument using
backslash. THis may work, but if not, use quotes around the
argument.

When the parser encounter quotes around an argument, it will
discard them before trying to process the argument, same with
escaped quotes inside the argument. Examples:

Breakage:

    ...##^script:has-text(toscr')

Fix:

    ...##^script:has-text(toscr\')

Breakage:

    ...##:xpath(//*[contains(text(),"VPN")]):upward(2)

Fix:

    ...##:xpath('//*[contains(text(),"VPN")]'):upward(2)

There are not many filters which break in the default set of
filter lists, so this should be workable for default lists.

Unfortunately those fixes will break the filter for previous
versions of uBO since these to not deal with quoted argument.
In such case, it may be necessary to keep the previous filter,
which will be discarded as broken on newer version of uBO.

THis was a necessary change as the old parser was becoming
more and more flaky after being constantly patched for new
cases arising, The new parser should be far more robust and
stay robist through expanding procedural cosmetic filter
syntax.

Additionally, in the MV3 version, filters are pre-compiled
using a Nodejs script, i.e. outside the browser, so validating
cosmetic filters using a live DOM no longer made sense.

This new parser will have to be tested throughly before stable
release.
2022-09-23 16:03:13 -04:00
Raymond Hill
b2b7ffee87
[mv3] Add English description
This will be used as reference "detailed description" and
for Chrome Web Store et al. description.
2022-09-20 09:01:10 -04:00
Raymond Hill
cfeac10c95
[mv3] Add support for abort-on-property-read scriptlet 2022-09-20 08:49:52 -04:00
Raymond Hill
70a0de9d00
[mv3] Mind trusted-site directives when registering content scripts 2022-09-20 08:24:01 -04:00
Raymond Hill
f374c05753
[mv3] Stick to int32 instead of 8-char hex strings for file hashes 2022-09-19 20:21:10 -04:00
Raymond Hill
7116bf9a46
GitHub Actions stuff 2022-09-19 11:53:04 -04:00
Raymond Hill
adb5d503d9
[mv3] Add GitHub action to build mv3 separately form uBO 2022-09-19 11:08:34 -04:00
Raymond Hill
4bd02c0fb6
[mv3] Inject specific cosmetic filters through scriptlet injection
This solves the following remaining issues regarding specific cosmetic
filtering:
- High rate of false positives in last build
- High number of generated content css files in the package
2022-09-19 08:55:45 -04:00
Raymond Hill
89566bc397
[mv3] Further reduce the number of distinct generated scriptlets 2022-09-18 17:07:02 -04:00
Raymond Hill
154a71c658
Import translation work from https://crowdin.com/project/ublock 2022-09-18 09:36:13 -04:00
Raymond Hill
5ddd3aaac6
[mv3] More work toward improving declarative css/js injection 2022-09-18 09:31:44 -04:00
Raymond Hill
9058c3524e
[mv3] Fix improper usage of scripting.unregisterContentScripts()
THis was causing all registered css/scripts to be removed when revoking
permission for a single site.
2022-09-17 11:22:25 -04:00
Raymond Hill
10406f5f74
Import translation work from https://crowdin.com/project/ublock 2022-09-17 08:35:54 -04:00
Raymond Hill
e1b54514cc
[mv3] Add badge reflecting number of injectable content on current site
Additonally, general code review.
2022-09-17 08:26:41 -04:00
Raymond Hill
22d03906fb
[mv3] For the time being assemble defautl lists manually 2022-09-16 16:36:09 -04:00
Raymond Hill
46c461c568
Import translation work from https://crowdin.com/project/ublock 2022-09-16 16:06:32 -04:00
Raymond Hill
232c44eeb2
[mv3] Add scriptlet support; improve reliability of cosmetic filtering
First iteration of adding scriptlet support. As with cosmetic
filtering, scriptlet niijection occurs only on sites for which
uBO Lite was granted extended permissions.

At the moment, only three scriptlets are supported:
- abort-current-script
- json-prune
- set-constant

More will be added in the future.
2022-09-16 15:56:35 -04:00
Raymond Hill
34aab95107
[mv3] Add support for specific cosmetic filtering
Specific plain CSS cosmetic filters are now supported.

Cosmetic filtering will occur only after the user explicitly
grant uBO extended permissions for a given site, so that it
can inject CSS on the site.

A new button in the popup panel allows a user to grant/revoke
extended permissions to/from uBO Lite for the current site.

More capabilities will be carefully added for when extended
permissions are granted on a site, so specific cosmetic
filtering through plain CSS is the first implemented capability.

Generic and procedural cosmetic filtering is not implemented.

The current implementation for plain CSS cosmetic filters is
through declarative content injection, which does not require
the service worker to be alive, the browser takes care to
inject the cosmetic filters.

However declarative CSS injection does not support user
styles, so the injected cosmetic filters are "weak". I consider
this is a browser issue, since user styles are supported by
Chromium, there is just no way in the API to specify user
styles for the injected content.

Also:
- Fixed dark theme issues
- Added Steven Black's hosts file

Keep in mind all this is very experimental and implementation
details in this release may (will) greatly change in the future.
2022-09-15 13:14:08 -04:00
Raymond Hill
b343cdc374
Import translation work from https://crowdin.com/project/ublock 2022-09-15 12:53:56 -04:00
Raymond Hill
43a20f08a8
Import translation work from https://crowdin.com/project/ublock 2022-09-15 12:19:31 -04:00
Raymond Hill
be4537ef44
Use translated strings in manifest 2022-09-14 09:32:59 -04:00
Raymond Hill
76835ebcac
Reword description 2022-09-14 09:31:58 -04:00
Raymond Hill
6098f96a5d
Import translation work from https://crowdin.com/project/ublock 2022-09-13 18:00:25 -04:00
Raymond Hill
5de156a0ed
Add missing translatable strings 2022-09-13 17:58:48 -04:00
Raymond Hill
3435e9886e
Import translation work from https://crowdin.com/project/ublock 2022-09-13 17:58:12 -04:00
Raymond Hill
e31637af78
[mv3] Add ability to enable/disable filter lists 2022-09-13 17:44:24 -04:00
Raymond Hill
93e5133783
Rename to less controversial name 2022-09-11 17:41:24 -04:00
Raymond Hill
c583a2e4b0
Fire tune build steps for mv3 version 2022-09-10 14:20:07 -04:00
Raymond Hill
1258414f37
Report ruleset stats in popup panel 2022-09-08 10:04:08 -04:00
Raymond Hill
41d66a78ba
Report per-ruleset stats for filters-to-rules conversion 2022-09-07 13:45:55 -04:00
Raymond Hill
224410a6f5
Add per-site on/off switch to mv3 experimental version 2022-09-07 10:15:36 -04:00
Raymond Hill
e420b75b91
Nodejs 16 does not support fetch() 2022-09-06 15:05:01 -04:00