1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-16 15:33:38 +01:00
Commit Graph

1967 Commits

Author SHA1 Message Date
Raymond Hill
76e035989f
Minor code review 2024-09-20 11:40:03 -04:00
Raymond Hill
055973cc3f
Import translation work from https://crowdin.com/project/ublock 2024-09-20 09:16:32 -04:00
Raymond Hill
4f181b0bc5
Support matching against list of IP addresses
Related commit:
6acf97bf51
2024-09-20 07:20:55 -04:00
Raymond Hill
760b2ffce6
Add advanced setting dnsResolveEnabled
Default to `true`.

Set to `false` to wholly disable calls to `dns.resolve()` (Firefox-
only). Disabling calls to `dns.resolve()` will prevent cname-uncloaking
and will limit ability to enforce `ipaddress` filter option.
2024-09-19 08:43:54 -04:00
Raymond Hill
3238fe48db
Import translation work from https://crowdin.com/project/ublock 2024-09-17 17:48:45 -04:00
Raymond Hill
6a042f152b
Ignore browser-provided 0.0.0.0 ip address when DNS is proxied
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3379
2024-09-17 10:26:40 -04:00
Raymond Hill
b62aabda85
Import translation work from https://crowdin.com/project/ublock 2024-09-15 13:25:58 -04:00
Raymond Hill
93042eced4
Use dummy dns API when it's not present 2024-09-13 11:20:37 -04:00
Raymond Hill
73ee3ffe92
Code review of DNS-related code
Related commit:
6acf97bf51
2024-09-13 10:00:41 -04:00
Raymond Hill
8fadfb2c5e
Import translation work from https://crowdin.com/project/ublock 2024-09-12 15:40:24 -04:00
Raymond Hill
6acf97bf51
Rewrite cname uncloaking code to account for new ipaddress= option
This commit makes the DNS resolution code better suited for both
filtering on cname and ip address. The change allows early availability
of ip address so that `ipaddress=` option can be matched at
onBeforeRequest time.

As a result, it is now possible to block root document using
`ipaddress=` option -- so long as an ip address can be extracted
before first onBeforeRequest() call.

Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/2792

Caveat
------

the ip address used is the first one among the list of ip
addresses returned by dns.resolve() method. There is no way for uBO
to know which exact ip address will be used by the browser when
sending the request, so this is at most a best guess. The exact IP
address used by the browser is available at onHeadersReceived time,
and uBO will also filter according to this value, but by then the
network request has already been sent to the remote server.

Possibly a future improvement would make available the whole list
of ip addresses to the filtering engine, but even then it's impossible
to know with certainty which ip address will ultimately be used by the
browser -- it is entirely possible that the ip address used by the
browser might not be in the list received through dns.resolve().
2024-09-12 11:19:57 -04:00
Raymond Hill
099b9852cd
Code review for ipaddress= filter option
If an IP address can be extracted from the hostname portion of
a URL, the IP address matching will be performed at onBeforeRequest()
time.

Regardless, IP address matching will subsequently always be performed
at onHeadersReceived() time as the request details at that point
contain a reliable IP address value on supported platforms (Firefox-
only as of now).

The `cap_ipaddress` now evaluates to `true` in Chromium-based
browsers. Even though these browsers are unable to provide reliable
IP address value at onHeadersReceived() time, they can still
perform IP address matching for IP address extracted from hostname
portion of a URL.
2024-09-11 09:56:44 -04:00
Raymond Hill
d5f14ffa32
Avoid using dns.resolve() for proxied DNS resolution
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/1743
2024-09-10 14:58:40 -04:00
Raymond Hill
52dee35325
Properly reflect whether ipaddress= is supported 2024-09-09 10:54:47 -04:00
Raymond Hill
1b464f75cc
Fix spurious browser error at the console 2024-09-07 16:47:43 -04:00
Raymond Hill
bec5d53ce0
[mv3] Attempt at mitigation for when "internal error" occurs
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/199
2024-09-06 09:31:17 -04:00
Raymond Hill
0a048eb64e
Address eslint warnings 2024-08-22 12:36:31 -04:00
Raymond Hill
3360d3e3e1
[mv3] Remove unused file 2024-08-21 11:52:39 -04:00
Raymond Hill
520f81fcca
[mv3] Fix injection of scriptlets into embedded contexts 2024-08-20 08:18:03 -04:00
Raymond Hill
34047daa06
Import translation work from https://crowdin.com/project/ublock 2024-08-19 12:02:00 -04:00
Raymond Hill
e73eb23c90
[mv3] Don't filter out tabless requests in "logger" 2024-08-17 10:42:17 -04:00
Raymond Hill
1822d1503f
Import translation work from https://crowdin.com/project/ublock 2024-08-12 10:54:11 -04:00
Raymond Hill
665648ba97
[mv3] Re-word some text for accuracy 2024-08-07 10:03:03 -04:00
Raymond Hill
277977aa8a
[mv3] Remove useless arguments 2024-08-06 15:00:59 -04:00
Raymond Hill
ae6b53479d
[mv3] Minor change to debug output 2024-08-06 14:55:30 -04:00
Raymond Hill
fb037e97d0
[mv3] Improve remove-attr.js scriptlet
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/166
2024-08-06 14:47:03 -04:00
Raymond Hill
417dab538c
[mv3] Fix generating allowAllRequests rule when default mode is no-filtering 2024-08-04 11:59:16 -04:00
Raymond Hill
d42329a3a3
Rephrase more accurately
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/160
2024-08-03 12:03:56 -04:00
Raymond Hill
9562b19a93
Fall back to "Basic" when removing all-urls from "No filtering"
Related discussion:
https://github.com/uBlockOrigin/uBOL-home/issues/156#issuecomment-2254576670
2024-08-01 11:24:42 -04:00
Raymond Hill
a0de43aba9
Import translation work from https://crowdin.com/project/ublock 2024-07-29 16:05:15 -04:00
Raymond Hill
c7b54af0a2
[mv3] Add minimal ability to diagnose ruleset issue
A new icon has been added to the popup panel, to open a popup
window with a terse list of DNR events for the current tab, in
reverse chronological order (most recent DNR event appears at
the top).

