[Pkg-mozext-commits] [tabmixplus] 32/56: Use AppConstants.jsm, from Firefox 39, to get the platform

David Prévot taffit at moszumanska.debian.org
Mon Jun 6 00:02:35 UTC 2016


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit c4702739e0dcd19d89e92464534ff07714b0f582
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sat May 14 12:56:23 2016 +0300

    Use AppConstants.jsm, from Firefox 39, to get the platform
---
 modules/Services.jsm | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/modules/Services.jsm b/modules/Services.jsm
index 205df7f..7896a01 100644
--- a/modules/Services.jsm
+++ b/modules/Services.jsm
@@ -290,12 +290,32 @@ XPCOMUtils.defineLazyGetter(TabmixSvc, "SMstrings", function() {
   return Services.strings.createBundle(properties);
 });
 
+XPCOMUtils.defineLazyGetter(this, "Platform", function() {
+  if (isVersion(390)) {
+    return (Cu.import("resource://gre/modules/AppConstants.jsm", {})).AppConstants.platform;
+  }
+  let platform,
+      os = Services.appinfo.OS.toLowerCase();
+  if (os.startsWith("win")) {
+    platform = "win";
+  } else if (os == "darwin") {
+    platform = "macosx";
+  } else if (os == "linux") {
+    platform = "linux";
+  }
+  return platform;
+});
+
+XPCOMUtils.defineLazyGetter(TabmixSvc, "isWindows", function() {
+  return Platform == "win";
+});
+
 XPCOMUtils.defineLazyGetter(TabmixSvc, "isMac", function() {
-  return Services.appinfo.OS == "Darwin";
+  return Platform == "macosx";
 });
 
 XPCOMUtils.defineLazyGetter(TabmixSvc, "isLinux", function() {
-  return Services.appinfo.OS == "Linux";
+  return Platform == "linux";
 });
 
 XPCOMUtils.defineLazyGetter(TabmixSvc, "isCyberfox", function() {

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



More information about the Pkg-mozext-commits mailing list