The `private-browsing` module allows you to access Firefox's private browsing
mode, detecting if it is active and when its state changes.
This module is available in all applications. However, only Firefox will ever
transition into or out of private browsing mode. For all other applications,
`pb.isActive` will always be `false`, and none of the events will be emitted.
The
activate
and
deactivate
functions,
isActive
property,
start,
and
stop
events are all
now deprecated due to per-window private browsing. They will continue to work
until version 1.13 of the SDK. From version 1.13 onwards they will still exist
but will have no effect when called.
@property {boolean}
This read-only boolean is `true` if global private browsing mode is turned on.
This property is deprecated. It will continue to work until version 1.13 of the SDK.
From version 1.13 onwards it will always return `false`.
@function
Returns `true` if the argument is a private window or tab.
@param [thing] {any}
The thing to check if it is private, only handles windows and tabs at the moment.
Everything else returns `false` automatically.
In global private browsing mode, this method returns the same value as `isActive`.
@function
Turns on global private browsing mode.
This function is deprecated. It will continue to work until version 1.13 of the SDK.
From version 1.13 onwards it will still exist but will have no effect when called.
@function
Turns off global private browsing mode.
This function is deprecated. It will continue to work until version 1.13 of the SDK.
From version 1.13 onwards it will still exist but will have no effect when called.
@event
Emitted immediately after global private browsing begins.
var pb = require("sdk/private-browsing");
pb.on("start", function() {
// Do something when the browser starts private browsing mode.
});
This event is deprecated. It will continue to work until version 1.13 of the SDK.
From version 1.13 onwards this event will not be emitted.
@event
Emitted immediately after global private browsing ends.
var pb = require("sdk/private-browsing");
pb.on("stop", function() {
// Do something when the browser stops private browsing mode.
});
This event is deprecated. It will continue to work until version 1.13 of the SDK.
From version 1.13 onwards this event will not be emitted.