PSA: uBlock Origin will interfere with your DNS prefetching setting
Moderators: Lootyhoof, FranklinDM
-
- Keeps coming back
- Posts: 953
- Joined: 2020-11-03, 06:47
- Location: Philippines
PSA: uBlock Origin will interfere with your DNS prefetching setting
Just updated to 33.3.0, and I noticed that my DNS prefetching was disabled, which surprised me. I enabled it and then restarted only to see it got flipped back to false again. I had to go through all my add-ons, and turns out I had the Disable pre-fetching checkbox ticked in my uBlock's settings, which explains why the DNS prefetcher pref gets flipped every restart...

"Destroying things, smartly!" - IJN Samidare, probably
Avatar artwork by ebifurya: https://www.pixiv.net/artworks/85379109
XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.
-
- Pale Moon guru
- Posts: 37650
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
This is incorrect for DNS prefetching. This only applies to prefetching of content/predictor/prefetch-next -- uBO should not block DNS prefetching if what is described in the quote is the intent.When prefetching is enabled, the browser can establish connections to remote servers even if the resources from these remote servers were supposed to be blocked by uBO.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Keeps coming back
- Posts: 953
- Joined: 2020-11-03, 06:47
- Location: Philippines
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
Indeed. It shouldn't bypass the user's filters, which seems what uBlock intends to avoid. This might also be why the checkbox is ticked by default; everyone who has uBlock Origin installed will most likely have DNS prefetching forcibly disabled too instead of being flipped by the browser update. Hopefully UCyborg will fix this in their fork.

"Destroying things, smartly!" - IJN Samidare, probably
Avatar artwork by ebifurya: https://www.pixiv.net/artworks/85379109
XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.
-
- Moon Magic practitioner
- Posts: 2884
- Joined: 2012-08-19, 20:32
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
Thanks for the warning, jobbautista9.
-
- Board Warrior
- Posts: 1006
- Joined: 2017-12-14, 12:59
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
DNS-prefetch is off
DNS-prefetch is on
DNS-prefetch is on
You do not have the required permissions to view the files attached to this post.
-
- Pale Moon guru
- Posts: 37650
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
Working exactly as-intended. Standard DNS queries don't connect to the addresses looked up.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Board Warrior
- Posts: 1006
- Joined: 2017-12-14, 12:59
-
- Pale Moon guru
- Posts: 37650
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
Wow, so dramatic!
Remember that lookups are cached. Whether they are looked up in a burst right away or piecemeal doesn't matter for that. But if you don't want to "bomb" the DNS server with work it's designed to be doing (it's all UDP so it's not like you have a connection overhead...) then feel free to switch it off.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Moon Magic practitioner
- Posts: 2884
- Joined: 2012-08-19, 20:32
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
Wait, doesn't disablePrefetch=True (the default setting) mean that prefetching is in fact, disabled?jobbautista9 wrote: ↑2024-08-13, 09:42Just updated to 33.3.0, and I noticed that my DNS prefetching was disabled, which surprised me.
That's what I get from the wording anyway.
-
- Keeps coming back
- Posts: 953
- Joined: 2020-11-03, 06:47
- Location: Philippines
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
Oh yeah you're right, my bad

"Destroying things, smartly!" - IJN Samidare, probably
Avatar artwork by ebifurya: https://www.pixiv.net/artworks/85379109
XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.
-
- Lunatic
- Posts: 308
- Joined: 2021-02-19, 20:46
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
So is this actually a problem or not? I can't figure out whether the addon is doing something it shouldn't or what's going on.
-
- Pale Moon guru
- Posts: 37650
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
To clarify...
The default for network.dns.disablePrefetch in 33.3.0 is false. disable=false means it's prefetching (i.e. the feature is enabled).
The default for network.dns.disablePrefetch in 33.3.0 is false. disable=false means it's prefetching (i.e. the feature is enabled).
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Moon Magic practitioner
- Posts: 2884
- Joined: 2012-08-19, 20:32
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
Right, this setting's default state changed in 33.0.0. Was probably looking at 33.2.1, sorry for the confusion.
-
- Keeps coming back
- Posts: 953
- Joined: 2020-11-03, 06:47
- Location: Philippines
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
As MC just said earlier network.dns.disablePrefetch should be false by default in 33.3.0. But uBlock Origin's default settings (which has the offending "Disable pre-fetching" checkbox ticked) is forcing that pref to be true even with browser restarts (as long as that uBlock checkbox is ticked). This can confuse users who upgrade to 33.3.0 while having uBlock Origin installed expecting for DNS prefetching to be enabled.LuftWafflePilot wrote: ↑2024-08-13, 14:20So is this actually a problem or not? I can't figure out whether the addon is doing something it shouldn't or what's going on.

