Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #878 from KWierso/843823
Browse files Browse the repository at this point in the history
Fix bug 843823 - Document last-pb-context-exited event in private browsing module r=@erikvold
  • Loading branch information
erikvold committed Mar 20, 2013
2 parents 73fca07 + f1febfb commit 1cbc1de
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions doc/module-source/sdk/private-browsing.md
Expand Up @@ -126,6 +126,24 @@ event, it passes the worker into `isPrivate()`:
onAttach: logPublicPageContent
});

## Tracking private-browsing exit ##

Sometimes it can be useful to cache some data from private windows while they
are open, as long as you don't store it after the private browsing windows
have been closed. For example, the "Downloads" window might want to display
all downloads while there are still some private windows open, then clean out
all the private data when all private windows have closed.

To do this with the SDK, you can listen to the system event named
"last-pb-context-exited":

var events = require("sdk/system/events");

function listener(event) {
console.log("last private window closed");
}

events.on("last-pb-context-exited", listener);

## Working with Firefox 19 ##

Expand Down

0 comments on commit 1cbc1de

Please sign in to comment.