Provide some feature detection for private browsing implementations

RESOLVED FIXED

Status

Add-on SDK
General
P1
normal
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: canuckistani, Assigned: erikvold)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

We're going to have an awkward growing phase between Firefox 19 & 20 where private browsing features are implemented quite differently. Seeing as we will be continuing to implement activate and deactivate as no-ops that emit deprecation warnings for the forseeable future, we should consider implementing a flag that developers can access that indicates if PWPB is implemented in the current runtime.

Strawman:

var hasPWPB = require('private-browsing').hasPerWindowPrivateBrowsing || false;

This property could be a getter that sniffs the current Firefox version.

Thanks to :wenzel for the idea:

https://blog.mozilla.org/addons/2012/11/05/sdk-private-browsing-api-deprecation/comment-page-1/#comment-160596
Assignee: nobody → evold
I don't think pwpb will be the final iteration, so perhaps a getPBType method would make more sense?
Priority: -- → P1
Blocks: 748604
If you're interested in detecting this in the code programatically, you can check for the existence of nsIPrivateBrowsingService.  We will soon remove it in bug 818800.
Depends on: 825338
https://github.com/mozilla/addon-sdk/commit/6a1aacd6b34ec8cfce1fe2875de45279c8254b54
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.