[or-cvs] [https-everywhere/master 1/2] Apply dm0's patch to support global installation
pde at torproject.org
pde at torproject.org
Fri Nov 5 00:07:23 UTC 2010
Author: Peter Eckersley <pde at eff.org>
Date: Thu, 4 Nov 2010 17:04:31 -0700
Subject: Apply dm0's patch to support global installation
Commit: 4f6bb4123fbaefa9e30f09a146125e0099215c44
This is reportedly required when packaging HTTPS Everywhere:
https://trac.torproject.org/projects/tor/ticket/2096
It tentatively seems to be okay in the single-user case too.
---
src/chrome/content/code/HTTPSRules.js | 17 ++++-------------
1 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/src/chrome/content/code/HTTPSRules.js b/src/chrome/content/code/HTTPSRules.js
index 7f3bcd7..e49c1f0 100644
--- a/src/chrome/content/code/HTTPSRules.js
+++ b/src/chrome/content/code/HTTPSRules.js
@@ -132,21 +132,12 @@ const RuleWriter = {
},
getRuleDir: function() {
- var loc = "ProfD"; // profile directory
- var file =
- CC["@mozilla.org/file/directory_service;1"]
- .getService(CI.nsIProperties)
- .get(loc, CI.nsILocalFile)
- .clone();
- file.append("extensions");
- file.append("https-everywhere at eff.org");
- file.append("chrome");
+ var file = CC["@mozilla.org/extensions/manager;1"].
+ getService(Components.interfaces.nsIExtensionManager).
+ getInstallLocation("https-everywhere at eff.org").
+ getItemFile("https-everywhere at eff.org", "chrome").clone();
file.append("content");
file.append("rules");
- // Check for existence, if not, create.
- if (!file.exists()) {
- file.create(CI.nsIFile.DIRECTORY_TYPE, 0700);
- }
if (!file.isDirectory()) {
// XXX: Arg, death!
}
--
1.7.1
More information about the tor-commits
mailing list