[Pkg-mozext-commits] [requestpolicy] 250/257: [ref] "private browsing mode" no longer supported

David Prévot taffit at moszumanska.debian.org
Thu Jan 28 03:20:19 UTC 2016


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

taffit pushed a commit to branch master
in repository requestpolicy.

commit d75b2cef2ddc500dd7133c31ac7a701b6c260d50
Author: Martin Kimmerle <dev at 256k.de>
Date:   Sat Jan 2 17:55:49 2016 +0100

    [ref] "private browsing mode" no longer supported
---
 src/content/lib/utils/windows.jsm | 35 ++++++-----------------------------
 1 file changed, 6 insertions(+), 29 deletions(-)

diff --git a/src/content/lib/utils/windows.jsm b/src/content/lib/utils/windows.jsm
index 79fce97..b5d5c9f 100644
--- a/src/content/lib/utils/windows.jsm
+++ b/src/content/lib/utils/windows.jsm
@@ -27,6 +27,9 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 /* exported WindowUtils */
 this.EXPORTED_SYMBOLS = ["WindowUtils"];
 
+let {PrivateBrowsingUtils} = Cu.import(
+    "resource://gre/modules/PrivateBrowsingUtils.jsm", {});
+
 let {ScriptLoader: {importModule}} = Cu.import(
     "chrome://rpcontinued/content/lib/script-loader.jsm", {});
 let {Prefs} = importModule("models/prefs");
@@ -87,35 +90,9 @@ var WindowUtils = (function() {
   // Private Browsing
   //
 
-  // depending on the Firefox vesion, create the `isWindowPrivate` function
-  self.isWindowPrivate = (function() {
-    try {
-      // Firefox 20+
-      let {PrivateBrowsingUtils} = Cu.import("resource://gre/modules/" +
-                                             "PrivateBrowsingUtils.jsm", {});
-
-      return function(aWindow) {
-        return PrivateBrowsingUtils.isWindowPrivate(aWindow);
-      };
-    } catch (e) {
-      // pre Firefox 20
-      try {
-        let pbs = Cc["@mozilla.org/privatebrowsing;1"]
-            .getService(Ci.nsIPrivateBrowsingService);
-
-        return function(aWindow) {
-          return pbs.privateBrowsingEnabled;
-        };
-      } catch (e) {
-        Components.utils.reportError(e);
-        // It's uncertain if private browsing is possible at all, so assume
-        // that Private Browsing is not possible.
-        return function(aWindow) {
-          return true;
-        };
-      }
-    }
-  }());
+  self.isWindowPrivate = function(aWindow) {
+    return PrivateBrowsingUtils.isWindowPrivate(aWindow);
+  };
 
   /**
    * Should it be possible to add permanent rules in that window?

-- 
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