[open-ils-commits] r19001 - in trunk/Open-ILS/xul/staff_client: chrome/content/main server/main (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Dec 15 15:12:04 EST 2010


Author: phasefx
Date: 2010-12-15 15:11:59 -0500 (Wed, 15 Dec 2010)
New Revision: 19001

Modified:
   trunk/Open-ILS/xul/staff_client/chrome/content/main/main.js
   trunk/Open-ILS/xul/staff_client/server/main/data.xul
Log:
augment the useragent for the xulrunner staff client


Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/main.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/main.js	2010-12-15 17:12:13 UTC (rev 19000)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/main.js	2010-12-15 20:11:59 UTC (rev 19001)
@@ -215,6 +215,9 @@
         G =  {};
         
         G.pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
+        if (! G.pref.prefHasUserValue('general.useragent.override')) {
+            G.pref.setCharPref('general.useragent.override',navigator.userAgent + ' oils_xulrunner /xul/server/');
+        }
 
         JSAN.use('util.error');
         G.error = new util.error();

Modified: trunk/Open-ILS/xul/staff_client/server/main/data.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/main/data.xul	2010-12-15 17:12:13 UTC (rev 19000)
+++ trunk/Open-ILS/xul/staff_client/server/main/data.xul	2010-12-15 20:11:59 UTC (rev 19001)
@@ -46,6 +46,15 @@
 
             netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
+            // XXX: We're reproducing what's in main.js just for a time so we can have this immediately in some environments
+            // without requiring a new staff client build be deployed
+            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+            var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Ci['nsIPrefBranch']);                                             if (prefs.prefHasUserValue('general.useragent.override')) {
+                // don't want an ever-growing useragent
+            } else {
+                prefs.setCharPref('general.useragent.override',navigator.userAgent + ' oils_xulrunner /xul/server/');
+            }
+
             if (typeof JSAN == 'undefined') {
                 throw(document.getElementById("commonStrings").getString('common.jsan.missing'));
             }



More information about the open-ils-commits mailing list