Patch chrome.dns.resolve to support canonical_name flag
See original GitHub issueDescription
Chromium presently supports IP address resolution:
chrome.dns.resolve('www.brave.com', response => {
console.log(response.address)
})
In order to combat CNAME-trackers, uBO and others are evaluating Firefox’s implementation of the DNS API, which supports passing optional flags:
chrome.dns.resolve('www.brave.com', ['canonical_name']).then( response => {
console.log(response.canonicalName)
})
There are many other optional flags, but CNAME appears to be the most necessary for now.
Note: Chromium expects a callback as the second argument. Firefox, however, returns a promise.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Fix DNS errors - Chromebook Help - Google Support
If you see a DNS (Domain Name System) error, try switching to one of Google's public name servers: Make sure your Chromebook is...
Read more >dns.resolve() - Mozilla - MDN Web Docs
The canonical name for this record. This is only included in the response if the "canonical_name" flag was passed to resolve() .
Read more >Add, modify, and delete records | Cloud DNS
Add, modify, and delete DNS records such as A, AAAA, CNAME, and MX records. ... The canonical name to resolve for incoming address...
Read more >Chrome Host Resolution
Implementation and support of host resolution for the Chrome network stack. Includes client implementations of host resolution protocols (DNS and mDNS), ...
Read more >DNS | Node.js v19.3.0 Documentation
Supported getaddrinfo flags. dns.lookupService(address, port, callback); dns.resolve(hostname[, rrtype], callback); dns.resolve4(hostname[, options], ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@antonok-edm the idea here is that it might be worth exposing for other extensions that might do adblocking in other ways than brave-core does (folks might want to do disconnect or uBO on top of adblock-rust).
I think it’d be a nice to expose the capability to other extensions if it was easy to do, but if its a medium-to-big lift (say, more than 1-2 days work) its prob not worth doing
It wouldn’t work anyway: even if uBlock could leverage this API, it couldn’t be useful on Chromium because webRequest there doesn’t support asynchronous responses and dns.resolve() is asynchronous in nature.