Closed
Bug 748604
(sdk-pwpb)
Opened 14 years ago
Closed 9 years ago
Modify Add-on SDK to work with per-window private browsing
Categories
(Add-on SDK Graveyard :: General, defect)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
1.15
People
(Reporter: jdm, Unassigned)
References
Details
(Whiteboard: [please read comment 52])
I see some add-ons using the private-browsing module, and judging from the docs at https://addons.mozilla.org/en-US/developers/docs/sdk/1.5/packages/addon-kit/docs/private-browsing.html there will need to be some changes in how this is implemented.
Assignee: nobody → dtownsend+bugmail
Whiteboard: [triage:followup]
Comment 1•14 years ago
|
||
Apparently the platform pieces around per-window private browsing should be done in a couple of months at most
Assignee: dtownsend+bugmail → nobody
P1, but we might need to know more about how it's going to be implemented in the platform before we start working on this.
We should also probably add a deprecation warning to the global private browsing module.
Priority: -- → P1
Whiteboard: [triage:followup]
| Reporter | ||
Comment 3•14 years ago
|
||
The privacy information is stored on nsILoadContext (usePrivateBrowsing), which you can QI from any docshell (the privacy information is inherited from a docshell's parent docshell). There is also a privateWindow getter on gPrivateBrowsingUI which is attached to every browser object.
Depends on: 723353
Comment 4•14 years ago
|
||
Has anybody been working on this? Chris Lord is now going to work on the remaining pieces, so there is even a slight chance that this makes it into Firefox 16!
Dave, should we get someone on this sooner than later? I really doubt it'll land completely in the next few days, but Fx17 seems likely.
Comment 6•14 years ago
|
||
(In reply to comment #5)
> Dave, should we get someone on this sooner than later? I really doubt it'll
> land completely in the next few days, but Fx17 seems likely.
Yeah, we're getting really close, and we need a solution to this bug as soon as possible! Please ping me if I can help move this forward.
Comment 7•14 years ago
|
||
Ugh sorry somehow I didn't see comment 4 till now. I'll bring it up at the SDK meeting tomorrow and we'll see if we can find someone to take it.
Updated•14 years ago
|
Assignee: nobody → evold
OS: Mac OS X → All
Hardware: x86 → All
Comment 8•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #4)
Hey Eshan, I've started working on this, but I have a question for you.
The code in https://hg.mozilla.org/mozilla-central/rev/36586538ef3b has a comment that says:
> For now the getter returns nsIPrivateBrowsingService.privateBrowsingEnabled,
> and the setter should only be used in tests.
So I'm it looks like I should simply add a boolean property to your public Window objects
https://addons.mozilla.org/en-US/developers/docs/sdk/latest/packages/addon-kit/windows.html
Then at some point we can implement the setter too?
Status: NEW → ASSIGNED
Comment 9•14 years ago
|
||
oops Ehsan, got your name wrong sorry about that.
Comment 10•14 years ago
|
||
(In reply to Erik Vold from comment #8)
> (In reply to Ehsan Akhgari [:ehsan] from comment #4)
>
> Hey Eshan, I've started working on this, but I have a question for you.
>
> The code in https://hg.mozilla.org/mozilla-central/rev/36586538ef3b has a
> comment that says:
>
> > For now the getter returns nsIPrivateBrowsingService.privateBrowsingEnabled,
> > and the setter should only be used in tests.
>
> So I'm it looks like I should simply add a boolean property to your public
> Window objects
>
> https://addons.mozilla.org/en-US/developers/docs/sdk/latest/packages/addon-
> kit/windows.html
>
> Then at some point we can implement the setter too?
I'm not quite sure how the setter API works yet. My initial thinking was that we'd have a setter property on browser window objects, but that would probably not work great since we can only access that property once the window has loaded, which might be late to set it. So I've been thinking about specifying a parameter right at the time of opening a browser window. Josh may also have some ideas here.
Adding a readonly boolean property to the window object in the SDK makes sense to me, though.
Perhaps we need to file another bug for determining what the API to put a window in private browsing should look like in the SDK once we've figured out how we want to do that in the browser front-end.
Out of curiosity, how does the API for opening a new browser window look like in the SDK?
Also, I think that we'd want to remove the global private-browsing API from the SDK once we switch the Firefox side, since there is no sane way of making that work as far as I can tell. Do you have a deprecation process for SDK APIs?
(In reply to Ehsan Akhgari [:ehsan] from comment #10)
> Out of curiosity, how does the API for opening a new browser window look
> like in the SDK?
https://addons.mozilla.org/en-US/developers/docs/sdk/latest/packages/addon-kit/windows.html#open%28options%29
So you could do it like this: require("windows").browserWindows.open(someURL)
Or like this:
require("windows").browserWindows.open({ url:someURL, onOpen: someFunction});
It'd probably be pretty easy to add a "isPrivate" property to that second version.
> Also, I think that we'd want to remove the global private-browsing API from
> the SDK once we switch the Firefox side, since there is no sane way of
> making that work as far as I can tell. Do you have a deprecation process
> for SDK APIs?
We usually like to give a release or two (6-12 weeks) with a deprecation warning for the old version once the replacement lands, though that might be interesting, here. Each SDK version explicitly supports two versions of Firefox (1.8 shipped three weeks ago supporting 13 and 14. 1.9 ships three weeks from now and will support 14 and 15.) So at least one SDK release will explicitly be supporting both 16 (with the global version) and 17 (with the new version).
I think Alex has a list of all AMO-hosted addons that use the private-browsing module, and there were about 25 of them. I think we'll need to reach out to them to give them a heads up that the old module is probably going away. (Maybe have the global version return that it's in private browsing mode as long as one window actually is and have the activate/deactivate() methods iterate through all open windows, so as not to completely break things?)
Comment 12•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #10)
>
> Also, I think that we'd want to remove the global private-browsing API from
> the SDK once we switch the Firefox side, since there is no sane way of
> making that work as far as I can tell. Do you have a deprecation process
> for SDK APIs?
Why would the global private browsing feature be eliminated? it seems to me that would cause an uproar.
I can see why users might want to opt-in to per-window private browsing though.
Comment 13•14 years ago
|
||
(In reply to comment #11)
> (In reply to Ehsan Akhgari [:ehsan] from comment #10)
> > Out of curiosity, how does the API for opening a new browser window look
> > like in the SDK?
> https://addons.mozilla.org/en-US/developers/docs/sdk/latest/packages/addon-kit/windows.html#open%28options%29
> So you could do it like this: require("windows").browserWindows.open(someURL)
> Or like this:
> require("windows").browserWindows.open({ url:someURL, onOpen: someFunction});
>
> It'd probably be pretty easy to add a "isPrivate" property to that second
> version.
That probably makes sense.
> > Also, I think that we'd want to remove the global private-browsing API from
> > the SDK once we switch the Firefox side, since there is no sane way of
> > making that work as far as I can tell. Do you have a deprecation process
> > for SDK APIs?
>
> We usually like to give a release or two (6-12 weeks) with a deprecation
> warning for the old version once the replacement lands, though that might be
> interesting, here. Each SDK version explicitly supports two versions of Firefox
> (1.8 shipped three weeks ago supporting 13 and 14. 1.9 ships three weeks from
> now and will support 14 and 15.) So at least one SDK release will explicitly be
> supporting both 16 (with the global version) and 17 (with the new version).
Ouch. Then we should definitely deprecate the global API in the next release...
> I think Alex has a list of all AMO-hosted addons that use the private-browsing
> module, and there were about 25 of them. I think we'll need to reach out to
> them to give them a heads up that the old module is probably going away.
That makes a lot of sense.
> (Maybe
> have the global version return that it's in private browsing mode as long as
> one window actually is and have the activate/deactivate() methods iterate
> through all open windows, so as not to completely break things?)
We will not remove the existing service until the switch happens on mozilla-central. And the current module should continue to work. But in the mean time, the privateWindow getter should work correctly in the mean time.
Comment 14•14 years ago
|
||
(In reply to comment #12)
> (In reply to Ehsan Akhgari [:ehsan] from comment #10)
> >
> > Also, I think that we'd want to remove the global private-browsing API from
> > the SDK once we switch the Firefox side, since there is no sane way of
> > making that work as far as I can tell. Do you have a deprecation process
> > for SDK APIs?
>
> Why would the global private browsing feature be eliminated? it seems to me
> that would cause an uproar.
>
> I can see why users might want to opt-in to per-window private browsing though.
Well, when we fully implement per-window PB, having a global service doesn't make sense any more, as we will not have a global PB mode any more, right?
Comment 15•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #14)
> (In reply to comment #12)
> > (In reply to Ehsan Akhgari [:ehsan] from comment #10)
> > >
> > > Also, I think that we'd want to remove the global private-browsing API from
> > > the SDK once we switch the Firefox side, since there is no sane way of
> > > making that work as far as I can tell. Do you have a deprecation process
> > > for SDK APIs?
> >
> > Why would the global private browsing feature be eliminated? it seems to me
> > that would cause an uproar.
> >
> > I can see why users might want to opt-in to per-window private browsing though.
>
> Well, when we fully implement per-window PB, having a global service doesn't
> make sense any more, as we will not have a global PB mode any more, right?
I don't follow.
I think that private browsing should provide the options of:
* global private browsing for those that want it
* then the user can disable it and go to per-window private browsing
* or totally non-private browsing.
Comment 16•14 years ago
|
||
(In reply to comment #15)
> (In reply to Ehsan Akhgari [:ehsan] from comment #14)
> > (In reply to comment #12)
> > > (In reply to Ehsan Akhgari [:ehsan] from comment #10)
> > > >
> > > > Also, I think that we'd want to remove the global private-browsing API from
> > > > the SDK once we switch the Firefox side, since there is no sane way of
> > > > making that work as far as I can tell. Do you have a deprecation process
> > > > for SDK APIs?
> > >
> > > Why would the global private browsing feature be eliminated? it seems to me
> > > that would cause an uproar.
> > >
> > > I can see why users might want to opt-in to per-window private browsing though.
> >
> > Well, when we fully implement per-window PB, having a global service doesn't
> > make sense any more, as we will not have a global PB mode any more, right?
>
> I don't follow.
>
> I think that private browsing should provide the options of:
> * global private browsing for those that want it
> * then the user can disable it and go to per-window private browsing
> * or totally non-private browsing.
No, this is not something that we'd like to support.
The only reason that we made PB application wide initially was that we didn't know of a good way of making it per-window, and also that it was a large project and we wanted to get it shipped as soon as we could. Now that we have thought of a good way (hanging the flag off of the docshell), there is no need to support both the global and per-window PB modes in parallel. I would argue that if you have the ability to open a window in PB mode, nobody would want a global mode any more.
As a totally anecdotal data point, we have had a lot of people complaining to us that closing off all of the open tabs and windows and restoring them when switching the PB mode is not intuitive (and I totally agree with them) but nobody has ever thanked us for choosing the global approach compared to how all other browsers do this. :-)
Comment 17•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #16)
> (In reply to comment #15)
> > (In reply to Ehsan Akhgari [:ehsan] from comment #14)
> > > (In reply to comment #12)
> > > > (In reply to Ehsan Akhgari [:ehsan] from comment #10)
> > > > >
> > > > > Also, I think that we'd want to remove the global private-browsing API from
> > > > > the SDK once we switch the Firefox side, since there is no sane way of
> > > > > making that work as far as I can tell. Do you have a deprecation process
> > > > > for SDK APIs?
> > > >
> > > > Why would the global private browsing feature be eliminated? it seems to me
> > > > that would cause an uproar.
> > > >
> > > > I can see why users might want to opt-in to per-window private browsing though.
> > >
> > > Well, when we fully implement per-window PB, having a global service doesn't
> > > make sense any more, as we will not have a global PB mode any more, right?
> >
> > I don't follow.
> >
> > I think that private browsing should provide the options of:
> > * global private browsing for those that want it
> > * then the user can disable it and go to per-window private browsing
> > * or totally non-private browsing.
>
> No, this is not something that we'd like to support.
>
> The only reason that we made PB application wide initially was that we
> didn't know of a good way of making it per-window, and also that it was a
> large project and we wanted to get it shipped as soon as we could. Now that
> we have thought of a good way (hanging the flag off of the docshell), there
> is no need to support both the global and per-window PB modes in parallel.
> I would argue that if you have the ability to open a window in PB mode,
> nobody would want a global mode any more.
>
> As a totally anecdotal data point, we have had a lot of people complaining
> to us that closing off all of the open tabs and windows and restoring them
> when switching the PB mode is not intuitive (and I totally agree with them)
> but nobody has ever thanked us for choosing the global approach compared to
> how all other browsers do this. :-)
Well as a user, I'm not going to like the per-window private browsing mode. I think most users would voice criticism instead of thanks. They thank us by using the product.
I'll code the jetpack api according to what you decide though..
Comment 18•14 years ago
|
||
(In reply to comment #17)
> Well as a user, I'm not going to like the per-window private browsing mode. I
> think most users would voice criticism instead of thanks. They thank us by
> using the product.
Sure. But people would object to pretty much any change... I'm not convinced that there is value in us supporting both modes.
Note that it will definitely be possible for an add-on to use the per-window API to implement a global PB mode on top of that. But I don't think we want to support that in the core product.
> I'll code the jetpack api according to what you decide though..
Thanks! :-)
Comment 19•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #18)
>
> Note that it will definitely be possible for an add-on to use the per-window
> API to implement a global PB mode on top of that. But I don't think we want
> to support that in the core product.
Yeah I was just thinking this. Our Jetpack api can possibly implement the api that nsIPrivateBrowsingService used to, making it trivial for an add-on to re-implement the related ui that will be destroyed.
In which case Jetpack can keep it's promise to add-on devs.
Comment 20•14 years ago
|
||
(In reply to comment #19)
> (In reply to Ehsan Akhgari [:ehsan] from comment #18)
> >
> > Note that it will definitely be possible for an add-on to use the per-window
> > API to implement a global PB mode on top of that. But I don't think we want
> > to support that in the core product.
>
> Yeah I was just thinking this. Our Jetpack api can possibly implement the api
> that nsIPrivateBrowsingService used to, making it trivial for an add-on to
> re-implement the related ui that will be destroyed.
>
> In which case Jetpack can keep it's promise to add-on devs.
No, that would hurt all of the users who have SDK based add-ons. We should absolutely not do this in Jetpack. If someone wants to write an *add-on* which does this, then that's perfectly fine!
Comment 21•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #20)
>
> No, that would hurt all of the users who have SDK based add-ons. We should
> absolutely not do this in Jetpack. If someone wants to write an *add-on*
> which does this, then that's perfectly fine!
I don't understand your reasoning, can you please provide it.
Comment 22•14 years ago
|
||
(In reply to Erik Vold from comment #21)
> (In reply to Ehsan Akhgari [:ehsan] from comment #20)
> >
> > No, that would hurt all of the users who have SDK based add-ons. We should
> > absolutely not do this in Jetpack. If someone wants to write an *add-on*
> > which does this, then that's perfectly fine!
>
> I don't understand your reasoning, can you please provide it.
I think the reasoning is that that service relies on 'private browsing' being a global state, where as we want to have per-window private browsing. If Jetpack implements that API, it would mean that anyone using a Jetpack add-on would have to sacrifice per-window private browsing (and that we would have to create and maintain two separate UIs for this, I guess?)
Comment 23•14 years ago
|
||
(In reply to Chris Lord [:cwiiis] from comment #22)
> (In reply to Erik Vold from comment #21)
> > (In reply to Ehsan Akhgari [:ehsan] from comment #20)
> > >
> > > No, that would hurt all of the users who have SDK based add-ons. We should
> > > absolutely not do this in Jetpack. If someone wants to write an *add-on*
> > > which does this, then that's perfectly fine!
> >
> > I don't understand your reasoning, can you please provide it.
>
> I think the reasoning is that that service relies on 'private browsing'
> being a global state, where as we want to have per-window private browsing.
> If Jetpack implements that API, it would mean that anyone using a Jetpack
> add-on would have to sacrifice per-window private browsing (and that we
> would have to create and maintain two separate UIs for this, I guess?)
I don't think that is the case. What it does mean is that any users using old add-ons that manipulate the private browsing state would turn it on globally for all windows. I wonder how many that actually is though.
Comment 24•14 years ago
|
||
(In reply to comment #22)
> (In reply to Erik Vold from comment #21)
> > (In reply to Ehsan Akhgari [:ehsan] from comment #20)
> > >
> > > No, that would hurt all of the users who have SDK based add-ons. We should
> > > absolutely not do this in Jetpack. If someone wants to write an *add-on*
> > > which does this, then that's perfectly fine!
> >
> > I don't understand your reasoning, can you please provide it.
>
> I think the reasoning is that that service relies on 'private browsing' being a
> global state, where as we want to have per-window private browsing. If Jetpack
> implements that API, it would mean that anyone using a Jetpack add-on would
> have to sacrifice per-window private browsing (and that we would have to create
> and maintain two separate UIs for this, I guess?)
Precisely.
Comment 25•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #24)
> (In reply to comment #22)
> > (In reply to Erik Vold from comment #21)
> > > (In reply to Ehsan Akhgari [:ehsan] from comment #20)
> > > >
> > > > No, that would hurt all of the users who have SDK based add-ons. We should
> > > > absolutely not do this in Jetpack. If someone wants to write an *add-on*
> > > > which does this, then that's perfectly fine!
> > >
> > > I don't understand your reasoning, can you please provide it.
> >
> > I think the reasoning is that that service relies on 'private browsing' being a
> > global state, where as we want to have per-window private browsing. If Jetpack
> > implements that API, it would mean that anyone using a Jetpack add-on would
> > have to sacrifice per-window private browsing (and that we would have to create
> > and maintain two separate UIs for this, I guess?)
>
> Precisely.
Ok, I wasn't clear then. I am not suggesting that per-window PB should be sacrificed. We will support per-window PB.
I am suggesting that the old api for global private browsing remain intact though.
Comment 26•14 years ago
|
||
As far as I can tell, there are two add-ons on AMO that use the SDK's function to activate private browsing, and one of them is written by a Mozilla employee ;)
https://addons.mozilla.org/en-US/firefox/addon/privateswitch/
https://addons.mozilla.org/en-US/firefox/addon/open-private-browsing/
Comment 27•14 years ago
|
||
(In reply to comment #25)
> I am suggesting that the old api for global private browsing remain intact
> though.
How are you planning to keep them intact?
Comment 28•14 years ago
|
||
(In reply to comment #26)
> As far as I can tell, there are two add-ons on AMO that use the SDK's function
> to activate private browsing, and one of them is written by a Mozilla employee
> ;)
>
> https://addons.mozilla.org/en-US/firefox/addon/privateswitch/
> https://addons.mozilla.org/en-US/firefox/addon/open-private-browsing/
Hehe good point. Also, it seems like both of these add-ons need to change their UX for per-window PB anyways.
Comment 29•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #27)
> (In reply to comment #25)
> > I am suggesting that the old api for global private browsing remain intact
> > though.
>
> How are you planning to keep them intact?
If we were to remove the old api, then we would not be able to auto-update those add-ons, and we would need to contact the devs to make changes. If we do not remove the old api, then we would need to re-review those add-ons before auto-updating to make sure they are ol to auto-update, and if they are not then we would not auto-update and contact them.
Comment 30•14 years ago
|
||
(In reply to comment #29)
> (In reply to Ehsan Akhgari [:ehsan] from comment #27)
> > (In reply to comment #25)
> > > I am suggesting that the old api for global private browsing remain intact
> > > though.
> >
> > How are you planning to keep them intact?
>
> If we were to remove the old api, then we would not be able to auto-update
> those add-ons, and we would need to contact the devs to make changes. If we do
> not remove the old api, then we would need to re-review those add-ons before
> auto-updating to make sure they are ol to auto-update, and if they are not then
> we would not auto-update and contact them.
Well, seems like there aren't too many authors to contact.. But still that doesn't answer my question. How do you plan to keep the API intact?
Comment 31•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #27)
> (In reply to comment #25)
> > I am suggesting that the old api for global private browsing remain intact
> > though.
>
> How are you planning to keep them intact?
isActive: would return true if all open windows have PB enabled, false otherwise
activate: activates PB for all open windows and windows that will open (if need be)
deactivate: deactivates PB for all open windows
Comment 32•14 years ago
|
||
(In reply to comment #31)
> (In reply to Ehsan Akhgari [:ehsan] from comment #27)
> > (In reply to comment #25)
> > > I am suggesting that the old api for global private browsing remain intact
> > > though.
> >
> > How are you planning to keep them intact?
>
> isActive: would return true if all open windows have PB enabled, false
> otherwise
That would be misleading at best. That means that if you open a PB window and close all of your other windows, the behavior of the add-on suddenly changes.
> activate: activates PB for all open windows and windows that will open (if need
> be)
> deactivate: deactivates PB for all open windows
These would be unacceptable, since they would basically subvert the entire UI that Firefox will have for per-window PB.
Comment 33•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #32)
> (In reply to comment #31)
> > (In reply to Ehsan Akhgari [:ehsan] from comment #27)
> > > (In reply to comment #25)
> > > > I am suggesting that the old api for global private browsing remain intact
> > > > though.
> > >
> > > How are you planning to keep them intact?
> >
> > isActive: would return true if all open windows have PB enabled, false
> > otherwise
> That would be misleading at best. That means that if you open a PB window
> and close all of your other windows, the behavior of the add-on suddenly
> changes.
I forgot to mention the PB events, there would be an PB "stop" event fired, as currently exists.
> > activate: activates PB for all open windows and windows that will open (if need
> > be)
> > deactivate: deactivates PB for all open windows
>
> These would be unacceptable, since they would basically subvert the entire
> UI that Firefox will have for per-window PB.
I don't see how the UI matters.
Comment 34•14 years ago
|
||
Here is a list of the add-ons using the sdk's PB module: http://pastebin.mozilla.org/1707450
Comment 35•14 years ago
|
||
(In reply to comment #33)
> (In reply to Ehsan Akhgari [:ehsan] from comment #32)
> > (In reply to comment #31)
> > > (In reply to Ehsan Akhgari [:ehsan] from comment #27)
> > > > (In reply to comment #25)
> > > > > I am suggesting that the old api for global private browsing remain intact
> > > > > though.
> > > >
> > > > How are you planning to keep them intact?
> > >
> > > isActive: would return true if all open windows have PB enabled, false
> > > otherwise
>
> > That would be misleading at best. That means that if you open a PB window
> > and close all of your other windows, the behavior of the add-on suddenly
> > changes.
>
> I forgot to mention the PB events, there would be an PB "stop" event fired, as
> currently exists.
That is also problematic.
> > > activate: activates PB for all open windows and windows that will open (if need
> > > be)
> > > deactivate: deactivates PB for all open windows
> >
> > These would be unacceptable, since they would basically subvert the entire
> > UI that Firefox will have for per-window PB.
>
> I don't see how the UI matters.
You will have a menu item saying something like "New Private Window" and if you click that, a new window will open in PB, possibly with a different theme. Then you install a Jetpack based add-on and suddenly the rest of your windows which do not appear to be in PB mode will be in PB mode. This is unacceptable, because it will mean that all SDK based add-ons will break Firefox in a very bad way.
Comment 36•14 years ago
|
||
Hmm, can we please avoid redesigning the per-window PB mode design in this bug and instead focus on making the SDK correctly expose and use the new APIs? I don't see what the point of this discussion is, really...
Comment 37•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #35)
> > > > activate: activates PB for all open windows and windows that will open (if need
> > > > be)
> > > > deactivate: deactivates PB for all open windows
> > >
> > > These would be unacceptable, since they would basically subvert the entire
> > > UI that Firefox will have for per-window PB.
> >
> > I don't see how the UI matters.
>
> You will have a menu item saying something like "New Private Window" and if
> you click that, a new window will open in PB, possibly with a different
> theme. Then you install a Jetpack based add-on and suddenly the rest of
> your windows which do not appear to be in PB mode will be in PB mode. This
> is unacceptable, because it will mean that all SDK based add-ons will break
> Firefox in a very bad way.
Well that only happens if the Jetpack add-on actually uses the activate API. An alternative I guess is to make the API do what global PB does right now, close all existing windows and open a new PB window. Given the very few users of the API I suspect it isn't worth going to all the effort to maintain it but we have our compatibility promise to think about and we have to be careful when we break it.
Comment 38•14 years ago
|
||
(In reply to comment #37)
> (In reply to Ehsan Akhgari [:ehsan] from comment #35)
> > > > > activate: activates PB for all open windows and windows that will open (if need
> > > > > be)
> > > > > deactivate: deactivates PB for all open windows
> > > >
> > > > These would be unacceptable, since they would basically subvert the entire
> > > > UI that Firefox will have for per-window PB.
> > >
> > > I don't see how the UI matters.
> >
> > You will have a menu item saying something like "New Private Window" and if
> > you click that, a new window will open in PB, possibly with a different
> > theme. Then you install a Jetpack based add-on and suddenly the rest of
> > your windows which do not appear to be in PB mode will be in PB mode. This
> > is unacceptable, because it will mean that all SDK based add-ons will break
> > Firefox in a very bad way.
>
> Well that only happens if the Jetpack add-on actually uses the activate API. An
> alternative I guess is to make the API do what global PB does right now, close
> all existing windows and open a new PB window. Given the very few users of the
> API I suspect it isn't worth going to all the effort to maintain it but we have
> our compatibility promise to think about and we have to be careful when we
> break it.
I'm not planning to maintain both UIs. I understand the compatibility concerns, but really this is a fundamental change to how PB works, and I don't know how to make a global API work with a per-window implementation...
Comment 39•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #38)
> I'm not planning to maintain both UIs.
You won't need to.
> I understand the compatibility
> concerns, but really this is a fundamental change to how PB works, and I
> don't know how to make a global API work with a per-window implementation...
You don't need to, do what you want and we'll design the Jetpack api accordingly.
Comment 40•14 years ago
|
||
@Ehsan will there be an event fired when PB status is changed on a window?
Comment 41•14 years ago
|
||
@Mossop I am planning on putting this on hold until per-window PB is actually implemented, does that sound alright to you?
Comment 42•14 years ago
|
||
(In reply to comment #40)
> @Ehsan will there be an event fired when PB status is changed on a window?
Yes, see nsIPrivacyTransitionObserver.
Comment 43•14 years ago
|
||
(In reply to comment #41)
> @Mossop I am planning on putting this on hold until per-window PB is actually
> implemented, does that sound alright to you?
I think all of the bits needed for this work are already landed on mozilla-central.
Comment 44•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #43)
> (In reply to comment #41)
> > @Mossop I am planning on putting this on hold until per-window PB is actually
> > implemented, does that sound alright to you?
>
> I think all of the bits needed for this work are already landed on
> mozilla-central.
I can enable per-window PB with the setter now?
Comment 45•14 years ago
|
||
(In reply to Erik Vold [:erikvold] from comment #41)
> @Mossop I am planning on putting this on hold until per-window PB is
> actually implemented, does that sound alright to you?
I'd like us to get out ahead of this as much as possible. If that means writing the implementation then waiting to land it until the necessary bits are enabled in Firefox then that's fine
Comment 46•14 years ago
|
||
hmm I guess I'll do this one in pieces, leaving the setter and window opener pieces for last.
Comment 47•14 years ago
|
||
(In reply to comment #44)
> (In reply to Ehsan Akhgari [:ehsan] from comment #43)
> > (In reply to comment #41)
> > > @Mossop I am planning on putting this on hold until per-window PB is actually
> > > implemented, does that sound alright to you?
> >
> > I think all of the bits needed for this work are already landed on
> > mozilla-central.
>
> I can enable per-window PB with the setter now?
Technically you can, but not everything is hooked up for that yet. Definitely none of the UI bits.
I think it makes sense to land a getter implementation and work on a setter implementation which will initially be disabled.
Comment 48•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #42)
> (In reply to comment #40)
> > @Ehsan will there be an event fired when PB status is changed on a window?
>
> Yes, see nsIPrivacyTransitionObserver.
Do you have any examples of how this is used?
Comment 49•14 years ago
|
||
(In reply to comment #48)
> (In reply to Ehsan Akhgari [:ehsan] from comment #42)
> > (In reply to comment #40)
> > > @Ehsan will there be an event fired when PB status is changed on a window?
> >
> > Yes, see nsIPrivacyTransitionObserver.
>
> Do you have any examples of how this is used?
You can see the current usages here: http://mxr.mozilla.org/mozilla-central/search?string=nsIPrivacyTransitionObserver
One simple example is this test case: http://mxr.mozilla.org/mozilla-central/source/docshell/test/unit/test_privacy_transition.js
The interface should be implemented by an object which has a privateModeChanged method which gets called whenever the corresponding docshell enters or leaves the private browsing mode.
Comment 50•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #49)
> (In reply to comment #48)
> > (In reply to Ehsan Akhgari [:ehsan] from comment #42)
> > > (In reply to comment #40)
> > > > @Ehsan will there be an event fired when PB status is changed on a window?
> > >
> > > Yes, see nsIPrivacyTransitionObserver.
> >
> > Do you have any examples of how this is used?
>
> You can see the current usages here:
> http://mxr.mozilla.org/mozilla-central/
> search?string=nsIPrivacyTransitionObserver
>
> One simple example is this test case:
> http://mxr.mozilla.org/mozilla-central/source/docshell/test/unit/
> test_privacy_transition.js
>
> The interface should be implemented by an object which has a
> privateModeChanged method which gets called whenever the corresponding
> docshell enters or leaves the private browsing mode.
So I see the addWeakPrivacyTransitionObserver method added to nsIDocShell, but not a removeWeakPrivacyTransitionObserver, so I'm guessing that the weak reference might mean that I won't need to remove the observer, is that right?
If so then I'm not sure how that would work, because I was going to create a obs that the sdk code holds no reference to, but the observer will hold a ref to our window obj and emit events on it.
Comment 51•14 years ago
|
||
(In reply to comment #50)
> (In reply to Ehsan Akhgari [:ehsan] from comment #49)
> > (In reply to comment #48)
> > > (In reply to Ehsan Akhgari [:ehsan] from comment #42)
> > > > (In reply to comment #40)
> > > > > @Ehsan will there be an event fired when PB status is changed on a window?
> > > >
> > > > Yes, see nsIPrivacyTransitionObserver.
> > >
> > > Do you have any examples of how this is used?
> >
> > You can see the current usages here:
> > http://mxr.mozilla.org/mozilla-central/
> > search?string=nsIPrivacyTransitionObserver
> >
> > One simple example is this test case:
> > http://mxr.mozilla.org/mozilla-central/source/docshell/test/unit/
> > test_privacy_transition.js
> >
> > The interface should be implemented by an object which has a
> > privateModeChanged method which gets called whenever the corresponding
> > docshell enters or leaves the private browsing mode.
>
> So I see the addWeakPrivacyTransitionObserver method added to nsIDocShell, but
> not a removeWeakPrivacyTransitionObserver, so I'm guessing that the weak
> reference might mean that I won't need to remove the observer, is that right?
That's correct. The docshell will remove the observer when the object behind it goes away.
> If so then I'm not sure how that would work, because I was going to create a
> obs that the sdk code holds no reference to, but the observer will hold a ref
> to our window obj and emit events on it.
I'm not sure what you mean here.
Comment 52•14 years ago
|
||
OK, so time for an update here. We have been recently working on stabilizing our front-end APIs for working with per-window private browsing, and here's what we ended up with:
The right way to open a new private window if you're in the browser.js context is:
OpenBrowserWindow({private: true})
or if you have access to a chrome window object called `window':
window.openDialog("chrome://browser/content/", "name", "chrome,private,...");
Note that this requires chrome privileges, which means that you cannot open private windows from non-privileged code (for example, web content), which is what one would expect.
Also, changing the privacy mode of a window after it has been opened is not going to be supported. The only way to get rid of a private window will be to close it.
Unfortunately for the add-on SDK, this is going to mean that it will be impossible to maintain API compatibility. This situation sucks, but we believe that it's necessary in order to provide our users with the best and most robust user experience. Basically in the new world of per-window private browsing, the add-on SDK needs to support two functionalities:
* Support opening a new private window.
* Support notifying the add-on when the last private window has exited, in case it needs to do some kind of cleanup.
The second functionality can be implemented by the last-pb-context-exited observer service notification as before.
Please let me know if you have any questions.
Whiteboard: [please read comment 52]
Comment 53•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #52)
> Please let me know if you have any questions.
So is addWeakPrivacyTransitionObserver being removed too?
Comment 54•14 years ago
|
||
(In reply to comment #53)
> (In reply to Ehsan Akhgari [:ehsan] from comment #52)
>
> > Please let me know if you have any questions.
>
> So is addWeakPrivacyTransitionObserver being removed too?
Yes. That will be done in bug 800195.
Comment 55•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #52)
> OK, so time for an update here. We have been recently working on
> stabilizing our front-end APIs for working with per-window private browsing,
> and here's what we ended up with:
>
> The right way to open a new private window if you're in the browser.js
> context is:
>
> OpenBrowserWindow({private: true})
>
> or if you have access to a chrome window object called `window':
>
> window.openDialog("chrome://browser/content/", "name", "chrome,private,...");
>
> Note that this requires chrome privileges, which means that you cannot open
> private windows from non-privileged code (for example, web content), which
> is what one would expect.
>
> Also, changing the privacy mode of a window after it has been opened is not
> going to be supported. The only way to get rid of a private window will be
> to close it.
Was this all discussed in a bug that I've missed?
Comment 56•14 years ago
|
||
(In reply to comment #55)
> Was this all discussed in a bug that I've missed?
Not in a single bug. The design has been sort of in flux as we got better ideas on what we want to support, and it's only recently that the design has become stable now. Sorry, but we were also trying to figure out how to design the best implementation that we can.
Comment 57•14 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #56)
> (In reply to comment #55)
> > Was this all discussed in a bug that I've missed?
>
> Not in a single bug. The design has been sort of in flux as we got better
> ideas on what we want to support, and it's only recently that the design has
> become stable now. Sorry, but we were also trying to figure out how to
> design the best implementation that we can.
No worries, it just sounds like we could've saved some time by holding off work on the SDK as the design was being discussed.
Comment 58•14 years ago
|
||
> (In reply to Ehsan Akhgari [:ehsan] from comment #56)
> > (In reply to comment #55)
> > > Was this all discussed in a bug that I've missed?
> >
> > Not in a single bug. The design has been sort of in flux as we got better
> > ideas on what we want to support, and it's only recently that the design has
> > become stable now. Sorry, but we were also trying to figure out how to
> > design the best implementation that we can.
>
> No worries, it just sounds like we could've saved some time by holding off work
> on the SDK as the design was being discussed.
Yes, sorry, I was under the impression that the previous design was solid, but actually implementing things and trying to get them to work made it clear that I was wrong. :/
Updated•13 years ago
|
Depends on: pbngentest
Updated•13 years ago
|
Updated•13 years ago
|
Target Milestone: --- → 1.14
Updated•13 years ago
|
Depends on: sdk-pb-docs
Updated•13 years ago
|
No longer depends on: pbngentest
Updated•13 years ago
|
Depends on: sdk-pwpb-fx21
Updated•13 years ago
|
Alias: sdk-pwpb
Target Milestone: 1.14 → 1.15
Updated•13 years ago
|
Assignee: evold → nobody
Updated•11 years ago
|
Blocks: sdk/private-browsing
Updated•10 years ago
|
Priority: P1 → --
Comment 59•9 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•