Permalink
Browse files

Workaround to Bug 845063: Detect whether nsIPrivateBrowsingService is…

… present.
  • Loading branch information...
littlebtc committed Apr 18, 2013
1 parent 6c61b3d commit b32b57189d7935533d9c05c0cc906233616909fa
Showing with 6 additions and 3 deletions.
  1. +6 −3 modules/DownloadManager.jsm
@@ -443,9 +443,12 @@ DownloadManager.startup = function() {
prefObserver.register();
/* Private Browsing checking XXX: 1.9.1b2- compatibility */
- var privateSvc = Cc["@mozilla.org/privatebrowsing;1"].getService(Ci.nsIPrivateBrowsingService);
- inPrivateBrowsing = privateSvc.privateBrowsingEnabled;
-
+ if (Ci.nsIPrivateBrowsingService) {
+ var privateSvc = Cc["@mozilla.org/privatebrowsing;1"].getService(Ci.nsIPrivateBrowsingService);
+ inPrivateBrowsing = privateSvc.privateBrowsingEnabled;
+ } else {
+ inPrivateBrowsing = false;
+ }
/* Read the preference */
downloadMax = Core.prefs.getIntPref("download_max");

0 comments on commit b32b571

Please sign in to comment.