The new ability is available only when the extension is sideloaded,
as per `declarativeNetRequestFeedback` documentation. Ref:
https://developer.chrome.com/docs/extensions/reference/api/declarativeNetRequest#event-onRuleMatchedDebug

Purposefully minimal, so as to have something rather than nothing
when having to diagnose filtering issue with the DNR API. Example:
https://github.com/uBlockOrigin/uBOL-home/issues/156

The content of the popup window does not dynamically update, force
a refresh (F5) to get the most recent DNR events. This might be
improved in the future.

The DNR event buffer is not persisted, so the buffer is empty when
service worker is restarted. This might be improved in the future
by using session storage API.

There is no output filtering ability in this first draft. This
might be improved in the future.

DNR rules are reported. The filter from which a DNR rule
originates is not reported. Given that the rulesets are optimized
after conversion from original filter lists to reduce the DNR rule
count, this is unlikely to ever be possible.
2024-07-29 14:54:46 -04:00
Raymond Hill
2bdbac1b84
Import translation work from https://crowdin.com/project/ublock 2024-07-09 13:16:17 -04:00
Raymond Hill
1d7feb83a2
[firefox] Add entry for 128px icon
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3285
2024-07-05 10:01:28 -04:00
Raymond Hill
57ed293760
[mv3] Fix bad test re. managed storage 2024-06-28 13:39:38 -04:00
Raymond Hill
88065d0091
[mv3] Bring procdural cosmetic filtering code up to date with uBO 2024-06-22 11:09:57 -04:00
Raymond Hill
5c69159b36
[mv3] Inject procedural cosmetic filtering script earlier
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/139
2024-06-22 11:06:19 -04:00
Raymond Hill
b24793bc02
Import translation work from Crowdin 2024-06-11 07:47:26 -04:00
Raymond Hill
91ee5bdeae
Improve prevent-addEventListener scriptlet
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3061#issuecomment-2159662039
2024-06-11 07:44:43 -04:00
Raymond Hill
ad77938f24
[mv3] Raise minimum chromium version to 118
This allows to drop the special handling of `isUrlFilterCaseSensitive`
for chromium-based browsers.
2024-05-29 09:57:09 -04:00
Raymond Hill
98977971db
[mv3] Improve generic cosmetic filtering surveyor 2024-05-28 22:08:24 -04:00
Raymond Hill
8ea1bac80b
Trim end of class tokens in generic cosmetic filtering's surveyor
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3257
2024-05-28 18:42:06 -04:00
Raymond Hill
e738eaa447
Import translation work from https://crowdin.com/project/ublock 2024-05-12 15:51:46 -04:00
Raymond Hill
bb479b0a66
Catch exceptions in API calls for the sake of old Chromium versions
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3217#issuecomment-2103628821
2024-05-09 21:29:24 -04:00
Raymond Hill
e7951c2114
Import translation work from https://crowdin.com/project/ublock 2024-04-08 08:23:48 -04:00
Raymond Hill
98a600698e
Remove letsblock.it as target for subscribe.js content script
Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/discussions/3194
2024-04-03 10:51:39 -04:00
Raymond Hill
f9408415a5
Add missing alarms permissions in Thunderbird manifest
Possibly related:
https://old.reddit.com/r/uBlockOrigin/comments/1bquaw8/ublock_origin_157_announcement_thread_please/kxktycl/
2024-04-01 14:50:06 -04:00
Raymond Hill
7ca3855395
Import translation work from https://crowdin.com/project/ublock 2024-04-01 08:33:56 -04:00
Raymond Hill
d2ea9c1b2f
Fix eslint warnings 2024-03-30 13:24:27 -04:00
Raymond Hill
08b8b875ca
Import translation work from https://crowdin.com/project/ublock 2024-03-29 09:26:56 -04:00
Raymond Hill
d3fe073149
Import translation work from https://crowdin.com/project/ublock 2024-03-28 08:21:46 -04:00