|
9 | 9 | //--------------- |
10 | 10 |
|
11 | 11 | https_everywhere_blacklist = {}; |
| 12 | +https_domains = {}; // maps domain patterns (with at most one |
| 13 | + // wildcard) to RuleSets |
| 14 | + |
| 15 | +https_everywhere_blacklist = {}; // URLs we've given up on rewriting because |
| 16 | + // of redirection loops |
12 | 17 |
|
13 | 18 | // |
14 | 19 | const CI = Components.interfaces; |
@@ -112,15 +117,6 @@ function xpcom_checkInterfaces(iid,iids,ex) { |
112 | 117 |
|
113 | 118 | INCLUDE('IOUtil', 'HTTPSRules', 'HTTPS', 'Thread'); |
114 | 119 |
|
115 | | -function https_everywhereLog(level, str) { |
116 | | - if (level >= WARN) { |
117 | | - dump(str+"\n"); |
118 | | - var econsole = Components.classes["@mozilla.org/consoleservice;1"] |
119 | | - .getService(Components.interfaces.nsIConsoleService); |
120 | | - econsole.logStringMessage("HTTPS Everywhere: " +str); |
121 | | - } |
122 | | -} |
123 | | - |
124 | 120 | Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); |
125 | 121 |
|
126 | 122 | function HTTPSEverywhere() { |
@@ -326,6 +322,23 @@ HTTPSEverywhere.prototype = { |
326 | 322 |
|
327 | 323 | }; |
328 | 324 |
|
| 325 | +const LLVAR = "LogLevel"; |
| 326 | +var prefs = HTTPSEverywhere.instance.get_prefs(); |
| 327 | +try { |
| 328 | + prefs.getBoolPref(LLVAR); |
| 329 | +} catch (e) { |
| 330 | + prefs.setBoolPref(LLVAR, true); |
| 331 | +} |
| 332 | + |
| 333 | +function https_everywhereLog(level, str) { |
| 334 | + if (level >= prefs.getBoolPref(LLVAR)) { |
| 335 | + dump(str+"\n"); |
| 336 | + var econsole = Components.classes["@mozilla.org/consoleservice;1"] |
| 337 | + .getService(Components.interfaces.nsIConsoleService); |
| 338 | + econsole.logStringMessage("HTTPS Everywhere: " +str); |
| 339 | + } |
| 340 | +} |
| 341 | + |
329 | 342 | /** |
330 | 343 | * XPCOMUtils.generateNSGetFactory was introduced in Mozilla 2 (Firefox 4). |
331 | 344 | * XPCOMUtils.generateNSGetModule is for Mozilla 1.9.2 (Firefox 3.6). |
|
0 commit comments