"Destroying things, smartly!" - IJN Samidare, probably
Avatar artwork by ebifurya: https://www.pixiv.net/artworks/85379109
XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.
-
- Knows the dark side
- Posts: 5588
- Joined: 2015-12-09, 15:45
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
To add - using the FoxyProxy addon will also result in disabling DNS prefetches.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net

KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net
-
- Moon Magic practitioner
- Posts: 2884
- Joined: 2012-08-19, 20:32
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
Am I correct to assume that this uBO setting does not make a direct change in how uBO operates? It only toggles this particular browser setting?
-
- Keeps coming back
- Posts: 953
- Joined: 2020-11-03, 06:47
- Location: Philippines
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
It seems to only toggle the browser's own prefs, AFAICS.

"Destroying things, smartly!" - IJN Samidare, probably
Avatar artwork by ebifurya: https://www.pixiv.net/artworks/85379109
XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.
-
- Keeps coming back
- Posts: 953
- Joined: 2020-11-03, 06:47
- Location: Philippines
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
FWIW, this is the add-on author's justification in 2016 on why DNS prefetching is forcibly disabled: https://github.com/gorhill/uBlock/issues/1716

"Destroying things, smartly!" - IJN Samidare, probably
Avatar artwork by ebifurya: https://www.pixiv.net/artworks/85379109
XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.
-
- Pale Moon guru
- Posts: 37650
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
Misinterpretation of wireshark results, I think. There's obvious lookups missing in Chromium's dump that should occur for a page load, i.e. googleapis.com for the fonts used in the page, etc., so he was probably seeing the caching in effect, and deciding to block DNS based on "I see fewer queries in Chromium so Firefox needs more aggressive settings" while that's not really the case.
Regardless, those lookups do not mean connections to the looked-up servers are made, which has been my point here.
In case people still don't understand I'll try to break down the sequence, AFAIU without combing through the code in question (some steps may be combined or out of order):
A. Original page request
B. Navigation to linked URL:
Steps A8 and A9 happen when prefetching is enabled, resulting in B2 always having a cached IP, skipping B3. As you can see there are no connecting steps after A8 and A9, the page load is done. A9 happens when the original page is being displayed and viewed by the user (i.e. in the background when the browser is otherwise idle), while without prefetching it would be done when actively navigating, incurring a wait.
Regardless, those lookups do not mean connections to the looked-up servers are made, which has been my point here.
In case people still don't understand I'll try to break down the sequence, AFAIU without combing through the code in question (some steps may be combined or out of order):
A. Original page request
- Request is made for example.com
- DNS lookup for example.com -> IP + caching of result
- Connection to example.com's IP
- Page load from example.com
- Parsing of page, scanning for resource URLs, e.g. images
- DNS lookup of resource URLs of display elements -> IP + caching of result
- Connection to resource URL locations, and loading page elements from them.
- Scan of page content for links (external.com)
- DNS lookup for link URLs -> IP + caching of result
B. Navigation to linked URL:
- Request is made for external.com
- DNS cache lookup of external.com. Found? -> IP and skip next step, otherwise do next step
- if not cached: DNS lookup for external.com -> IP + caching of result
- Connection to external.com's IP
- Page load from external.com
Steps A8 and A9 happen when prefetching is enabled, resulting in B2 always having a cached IP, skipping B3. As you can see there are no connecting steps after A8 and A9, the page load is done. A9 happens when the original page is being displayed and viewed by the user (i.e. in the background when the browser is otherwise idle), while without prefetching it would be done when actively navigating, incurring a wait.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Lunatic
- Posts: 355
- Joined: 2019-01-10, 09:37
- Location: Slovenia
Re: PSA: uBlock Origin will interfere with your DNS prefetching setting
So this checkbox hasn't practically altered the behavior of Pale Moon as set out-of-the-box in any way until now, as the 3 prefs' default values were already set like the checked box sets them.
Until now that network.dns.disablePrefetch's default value has changed, which would be better handled by separate checkbox, if at all, considering the option is exposed in Pale Moon's own settings window?
To conclude, clearing the checkbox for now will allow DNS prefetching to remain enabled while other prefetching will still be disabled, unless manually changing settings in about:config.
Code: Select all
if ( settingVal ) {
this.clear('network', 'prefetch-next');
this.clear('network.http', 'speculative-parallel-limit');
this.clear('network.dns', 'disablePrefetch');
} else {
this.setValue('network', 'prefetch-next', false);
this.setValue('network.http', 'speculative-parallel-limit', 0);
this.setValue('network.dns', 'disablePrefetch', true);
}
To conclude, clearing the checkbox for now will allow DNS prefetching to remain enabled while other prefetching will still be disabled, unless manually changing settings in about:config.