Opened 10 years ago

#1171 closed defect (Fixed)

network.dns.disablePrefetch resets to false

Reported by: bugmenot Owned by:
Priority: Low Milestone:
Component: Applications/Torbutton Version: 1.2.3
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

There's an option in Firefox to disable DNS automatic prefetching of URLs in a page by adding a boolean variable named

'network.dns.disablePrefetch' in about:config, and setting it to 'true'. Torbutton appears to be resetting this value to
'false' on each usage.

Procedure:

Click Torbutton off ("Tor Disabled")
Add boolean value 'network.dns.disablePrefetch' in Firefox about:config and set to 'true'
Click Torbutton on ("Tor Enabled")

  • Torbutton changes 'network.dns.disablePrefetch' to an empty 'string' value *

Click Torbutton off ("Tor Disabled")

  • Torbutton changes 'network.dns.disablePrefetch' to 'false' *

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Attachments (2)

torbutton-1.2.4pre3.xpi (355.6 KB) - added by mikeperry 10 years ago.
torbutton-1.2.4pre6.xpi (386.7 KB) - added by mikeperry 10 years ago.

Download all attachments as: .zip

Change History (8)

Changed 10 years ago by mikeperry

Attachment: torbutton-1.2.4pre3.xpi added

comment:1 Changed 10 years ago by mikeperry

Can you try the xpi in the attachments tab? It appears to be doing the right thing for me now, though I'm not
sure why the pref value gets the type of "string" when it is reset to default. That appears to be firefox's
doing..

comment:2 Changed 10 years ago by bugmenot

Hi, Mike. My apologies for the extremely long-winded reply, but I hope this might help some. Thanks very much for your time and effort here.

OK here goes... running through the situation in a step-by-step manner in an effort to logically understand what's going on...

Firefox version 3.5.5

  1. Disabled all Firefox extensions
  2. Added 'network.dns.disablePrefetch' boolean variable to Firefox and set to 'true'
  3. Closed and restarted Firefox, checked 'network.dns.disablePrefetch' is still there and set to 'true' (yes)
  4. Enabled Torbutton 1.2.4pre3 extension and restarted Firefox
  1. Checked 'network.dns.disablePrefetch' in about:config ... I have Firefox configured to start with Tor enabled by default, so on startup Torbutton is active (green). The variable 'network.dns.disablePrefetch' lists as 'true' in this state as it should. However, when I click Torbutton off to disable Tor, 'network.dns.disablePrefetch' resets to a 'string' type but with no 'value' set (blank). If I click Torbutton on again, 'network.dns.disablePrefetch' changes again to a boolean type set to 'true'.
  1. Closed and restarted Firefox again to confirm operation, results are as step '5' above.
  1. Configured Torbutton to start-up in 'Non-Tor' mode and restarted Firefox. The 'network.dns.disablePrefetch' variable is gone completely in about:config. If I click to enable Torbutton and refresh about:config, 'network.dns.disablePrefetch' appears and is set to 'true'. If I then click to disable Torbutton, 'network.dns.disablePrefetch' changes to a 'string' type with no value set.
  1. Closed and restarted Firefox to confirm, results are as '7' above.
  1. Disabled Torbutton extension and restarted Firefox. 'network.dns.disablePrefetch' is missing in about:config so I add it manually and set to 'true'.

* An interesting point here is that when adding a boolean type, Firefox would normally present a 'boolean menu' offering the 'true' or 'false' choices for the variable during its creation. With the Torbutton extension active this 'boolean menu' *at some point in the past* didn't occur, rather the creation of a boolean variable would offer a menu to allow for a string to be typed instead (where we would be required to manually type "true" or "false" in this case). For some reason something has changed somewhere here because I've been unable to recreate this situation on noticing this during testing with 1.2.4pre3. I need to pin that down as at this point I have no idea what is different. *

  1. Continuing step '9', I close and restart Firefox. The configured variable 'network.dns.disablePrefetch' is still there in about:config and is set to 'true' as expected.
  1. Enabled Torbutton extension and restarted Firefox. Torbutton is in 'Non-Tor' inactive mode, 'network.dns.disablePrefetch' is still there in about:config and is set to true. Clicking Torbutton active leaves 'network.dns.disablePrefetch' there and set to 'true'. Clicking Torbutton to inactive changes 'network.dns.disablePrefetch' to a string type with no value set. Clicking Torbutton active again returns 'network.dns.disablePrefetch' to a boolean type set to 'true'.

...

I don't know what's wrong with Torbutton here as I'm not knowledgable enough, and I don't know Java at all, but for the purposes of testing I've gone into the 'torbutton.js' file and manually commented out lines 1192-1193 in a effort to disable the "network.dns.disablePrefetch" function. I do not understand what this code does, but for the hell of it I don't mind trying at this point to see what happens.

