From e22687c07164ae026a39de2865d859197203982b Mon Sep 17 00:00:00 2001 From: phasefx Date: Wed, 15 Dec 2010 20:11:59 +0000 Subject: [PATCH] augment the useragent for the xulrunner staff client git-svn-id: svn://svn.open-ils.org/ILS/trunk@19001 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/chrome/content/main/main.js | 3 +++ Open-ILS/xul/staff_client/server/main/data.xul | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/Open-ILS/xul/staff_client/chrome/content/main/main.js b/Open-ILS/xul/staff_client/chrome/content/main/main.js index 290fd3372..f3de972fc 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/main.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/main.js @@ -215,6 +215,9 @@ function main_init() { 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(); diff --git a/Open-ILS/xul/staff_client/server/main/data.xul b/Open-ILS/xul/staff_client/server/main/data.xul index 5f05637c4..3710dd7d2 100644 --- a/Open-ILS/xul/staff_client/server/main/data.xul +++ b/Open-ILS/xul/staff_client/server/main/data.xul @@ -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')); } -- 2.11.0