Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Avoid hiding and keeping track of private windows #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/chrome/content/overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,29 @@ var firetrayChrome = { // each new window gets a new firetrayChrome !
winId: null,

onLoad: function(win) {
try {
// Firefox 20+
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Components.utils aliased to Cu

if (PrivateBrowsingUtils.isWindowPrivate(window)) {
firetray_log.debug("Private window detected skipping");
return true;
}
} catch(e) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: make indentation consistent with surrounding code (} same level as try)

// pre Firefox 20 (if you do not have access to a doc.
// might use doc.hasAttribute("privatebrowsingmode") then instead)
try {
var inPrivateBrowsing = Components.classes["@mozilla.org/privatebrowsing;1"].
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Components.classes aliased to Cc

getService(Components.interfaces.nsIPrivateBrowsingService).
privateBrowsingEnabled;
if (inPrivateBrowsing) {
firetray_log.debug("Private window detected skipping");
return true;
}
} catch(e) {
Components.utils.reportError(e);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Components.utils aliased to Cu

return;
}
}
this.strings = document.getElementById("firetray-strings"); // chrome-specific

firetray_log.debug("Handler initialized: "+firetray.Handler.initialized);
Expand Down