1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-29 06:07:11 +02:00
uBlock/src
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
..
_locales Import translation work from https://crowdin.com/project/ublock 2024-08-19 12:02:00 -04:00
css Adjust element picker visuals 2024-04-22 06:08:49 -04:00
img Add a console pane to the logger 2024-04-10 11:27:40 -04:00
js Rewrite cname uncloaking code to account for new ipaddress= option 2024-09-12 11:19:57 -04:00
lib Redesign cache storage 2024-02-26 16:50:11 -05:00
web_accessible_resources Add noop resources for redirect purpose 2024-08-24 12:11:35 -04:00
1p-filters.html Add checkboxes to "My filters" pane 2024-03-11 11:39:31 -04:00
3p-filters.html Keep search input field visuals consistent 2024-03-13 10:57:56 -04:00
about.html Patch Unicode country flags with image-based flags 2023-05-20 21:35:52 -04:00
advanced-settings.html Fix cloud storage widget not showing (regression) 2023-04-10 10:03:51 -04:00
asset-viewer.html Convert remaining vAPI.setTimeout to vAPI.defer 2023-04-14 10:26:45 -04:00
background.html [mv3] Add ability to enable/disable filter lists 2022-09-13 17:44:24 -04:00
cloud-ui.html Work toward bringing dark theme closer to a stable release 2022-01-30 18:35:26 -05:00
code-viewer.html Convert remaining vAPI.setTimeout to vAPI.defer 2023-04-14 10:26:45 -04:00
dashboard.html Add checkboxes to "My filters" pane 2024-03-11 11:39:31 -04:00
devtools.html Benchmark buttons must be disabled by default 2024-03-02 08:58:49 -05:00
document-blocked.html Fix cloud storage widget not showing (regression) 2023-04-10 10:03:51 -04:00
dyna-rules.html Make syntax errors more visible 2024-03-19 11:39:07 -04:00
logger-ui.html Add a console pane to the logger 2024-04-10 11:27:40 -04:00
no-dashboard.html Code maintenance: replace uDom.js with dom.js 2022-11-12 09:51:22 -05:00
popup-fenix.html Prevent resizing of title bar in popup menu 2024-07-05 10:11:27 -04:00
settings.html Fix cloud storage widget not showing (regression) 2023-04-10 10:03:51 -04:00
support.html Isolate DOM inspector layers from page context 2023-12-03 16:21:32 -05:00
whitelist.html Add checkboxes to "My filters" pane 2024-03-11 11:39:31 -04:00