[Pkg-mozext-commits] [requestpolicy] 06/08: telemetry: general.useragent.locale appears to sometimes be a localized string

David Prévot taffit at moszumanska.debian.org
Fri Sep 19 17:44:28 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag release-0.5.27
in repository requestpolicy.

commit ef0a836c609307bee8c3eaaa1a05c711388a3efc
Author: Justin Samuel <js at justinsamuel.com>
Date:   Mon Jul 16 14:36:30 2012 -0700

    telemetry: general.useragent.locale appears to sometimes be a localized string
---
 src/modules/Stats.jsm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/modules/Stats.jsm b/src/modules/Stats.jsm
index 1dea5df..7dcbccc 100644
--- a/src/modules/Stats.jsm
+++ b/src/modules/Stats.jsm
@@ -232,8 +232,16 @@ function sendRPPreferences() {
 
 function sendBrowserPreferences() {
   try {
+    function getLocalePref() {
+      try {
+        return rp._rootPrefs.getComplexValue('general.useragent.locale',
+            Components.interfaces.nsIPrefLocalizedString).data;
+      } catch (e) {
+        return rp._rootPrefs.getCharPref('general.useragent.locale');
+      }
+    }
     var browserPrefs = {
-      'general_useragent_locale': rp._rootPrefs.getCharPref('general.useragent.locale'),
+      'general_useragent_locale': getLocalePref(),
       'privacy_donottrackheader_enabled': rp._rootPrefs.getBoolPref('privacy.donottrackheader.enabled'),
       'places_history_enabled': rp._rootPrefs.getBoolPref('places.history.enabled'),
       'browser_privatebrowsing_autostart': rp._rootPrefs.getBoolPref('browser.privatebrowsing.autostart'),

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git



More information about the Pkg-mozext-commits mailing list