Closed Bug 885108 Opened 11 years ago Closed 9 years ago

SimplePush: Support private browsing mode

Categories

(Core :: DOM: Notifications, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: nsm, Unassigned)

References

Details

The PushService was originally written for B2G, which has no notion of Private Browsing.

On desktop, there is only one instance of the service running application wide, which means the same database is shared for normal and private browsing windows, which is obviously wrong.

To prevent data leak, the patches in 857464 explicitly disable the use of navigator.push in tabs that are in a private browsing window. While this solves the privacy problem it would be nice if the PushService used a separate DB and push could be enabled for private browsing windows too.

This would also require stricter regulations on the eventpages/workers/tabs which would be launched on push. They'd have to run in a private browsing window, and must be unloaded when all private browsing windows are closed.

At this point there aren't enough cases to implement this, but it may be useful in the future.
So with the current implementation, do push notifications simply not work in private tabs?
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #1)
> So with the current implementation, do push notifications simply not work in
> private tabs?

Yes, they don't work.
Component: DOM → DOM: Device Interfaces
(In reply to comment #2)
> (In reply to :Ehsan Akhgari (needinfo? me!) from comment #1)
> > So with the current implementation, do push notifications simply not work in
> > private tabs?
> 
> Yes, they don't work.

OK, that's fine for now I guess.
Component: DOM: Device Interfaces → DOM: Push Notifications
Do we need to do something for the standard Push API in private browsing mode?
Flags: needinfo?(nsm.nikhil)
Flags: needinfo?(nsm.nikhil) → needinfo?(kcambridge)
Probably. This Etherpad notes Push is disabled in private browsing mode: https://etherpad.mozilla.org/webpush-desktop-checklist...except I can't find anything confirming that in the code.

For now, we should probably just reject push subscription attempts with `PermissionDeniedError` in private browsing mode.
Flags: needinfo?(kcambridge)
It looks like we're hiding `navigator.serviceWorker` in private browsing mode, so you can't even register to receive push notifications.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.