Remove broken support for bundles
This commit is contained in:
parent
548465b8af
commit
df97882efe
|
@ -1,5 +1,5 @@
|
||||||
package : fws-firefox-config
|
package : fws-firefox-config
|
||||||
version : 2
|
version : 3
|
||||||
architecture : all
|
architecture : all
|
||||||
section : base
|
section : base
|
||||||
priority : optional
|
priority : optional
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
|
|
||||||
|
|
||||||
if(getenv("USER") != "") {
|
if(getenv("USER") != "") {
|
||||||
var user = getenv("USER");
|
var user = getenv("USER");
|
||||||
} else {
|
} else {
|
||||||
var env_user = getenv("USERNAME");
|
var env_user = getenv("USERNAME");
|
||||||
}
|
}
|
||||||
|
|
||||||
{% if firefox_config_append_domain is defined and firefox_config_append_domain != '' %}
|
{% if firefox_config_append_domain is defined and firefox_config_append_domain != '' %}
|
||||||
|
@ -19,66 +19,3 @@ lockPref("autoadmin.append_emailaddr", true);
|
||||||
lockPref("autoadmin.global_config_url", "{{ firefox_config_url }}");
|
lockPref("autoadmin.global_config_url", "{{ firefox_config_url }}");
|
||||||
lockPref("autoadmin.failover_to_cached", true);
|
lockPref("autoadmin.failover_to_cached", true);
|
||||||
lockPref("autoadmin.offline_failover", true);
|
lockPref("autoadmin.offline_failover", true);
|
||||||
|
|
||||||
// Javascript to enable the distribution/bundles directory
|
|
||||||
|
|
||||||
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
|
||||||
|
|
||||||
var gBundlePrefFiles = [];
|
|
||||||
|
|
||||||
Cu.import("resource://gre/modules/Services.jsm");
|
|
||||||
|
|
||||||
function loadBundleDirs() {
|
|
||||||
var distributionBundleDir = Services.dirsvc.get("GreD", Ci.nsIFile);
|
|
||||||
distributionBundleDir.append("distribution");
|
|
||||||
distributionBundleDir.append("bundles");
|
|
||||||
if (!distributionBundleDir.exists() || !distributionBundleDir.isDirectory()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var enumerator = distributionBundleDir.directoryEntries;
|
|
||||||
while (enumerator.hasMoreElements()) {
|
|
||||||
var file = enumerator.getNext().QueryInterface(Ci.nsIFile);
|
|
||||||
var dirName = file.leafName;
|
|
||||||
|
|
||||||
file.append("chrome.manifest");
|
|
||||||
Components.manager.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(file);
|
|
||||||
file.leafName = "defaults";
|
|
||||||
file.append("preferences");
|
|
||||||
if (!file.exists() || !file.isDirectory()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
var resource = Services.io.getProtocolHandler("resource")
|
|
||||||
.QueryInterface(Components.interfaces.nsIResProtocolHandler);
|
|
||||||
|
|
||||||
// We can't use a file URL to load prefs.
|
|
||||||
// Create a resource URL that maps to the prefs directory.
|
|
||||||
var prefAlias = Services.io.newFileURI(file);
|
|
||||||
resource.setSubstitution(dirName + "_prefs", prefAlias);
|
|
||||||
var prefEnumerator = file.directoryEntries;
|
|
||||||
while (prefEnumerator.hasMoreElements()) {
|
|
||||||
var prefFile = prefEnumerator.getNext().QueryInterface(Ci.nsIFile);
|
|
||||||
gBundlePrefFiles.push("resource://" + dirName + "_prefs/" + prefFile.leafName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var loadPrefObserver = {
|
|
||||||
observe: function observe(subject, topic, data) {
|
|
||||||
if (gBundlePrefFiles.length > 0) {
|
|
||||||
// Create a temporary scope so the pref function works
|
|
||||||
var temp = {};
|
|
||||||
temp.pref = function(a, b) {
|
|
||||||
defaultPref(a, b);
|
|
||||||
}
|
|
||||||
gBundlePrefFiles.forEach(function(prefFile) {
|
|
||||||
Services.scriptloader.loadSubScript(prefFile, temp);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Services.obs.addObserver(loadPrefObserver, "load-extension-defaults", false);
|
|
||||||
|
|
||||||
try {
|
|
||||||
loadBundleDirs();
|
|
||||||
} catch(e) {}
|
|
||||||
|
|
Loading…
Reference in New Issue