Last Comment Bug 809180 - Provide some feature detection for private browsing implementations
: Provide some feature detection for private browsing implementations
Status: RESOLVED FIXED
:
Product: Add-on SDK
Classification: Client Software
Component: General (show other bugs)
: unspecified
: x86 Mac OS X
: P1 normal (vote)
: ---
Assigned To: Erik Vold [:erikvold] (please needinfo? me)
:
Mentors:
Depends on: 825338
Blocks: sdk-pwpb
  Show dependency treegraph
 
Reported: 2012-11-06 12:40 PST by Jeff Griffiths (:canuckistani) (:⚡︎)
Modified: 2013-01-23 13:31 PST (History)
8 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Jeff Griffiths (:canuckistani) (:⚡︎) 2012-11-06 12:40:30 PST
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
Comment 1 Erik Vold [:erikvold] (please needinfo? me) 2012-11-11 06:35:32 PST
I don't think pwpb will be the final iteration, so perhaps a getPBType method would make more sense?
Comment 2 :Ehsan Akhgari 2012-12-13 14:05:49 PST
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.
Comment 3 Erik Vold [:erikvold] (please needinfo? me) 2013-01-23 13:31:47 PST
https://github.com/mozilla/addon-sdk/commit/6a1aacd6b34ec8cfce1fe2875de45279c8254b54

Note You need to log in before you can comment on or make changes to this bug.