Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are network.dns.disablePrefetch/network.dns.disablePrefetchFromHTTPS master switches of dom.prefetch_dns_for_anchor_http_document/dom.prefetch_dns_for_anchor_https_document? #1870

Closed
Jee-Hex opened this issue Jul 8, 2024 · 2 comments

Comments

@Jee-Hex
Copy link

Jee-Hex commented Jul 8, 2024

@mik0l commented in #1862 (comment)

network.dns.* main switches, they already cover dom.prefetch_dns_for_anchor_http(s)_document

So I used the following test case (inspired by bug 1596935 comment 28):

  1. Start HTTP logging.
  2. Open a new tab and open the Network Monitor beforehand.
  3. Visit https://en.wikipedia.org/wiki/Main_Page. AFAICT the page do not request any resources from meta.wikimedia.org yet contains <link rel="dns-prefetch" href="//meta.wikimedia.org" /> in its source, so that's what we will be watching out for.
  4. Stop HTTP logging.
  5. Open about:networking#dns to confirm any resolved hostnames.
  6. Check the Network Monitor to see if any resources were requested from these hostnames.
  7. Check the HTTP logs for entries like D/nsHostResolver Resolving Host [meta.wikimedia.org]<^partitionKey=%28https%2Cwikipedia%2Corg%29> type 0. [this=blahblahblah]

Using a vanilla 127.0.2 (i.e. dom.prefetch_dns_for_anchor_https_document= false, network.dns.disablePrefetchFromHTTPS= false):

 I see DNS lookups for `meta.wikimedia.org` (Expected Behavior).

with dom.prefetch_dns_for_anchor_https_document= true, network.dns.disablePrefetchFromHTTPS= false:

In addition to `meta.wikimedia.org`, I also see DNS lookups for other Wikipedia editions (e.g. `ja.wikipedia.org`) (Expected Behavior).

with dom.prefetch_dns_for_anchor_https_document= true, network.dns.disablePrefetchFromHTTPS= true:

No DNS lookups for `meta.wikimedia.org` or other Wikipedia editions (Expected if `network.dns.disablePrefetchFromHTTPS` is the master switch for `dom.prefetch_dns_for_anchor_https_document`).

with dom.prefetch_dns_for_anchor_http_document= true, dom.prefetch_dns_for_anchor_https_document= true, network.dns.disablePrefetch= true, and network.dns.disablePrefetchFromHTTPS= false:

No DNS lookups for `meta.wikimedia.org` or other Wikipedia editions!

with dom.prefetch_dns_for_anchor_http_document= false, dom.prefetch_dns_for_anchor_https_document= true, network.dns.disablePrefetch= false, and network.dns.disablePrefetchFromHTTPS= false:

DNS lookups for `meta.wikimedia.org` and other Wikipedia editions (Expected Behavior).

with dom.prefetch_dns_for_anchor_http_document= false, dom.prefetch_dns_for_anchor_https_document= true, network.dns.disablePrefetch= true, and network.dns.disablePrefetchFromHTTPS= false:

No DNS lookups for `meta.wikimedia.org` or other Wikipedia editions!

with dom.prefetch_dns_for_anchor_http_document= false, dom.prefetch_dns_for_anchor_https_document= false, network.dns.disablePrefetch= true, and network.dns.disablePrefetchFromHTTPS= true:

No DNS lookups for `meta.wikimedia.org` or other Wikipedia editions (Expected Behavior).

Am I missing something or is there a bug somewhere?

@Jee-Hex
Copy link
Author

Jee-Hex commented Jul 10, 2024

So I ran the same test on 126.0.1.

network.dns.disablePrefetch=false, network.dns.disablePrefetchfromHTTPS=true (default):

no DNS lookups for meta.wikimedia.org

network.dns.disablePrefetch=true, network.dns.disablePrefetchfromHTTPS=false:

no DNS lookups for meta.wikimedia.org

network.dns.disablePrefetch=false, network.dns.disablePrefetchfromHTTPS=false:

DNS lookups for meta.wikimedia.org

Am I missing something

The answer is yes, because network.dns.disablePrefetch is also the master switch of network.dns.disablePrefetchfromHTTPS. I guess I always thought it meant something like network.dns.disablePrefetchfromHTTP.

In short

  1. network.dns.disablePrefetchfromHTTPS is the master switch of dom.prefetch_dns_for_anchor_https_document,
  2. network.dns.disablePrefetch is (presumably) the master switch of dom.prefetch_dns_for_anchor_http_document,
  3. network.dns.disablePrefetch is also the master switch of network.dns.disablePrefetchfromHTTPS.

Sorry again for all the noise.

@Jee-Hex Jee-Hex closed this as completed Jul 10, 2024
@Thorin-Oakenpants
Copy link
Contributor

okie dokie - thanks for testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants