function grant_perms(url) {
var perms = "UniversalXPConnect UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead UniversalFileRead";
dump('Granting ' + perms + ' to ' + url + '\n');
- var pref = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefBranch);
- if (pref) {
- pref.setCharPref("capability.principal.codebase.p0.granted", perms);
- pref.setCharPref("capability.principal.codebase.p0.id", url);
- pref.setCharPref("capability.principal.codebase.p1.granted", perms);
- pref.setCharPref("capability.principal.codebase.p1.id", url.replace('http:','https:'));
- pref.setBoolPref("dom.disable_open_during_load",false);
- pref.setBoolPref("browser.popups.showPopupBlocker",false);
+ if (G.pref) {
+ G.pref.setCharPref("capability.principal.codebase.p0.granted", perms);
+ G.pref.setCharPref("capability.principal.codebase.p0.id", url);
+ G.pref.setCharPref("capability.principal.codebase.p1.granted", perms);
+ G.pref.setCharPref("capability.principal.codebase.p1.id", url.replace('http:','https:'));
+ G.pref.setBoolPref("dom.disable_open_during_load",false);
+ G.pref.setBoolPref("browser.popups.showPopupBlocker",false);
}
}
}
/////////////////////////////////////////////////////////////////////////////
- var pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
-
JSAN.errorLevel = "die"; // none, warn, or die
JSAN.addRepository('..');
var mw = self;
G = {};
+
+ G.pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
JSAN.use('util.error');
G.error = new util.error();
'auth' : G.auth,
'url' : url,
'window' : G.window,
- 'data' : G.data
+ 'data' : G.data,
+ 'pref' : G.pref
};
if (G.data.ws_info && G.data.ws_info[G.auth.controller.view.server_prompt.value]) {
document.getElementById('debug_gb').hidden = false;
}
- if (pref && pref.getBoolPref('open-ils.debug_options')) {
+ if (G.pref && G.pref.getBoolPref('open-ils.debug_options')) {
document.getElementById('debug_gb').hidden = false;
}
false
);
- if ( found_ws_info_in_Achrome() && pref && pref.getBoolPref("open-ils.write_in_user_chrome_directory") ) {
+ if ( found_ws_info_in_Achrome() && G.pref && G.pref.getBoolPref("open-ils.write_in_user_chrome_directory") ) {
//var hbox = x.parentNode; var b = document.createElement('button');
//b.setAttribute('label','Migrate legacy settings'); hbox.appendChild(b);
//b.addEventListener(
// This one is required for XUL Runner
pref("toolkit.defaultChromeURI", "chrome://open_ils_staff_client/content/main/main.xul");
+// These are specific to Evergreen
+pref("open-ils.write_in_user_chrome_directory", true);
+pref("open-ils.disable_accesskeys_on_tabs", false);
+
// Let's try to enable tracemonkey
pref("javascript.options.jit.chrome", true);
pref("javascript.options.jit.content", true);
// navigator.xul not being registered. But is about:blank the best value to use here?
pref("browser.chromeURL","about:blank");
-// This one is specific for Open-ILS
-pref("open-ils.write_in_user_chrome_directory", true);
-
// This one just makes things speedier. We use a lot of XMLHttpRequest
pref("network.http.max-persistent-connections-per-server",8);