[tor-bugs] #8776 [EFF-HTTPS Everywhere]: Changes to default ruleset state need to work even if the rule was previously present

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Jul 18 20:34:06 UTC 2013


#8776: Changes to default ruleset state need to work even if the rule was
previously present
----------------------------------+-----------------------------------------
 Reporter:  pde                   |          Owner:  micahlee       
     Type:  defect                |         Status:  assigned       
 Priority:  critical              |      Milestone:  HTTPS-E 4.0dev7
Component:  EFF-HTTPS Everywhere  |        Version:                 
 Keywords:                        |         Parent:  #8774          
   Points:                        |   Actualpoints:                 
----------------------------------+-----------------------------------------

Comment(by micahlee):

 I think we should change how rules are saved in the Firefox preferences.
 Right now all the rules are saved as bools in
 extensions.https_everywhere.RULENAME.

 Instead I think we should split this up into two branches:

 extensions.https_everywhere.default_rules.RULENAME
 extensions.https_everywhere.rule_changes.RULENAME

 The default_rules prefs branch will always contain the default state of
 the rule. When opening Firefox and re-parsing the rules, it should update
 values of default_rules prefs if anything has changed.

 The rule_changes prefs branch should only record the status of rules that
 have been manually toggled by the user. Resetting all of the rules should
 just delete all of the rules under the rule_changes branch.

 When deciding if a rule is active, first it should check
 rule_changes.RULENAME and use that value if it's there. If it isn't, it
 should fallback to default_rules.RULENAME.

 This will involve migrating preferences. Seems like a big job. I'm
 wondering if it makes sense to make this a separate ticket and instead
 just disable rules on upgrading, like I was planning above, and make this
 a separate bug to do later.

 And just for my own reference, here's the appropriate parts of the code to
 edit:

 The code that parses each rule and attempts to add new rules is in the
 RuleSet function in src/chrome/content/code/HTTPSRules.js.

 The code that gets the prefs branch is in src/components/https-
 everywhere.js in the get_prefs() function, in HTTPSEverywhere.prototype.
 I'll probably have to figure out all the places that call get_prefs(), and
 make new functions get_default_rules_prefs() and get_rule_changes_prefs()
 and make them call the appropriate function.

 I still need to dig around more to find the piece of code that decides if
 a rule is on or not.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/8776#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list