1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-22 10:22:51 +01:00
uBlock/platform
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
..
browser Rewrite static filtering parser 2023-01-23 16:53:18 -05:00
chromium Rewrite cname uncloaking code to account for new ipaddress= option 2024-09-12 11:19:57 -04:00
common Code review for ipaddress= filter option 2024-09-11 09:56:44 -04:00
dig Change official description in source code top comment 2023-12-04 12:10:34 -05:00
firefox Rewrite cname uncloaking code to account for new ipaddress= option 2024-09-12 11:19:57 -04:00
mv3 [mv3] Attempt at mitigation for when "internal error" occurs 2024-09-06 09:31:17 -04:00
nodejs Change official description in source code top comment 2023-12-04 12:10:34 -05:00
npm Change official description in source code top comment 2023-12-04 12:10:34 -05:00
opera Rewrite cname uncloaking code to account for new ipaddress= option 2024-09-12 11:19:57 -04:00
safari Clarify that the code base was really old and obsolete 2019-09-22 09:57:38 -04:00
thunderbird Remove letsblock.it as target for subscribe.js content script 2024-04-03 10:51:39 -04:00