After restarting Firefox, in Non-Tor mode, after this modification has been made, there is no 'network.dns.disablePrefetch' configured in about:config (this is as before when starting Firefox in Non-Tor mode, so nothing has changed at this point). I add the 'network.dns.disablePrefetch' boolean variable manually and set it to 'true'. Now when I click Torbutton on/off it no longer changes the 'network.dns.disablePrefetch' value from the configured 'true' state as we should expect. Looking good then....

I close and restart Firefox in Non-Tor mode. The 'network.dns.disablePrefetch' is still there and is still set to 'true' (good).

I configure Torbutton to startup in 'Tor' mode, and restart Firefox. Firefox starts in 'Tor Enabled' mode and about:config shows the variable 'network.dns.disablePrefetch' is still there and is set to 'true' as expected (good). Clicking Torbutton off does not change the state of 'network.dns.disablePrefetch' which continues to remain set to 'true' (good).

So, I don't understand what those 2 lines of code at 1192-1193 actually do, but removing them appears to cure the problem entirely. For all I know they could be breaking something somewhere but I have no idea.

...

I uninstalled 1.2.4pre3 and reinstalled 1.2.3. 'network.dns.disablePrefetch' is messed up again in some way, though now 'network.dns.disablePrefetch' in Non-Tor mode is set to false, and clicking to enable Torbutton changes it to a string variable with no value set (this is backwards from earlier where switching to Non-Tor mode would leave 'network.dns.disablePrefetch' in this state). So I manually toggle the Non-Tor 'network.dns.disablePrefetch' state from 'false' to 'true' and restart Firefox. Now after restarting 'network.dns.disablePrefetch' is still set to 'true', but again when clicking to enable Torbutton 'network.dns.disablePrefetch' changes to a string type with no value set. So I restart Firefox again, it starts in Non-Tor mode, and now 'network.dns.disablePrefetch' shows as being set to 'false' (it should be true because I just manually set it as such). Seems as though the act of it falling into a blank 'string' state confuses it which causes it to lose its configuration memory.

...

(v.1.2.3)
I set Torbutton to start with 'Tor' enabled. There is no 'network.dns.disablePrefetch' about:config anymore, so I add it manually and set it to 'true'. Then I click Torbutton off and 'network.dns.disablePrefetch' changes to 'false'. Then I click Torbutton on and 'network.dns.disablePrefetch' changes to a blank string.

...

(v.1.2.3)
I defaulted all Torbutton settings using the 'Restore Defaults' button. Restarting Firefox shows 'network.dns.disablePrefetch' set to 'false'. Clicking Torbutton active sets 'network.dns.disablePrefetch' to a blank string. Clicking Torbutton off changes 'network.dns.disablePrefetch' to boolean type set to 'false'.

...

I'll quit at this point! :)

comment:3 Changed 10 years ago by bugmenot

Whoops, sorry about the wrapping there... I'll try again...

My apologies for the extremely long reply, but I hope this might help some. Thanks very much for your time
and effort here.

OK here goes, running through the situation in a step-by-step manner in an effort to logically understand
what's going on...

Firefox version 3.5.5

  1. Disabled all Firefox extensions
  2. Added 'network.dns.disablePrefetch' boolean variable to Firefox and set to 'true'
  3. Closed and restarted Firefox, checked 'network.dns.disablePrefetch' is still there and set to 'true' (yes)
  4. Enabled Torbutton 1.2.4pre3 extension and restarted Firefox
  1. Checked 'network.dns.disablePrefetch' in about:config ... I have Firefox configured to start with Tor

enabled by default, so on startup Torbutton is active (green). The variable 'network.dns.disablePrefetch'
lists as 'true' in this state as it should. However, when I click Torbutton off to disable Tor,
'network.dns.disablePrefetch' resets to a 'string' type but with no 'value' set (blank). If I click Torbutton
on again, 'network.dns.disablePrefetch' changes again to a boolean type set to 'true'.

  1. Closed and restarted Firefox again to confirm operation, results are as step '5' above.
  1. Configured Torbutton to start-up in 'Non-Tor' mode and restarted Firefox. The

'network.dns.disablePrefetch' variable is gone completely in about:config. If I click to enable Torbutton and
refresh about:config, 'network.dns.disablePrefetch' appears and is set to 'true'. If I then click to disable
Torbutton, 'network.dns.disablePrefetch' changes to a 'string' type with no value set.

  1. Closed and restarted Firefox to confirm, results are as '7' above.
  1. Disabled Torbutton extension and restarted Firefox. 'network.dns.disablePrefetch' is missing in

about:config so I add it manually and set to 'true'.

