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

1593 Commits

Author SHA1 Message Date
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
Raymond Hill
a559f5f271
Add experimental mv3 version
This create a separate Chromium extension, named
"uBO Minus (MV3)".

This experimental mv3 version supports only the blocking of
network requests through the declarativeNetRequest API, so as
to abide by the stated MV3 philosophy of not requiring broad
"read/modify data" permission. Accordingly, the extension
should not trigger the warning at installation time:

    Read and change all your data on all websites

The consequences of being permission-less are the following:

- No cosmetic filtering (##)
- No scriptlet injection (##+js)
- No redirect= filters
- No csp= filters
- No removeparam= filters

At this point there is no popup panel or options pages.

The default filterset correspond to the default filterset of
uBO proper:

Listset for 'default':
  https://ublockorigin.github.io/uAssets/filters/badware.txt
  https://ublockorigin.github.io/uAssets/filters/filters.txt
  https://ublockorigin.github.io/uAssets/filters/filters-2020.txt
  https://ublockorigin.github.io/uAssets/filters/filters-2021.txt
  https://ublockorigin.github.io/uAssets/filters/filters-2022.txt
  https://ublockorigin.github.io/uAssets/filters/privacy.txt
  https://ublockorigin.github.io/uAssets/filters/quick-fixes.txt
  https://ublockorigin.github.io/uAssets/filters/resource-abuse.txt
  https://ublockorigin.github.io/uAssets/filters/unbreak.txt
  https://easylist.to/easylist/easylist.txt
  https://easylist.to/easylist/easyprivacy.txt
  https://malware-filter.gitlab.io/malware-filter/urlhaus-filter-online.txt
  https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext

The result of the conversion of the filters in all these
filter lists is as follow:

Ruleset size for 'default': 22245
  Good: 21408
  Maybe good (regexes): 127
  redirect-rule= (discarded): 458
  csp= (discarded): 85
  removeparams= (discarded): 22
  Unsupported: 145

The fact that the number of DNR rules are far lower than the
number of network filters reported in uBO comes from the fact
that lists-to-rulesets converter does its best to coallesce
filters into minimal set of rules. Notably, the DNR's
requestDomains condition property allows to create a single
DNR rule out of all pure hostname-based filters.

Regex-based rules are dynamically added at launch time since
they must be validated as valid DNR regexes through
isRegexSupported() API call.

At this point I consider being permission-less the limiting
factor: if broad "read/modify data" permission is to be used,
than there is not much point for an MV3 version over MV2, just
use the MV2 version if you want to benefit all the features
which can't be implemented without broad "read/modify data"
permission.

To locally build the MV3 extension:

    make mv3

Then load the resulting extension directory in the browser
using the "Load unpacked" button.

From now on there will be a uBlock0.mv3.zip package available
in each release.
2022-09-06 13:47:52 -04:00
Raymond Hill
0c9ab84846
Fix redundant calls to extract image data
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2243#issuecomment-1236194011
2022-09-04 10:40:26 -04:00
Raymond Hill
2ff0abfb89
Fix popup panel for Thunderbird
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2144
2022-06-18 11:18:27 -04:00
Raymond Hill
127ea05a9e
Replace responsive with intab for better remdering og panel in a tab
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2116#issuecomment-1143634719
2022-06-04 11:12:45 -04:00
Raymond Hill
1c090f0fae
Use string template 2022-06-03 12:27:51 -04:00
u-RraaLL
614b8328e9
Update popup url
Fix broken functionality caused by the removal of the classic popup.
2022-05-21 09:42:08 +02:00
Raymond Hill
78a15b648f
Do not block root document at launch in Chromium-based browsers
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2063
2022-03-30 12:15:44 -04:00
Raymond Hill
c71c42650e
New npm package version 2022-03-14 12:09:00 -04:00
Raymond Hill
ad1800fbca
Add command to toggle cosmetic filtering
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2000
2022-02-22 08:44:09 -05:00
Raymond Hill
26048a11bc
Merge branch 'letsblockit-subscriber' of https://github.com/xvello/uBlock 2022-02-19 08:57:47 -05:00
Raymond Hill
60072e7996
Minor code review
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1992
2022-02-18 06:52:34 -05:00
Raymond Hill
e1e2ba3d5d
Use unspoofable Messenger.origin to determine privilege level of ports
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1992
2022-02-17 18:05:01 -05:00
Raymond Hill
3154ed1bac
Remove test for whether Chromium version is less than 66
The test is no longer needed given that the minimum supported
version is Chromium 66.
2022-02-17 09:07:56 -05:00
Xavier Vello
c8d1834018 Add letsblock.it as valid location for subscription links 2022-02-16 16:28:13 +01:00
Raymond Hill
2933016d4b
Rework behavior of "Suspend network activity until ..."
The setting will default to the natural capability of the browser:

- Checked for Firefox
- Unchecked for Chromium-based browsers

For Chromium-based browser, if checked, network requests will be
redirected to an empty resources instead of blocking the
connection.

Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1973
- https://www.reddit.com/r/uBlockOrigin/comments/squo8n/latest_update_blocks_network_connections_at/
2022-02-13 09:24:57 -05:00
Raymond Hill
a2d83afe66
Further narrow when unconditionally calling webRTCIPHandlingPolicy.clear()
The enabled cached state probably exists in the browser only
when the setting was originally enabled -- so we need to clear
it only in such case.
2022-02-06 09:00:25 -05:00
Raymond Hill
00b257caa7
Unconditionally call webRTCIPHandlingPolicy.clear() at launch
On Chromium-based browsers only.

Related issue/feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1928
- https://www.reddit.com/r/uBlockOrigin/comments/sl7p74/
2022-02-05 12:04:08 -05:00
Raymond Hill
b4911e2d7c
Raise minimum versions of browsers
For the following reasons:

- Support for CSS `gap`, so as to remove the need to
  fall back onto classic popup panel, and thus making
  it possible to fully remove long-ago deprecated
  classic panel (announced in 1.27.0)[1]:
  https://developer.mozilla.org/en-US/docs/Web/CSS/gap

- Support for dynamic import:
  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import

Firefox's minimum version is raised to 68 because it's
the oldest ESR version supporting the features above.
From now on, minimum version of Firefox will always be
an ESR one.

---

[1] https://github.com/gorhill/uBlock/releases/tag/1.27.0
2022-01-28 12:02:56 -05:00
Raymond Hill
250cf96aae
Fix regression causing regex-based filters to be case sensitive
Related feedback:
- https://github.com/AdguardTeam/AdguardFilters/issues/88067#issuecomment-1019518277

Regression commit:
- 725e6931f5
2022-01-23 12:32:11 -05:00
Raymond Hill
0bc0af9d8d
Add test to detect case of improper deserialization
Related commit:
- 8f461072f5
2022-01-12 09:03:38 -05:00
Raymond Hill
eddb9ec160
Raised guessed Firefox version to 91 (latest ESR) 2022-01-09 12:41:29 -05:00
Raymond Hill
d38c19cabf
Improve test for presence of browser as extensions API
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1914

The issue affected only Chromium-based browsers.
2022-01-01 11:07:17 -05:00
Raymond Hill
925c8d5d0c
Add setting to control suspension on network activity at launch
Related discussion:
- a0a9497b4a (commitcomment-62560291)

The new setting, when disabled (enabled by default), allows a user
to prevent uBO from waiting for all filter lists to be loaded
before allowing network activity at launch. The setting is enabled
by default, meaning uBO waits for all filter lists to be loaded in
memory before unsuspending network activity. Some users may find
this behavior undesirable, hence the new setting.

This gives the option to potentially speed up page load at launch,
at the cost of potentially not properly filtering network requests
as per filter lists/rules.

For platforms not supporting the suspension of network activity,
the setting will merely prevent whatever mechanism exists on the
platform to mitigate improper filtering of network requests at
launch. For example, in Chromium-based browsers, unchecking the
new setting will prevent the browser from re-loading tabs for
which there was network activity while in "suspended" state at
launch.
2021-12-30 09:24:38 -05:00
Raymond Hill
eab2e03f2b
New revision for dev build 2021-12-27 19:12:29 -05:00
Raymond Hill
0992a5b821
Add test for https://github.com/gorhill/uBlock/commit/d66cd1116c0e 2021-12-25 09:10:48 -05:00
Raymond Hill
e2be049774
New revision for release candidate
Aiming for a pre-holiday release.
2021-12-18 13:47:38 -05:00