Closed
Bug 828746
Opened 12 years ago
Closed 12 years ago
(private-browsing) Add a isPrivate method to the private-browsing module
Categories
(Add-on SDK Graveyard :: General, defect, P2)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
FIXED
1.14
People
(Reporter: evold, Assigned: evold)
References
Details
Attachments
(1 file)
I'm starting to think that it would be good to have a universal method that can check input to see if it is in private mode or not, at first it would only take windows and tabs, but it could take other this later like a page-mod instance.
This way we don't need to add a `isPrivateBrowsing` flag to everything.
Assignee | ||
Comment 1•12 years ago
|
||
other things* later
Priority: -- → P2
Comment 2•12 years ago
|
||
Erik it's not very clear to me what do you mean, could you please draw out what the API looks like ?
Assignee | ||
Comment 3•12 years ago
|
||
Basically require("private-browsing").isPrivate(aObject) would return true if aObject is a object from the sdk that is associated to a private window. So if aObject is a tab then true is returned if the tab is in a private window. Also a page-mod instance could be passed to see if the page-mod instance is part of a private window.
Comment 4•12 years ago
|
||
Yeap that sounds perfect!
Assignee | ||
Comment 5•12 years ago
|
||
Pointer to Github pull-request
Assignee | ||
Updated•12 years ago
|
Attachment #705132 -
Flags: review?(rFobic)
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → evold
Assignee | ||
Updated•12 years ago
|
Target Milestone: --- → 1.14
Additionally, I am trying to support addons that cross the 19/20 barrier. It would be also nice to have a way of checking 'per-window-private mode is supported' other than version number.
Fantasy code:
const pb = require("private-browsing");
if (pb.perwindowsupported){
// modern code
} else {
// old 19- code
}
Assignee | ||
Comment 7•12 years ago
|
||
(In reply to Gregg Lind (User Research - Test Pilot) from comment #6)
> Additionally, I am trying to support addons that cross the 19/20 barrier.
> It would be also nice to have a way of checking 'per-window-private mode is
> supported' other than version number.
>
> Fantasy code:
>
> const pb = require("private-browsing");
> if (pb.perwindowsupported){
> // modern code
> } else {
> // old 19- code
> }
In bug 809180 we added require('sdk/private-browsing/utils').isWindowPBSupported
https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/private-browsing/utils.js#L57
Also added isGlobalPBSupported in that bug.
Assignee | ||
Comment 8•12 years ago
|
||
Best to review bug 820582 first Irakli.
Comment 9•12 years ago
|
||
Comment on attachment 705132 [details]
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/736
I have already r+ superset of this in some other bug, please just make sure to see the comments I made there before landing.
Attachment #705132 -
Flags: review?(rFobic) → review+
Assignee | ||
Updated•12 years ago
|
Blocks: sdk-pwpb-fx21
Comment 10•12 years ago
|
||
Commits pushed to master at https://github.com/mozilla/addon-sdk
https://github.com/mozilla/addon-sdk/commit/413f49ea44b7be97c3ffc3e1aacecdd0c67550b4
Fix Bug 828746 adding a isPrivate method to the private-browsing module
https://github.com/mozilla/addon-sdk/commit/718ccfdfe73a73b80085b58a354ee8a9393361b1
Bug 828746: adding getOwnerWindow.implement to get associated windows for object instances, isPrivate() works in global private browsing mode, md updates for the docs, renaming the module that defines getOwnerWindow for pb context
https://github.com/mozilla/addon-sdk/commit/3c2d1393370a5fc01b4d5e4135ba7c779b7f9d82
bug 828746: testing require("sdk/private-browsing/window/utils").getOwnerWIndow, and adding isPrivate support for Fennec, though this still always returns false at the moment
https://github.com/mozilla/addon-sdk/commit/cb78862ebafc44981df13b744a505309521ffc55
bug 828746 address review comment, moving require statement to the top of the file
https://github.com/mozilla/addon-sdk/commit/d7cbd9c622890a954b9c232e37907c618c068e6d
Merge pull request #736 from erikvold/828746
Fix Bug 828746 add isPrivate method to private-browsing module r=@gozala
Updated•12 years ago
|
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 11•12 years ago
|
||
Commit pushed to stabilization at https://github.com/mozilla/addon-sdk
https://github.com/mozilla/addon-sdk/commit/34dc07610586f087a3966a3ebceecfd68242b05d
Merge pull request #736 from erikvold/828746
Fix Bug 828746 add isPrivate method to private-browsing module r=@gozala
Conflicts:
test/private-browsing/windows.js
test/test-private-browsing.js
You need to log in
before you can comment on or make changes to this bug.
Description
•