* An interesting point here is that when adding a boolean type, Firefox would normally present a 'boolean
menu' offering the 'true' or 'false' choices for the variable during its creation. With the Torbutton
extension active this 'boolean menu' *at some point in the past* didn't occur, rather the creation of a
boolean variable would offer a menu to allow for a string to be typed instead (where we would be required to
manually type "true" or "false" in this case). For some reason something has changed somewhere here because
I've been unable to recreate this situation on noticing this during testing with 1.2.4pre3. I need to pin
that down as at this point I have no idea what is different.
*

  1. Continuing step '9', I close and restart Firefox. The configured variable 'network.dns.disablePrefetch'

is still there in about:config and is set to 'true' as expected.

  1. Enabled Torbutton extension and restarted Firefox. Torbutton is in 'Non-Tor' inactive mode,

'network.dns.disablePrefetch' is still there in about:config and is set to true. Clicking Torbutton active
leaves 'network.dns.disablePrefetch' there and set to 'true'. Clicking Torbutton to inactive changes
'network.dns.disablePrefetch' to a string type with no value set. Clicking Torbutton active again returns
'network.dns.disablePrefetch' to a boolean type set to 'true'.

...

I don't know what's wrong with Torbutton here as I'm not knowledgable enough, and I don't know Java at all,
but for the purposes of testing I've gone into the 'torbutton.js' file and manually commented out lines
1192-1193 in a effort to disable the "network.dns.disablePrefetch" function. I do not understand what this
code does, but for the hell of it I don't mind trying at this point to see what happens.

After restarting Firefox, in Non-Tor mode, after this modification has been made, there is no
'network.dns.disablePrefetch' configured in about:config (this is as before when starting Firefox in Non-Tor
mode, so nothing has changed at this point). I add the 'network.dns.disablePrefetch' boolean variable
manually and set it to 'true'. Now when I click Torbutton on/off it no longer changes the
'network.dns.disablePrefetch' value from the configured 'true' state as we should expect. Looking good
then....

I close and restart Firefox in Non-Tor mode. The 'network.dns.disablePrefetch' is still there and is still
set to 'true' (good).

I configure Torbutton to startup in 'Tor' mode, and restart Firefox. Firefox starts in 'Tor Enabled' mode and
about:config shows the variable 'network.dns.disablePrefetch' is still there and is set to 'true' as expected
(good). Clicking Torbutton off does not change the state of 'network.dns.disablePrefetch' which continues to
remain set to 'true' (good).

So, I don't understand what those 2 lines of code at 1192-1193 actually do, but removing them appears to cure
the problem entirely. For all I know they could be breaking something somewhere but I have no idea.

...

I uninstalled 1.2.4pre3 and reinstalled 1.2.3. 'network.dns.disablePrefetch' is messed up again in some way,
though now 'network.dns.disablePrefetch' in Non-Tor mode is set to false, and clicking to enable Torbutton
changes it to a string variable with no value set (this is backwards from earlier where switching to Non-Tor
mode would leave 'network.dns.disablePrefetch' in this state). So I manually toggle the Non-Tor
'network.dns.disablePrefetch' state from 'false' to 'true' and restart Firefox. Now after restarting
'network.dns.disablePrefetch' is still set to 'true', but again when clicking to enable Torbutton
'network.dns.disablePrefetch' changes to a string type with no value set. So I restart Firefox again, it
starts in Non-Tor mode, and now 'network.dns.disablePrefetch' shows as being set to 'false' (it should be true
because I just manually set it as such). Seems as though the act of it falling into a blank 'string' state
confuses it which causes it to lose its configuration memory.

...

(v.1.2.3)
I set Torbutton to start with 'Tor' enabled. There is no 'network.dns.disablePrefetch' about:config anymore,
so I add it manually and set it to 'true'. Then I click Torbutton off and 'network.dns.disablePrefetch'
changes to 'false'. Then I click Torbutton on and 'network.dns.disablePrefetch' changes to a blank string.

...

(v.1.2.3)
I defaulted all Torbutton settings using the 'Restore Defaults' button. Restarting Firefox shows
'network.dns.disablePrefetch' set to 'false'. Clicking Torbutton active sets 'network.dns.disablePrefetch' to
a blank string. Clicking Torbutton off changes 'network.dns.disablePrefetch' to boolean type set to 'false'.

...

I'll quit at this point! :)

Changed 10 years ago by mikeperry

Attachment: torbutton-1.2.4pre6.xpi added

comment:4 Changed 10 years ago by mikeperry

Thanks for the detail. The problem was that since disablePrefetch has no default value, it wasn't
properly being restored when saved as a boolean by torbutton.

Try the xpi in the attachments tab. It seems to fix the issue for me.

comment:5 Changed 10 years ago by bugmenot

Yep 1.2.4pre6 looks to be working fine here after a quick test; no problems to note when toggling between true/false
in the Tor & Non-Tor modes anyway, so I'd say it's looking good.

Thanks a lot, Mike, much appreciated.

Regards,
Bug MeNot. :)

comment:6 Changed 9 years ago by mikeperry

flyspray2trac: bug closed.
Fixed in 1.2.4

Note: See TracTickets for help on using tickets.