Need help on how to use alternate dns proxy if user has it available
Currently addon uses dns.resolve API which browser Firefox makes it available to webextensions as per: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/dns/resolve
AFAIK this is the only browser API given to extensions by Firefox for resolving dns to IP.
How dns.resolve works is browser side implementation, possibly it calls system's DNS resolver?
Feature request: Provide a setting switch to support resolving DNS over proxy provided from some other addon inside browser like TBB or such.
Some advanced user and developer who reviewed the code thought it was an issue and reached out on social network. (so far, I recommended it for normal Firefox and normal Android Firefox ....and NOT for secure browsers like TBB etc and advanced users who obviously use TBB etc. Ideally, in TBB no other addon should be added except what's bundled by its developers. Now, what is needed to make it usable for such use cases if users wish to do so? See below.)
Which other browser API except dns.resolve can be used inside extension to resolve dns to IP? How can it call another addon provided dns proxy? Or is there any other way that webrequest onBeforeRequest can resolve the DNS --> IP instead of dns.resolve?
API reference page for point 1 or sample extension to refer and reuse under libre license compatible with GPLv3
Please consider that this addon is only a week old after first publication and I can take all the help anyone can offer here in Gitlab. I wished to publish ASAP before everyone forgets' KashHill's Gizmodo series on living without the big tech. Several users have appreciated that this addon has greatly lowered the barrier to replicate her research.
Need clarification Questions raised by the reviewer and my answers:
1) Does this extension read webpage's body content (i.e DOM elements and nodes?)
No, it doesn't have content scripts of webext tech (review manifest.json if it has content scripts, they are the only parts of any extension that can read page DOM. Background script array in manifest.json are previliged but CANNOT access page DOM loaded in browser tab window. Since it has no content script, it can never see the contents of webpage, only any webrequests made). Inside a webext background page, "Document" refers to itself and not the page's DOM in tab - I have not even used that document either, it's a dummy auto-generated document titled background.html holding with < script > rows with your background array scripts from manifest.json and does not nothing else other than holding the background array scripts.
2) Does this extension read/parse/click/resolve search results' links and pick each result one by one in background? Does it try to pick and resolve all the links in every page? Ans: NO.
No! See answer above. It cannot see contents of a webpage as it doesn't have content script in manifest.json. User either need to click on a link in her search results, or their browser did a pre-fetch from search results which got picked up by this addon as expected AFTER browser did pre-fetch. Advanced users can look up the web for how to disable pre-fetch via about:config or some other place. It's not decided by this extension as it's a browser side setting. We listen for pre-fetch calls too via "requesttype" called "speculative" - refer this page
P.S. I believe 100% in users' choice (I don't make choices for them on their behalf, which is also why all toggle switches in popup are OFF by default when you install the addon. User can decide what she wants to do with the addon) Even if PreFetch happens, AFTER browser starts a Pre-fetch process, and if the URL domain resolves to a IP in User-selected blocked cloud, it will be cancelled because the USER OPTED for blocking it.
If someone can point me to a page or give example on how one addon can speak to another addon's DNS resolver proxy instead of browser.dns.resolve provided by Firefox to extensions, I can try refer and implement a special mode setting for advanced users who use TBB or other proxies similar.