This is how we can grant priviledges to remote js without needing signed code, or...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 1 Nov 2005 18:03:52 +0000 (18:03 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 1 Nov 2005 18:03:52 +0000 (18:03 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1934 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/evergreen/main/main.js
Open-ILS/xul/staff_client/chrome/content/evergreen/util/error.js
Open-ILS/xul/staff_client/defaults/preferences/evergreen.js

index 9790ed1..c2666a1 100644 (file)
@@ -3,6 +3,14 @@ dump('entering main/main.js\n');
 function main_init() {
        dump('entering main_init()\n');
        try {
 function main_init() {
        dump('entering main_init()\n');
        try {
+
+               var pref = Components.classes["@mozilla.org/preferences-service;1"]
+                       .getService(Components.interfaces.nsIPrefBranch);
+               if (pref) {
+                       pref.setCharPref("capability.principal.codebase.p0.granted", "UniversalXPConnect");
+                       pref.setCharPref("capability.principal.codebase.p0.id", "http://gapines.org");
+               }
+
                if (typeof JSAN == 'undefined') {
                        throw(
                                "The JSAN library object is missing."
                if (typeof JSAN == 'undefined') {
                        throw(
                                "The JSAN library object is missing."
index 4e8ee6e..4361c1c 100644 (file)
@@ -4,7 +4,6 @@ if (typeof util == 'undefined') util = {};
 util.error = function () {
 
        try {
 util.error = function () {
 
        try {
-               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                this.consoleService = Components.classes['@mozilla.org/consoleservice;1']
                        .getService(Components.interfaces.nsIConsoleService);
        } catch(E) {
                this.consoleService = Components.classes['@mozilla.org/consoleservice;1']
                        .getService(Components.interfaces.nsIConsoleService);
        } catch(E) {
index e23d78a..7459af2 100644 (file)
@@ -19,3 +19,6 @@ pref("javascript.options.showInConsole",true);
 pref("security.checkloaduri", false);
 pref("signed.applets.codebase_principal_support", true);
 
 pref("security.checkloaduri", false);
 pref("signed.applets.codebase_principal_support", true);
 
+//user_pref("capability.principal.codebase.p0.granted", "UniversalXPConnect");
+//user_pref("capability.principal.codebase.p0.id", "http://gapines.org");
+