Per-window Private Browsing: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
= Rationale =
== Rationale ==
The current Private Browsing (PB) implementation in Firefox is very disruptive, because it closes all of your open tabs and windows.  Although we do a relatively good job at restoring everything back to the state before initiating the PB session, we should really not require the user to give up their existing session.
The current Private Browsing (PB) implementation in Firefox is very disruptive, because it closes all of your open tabs and windows.  Although we do a relatively good job at restoring everything back to the state before initiating the PB session, we should really not require the user to give up their existing session.


This page summarizes the design which can lead to a per-window Private Browsing implementation for Desktop Firefox.
This page summarizes the design which can lead to a per-window Private Browsing implementation for Desktop Firefox.


= Current Design =
== Global Private Browsing Mode Design ==
The global mode PB implementation is basically an application wide boolean flag which designates whether the PB mode is on or off.  The private browsing service manages this global flag, and sends a bunch of notifications when the global mode is changing (for example, when the user invokes the Private Browsing flag).  Each module which needs to store data which can identify the websites that a user has previously visited needs to handle these notifications in order to adjust its behavior depending on the PB mode flag, and refrain from storing such data inside this mode.  For more information on how the existing API works, see [https://developer.mozilla.org/En/Supporting_private_browsing_mode this document].
The global mode PB implementation is basically an application wide boolean flag which designates whether the PB mode is on or off.  The private browsing service manages this global flag, and sends a bunch of notifications when the global mode is changing (for example, when the user invokes the Private Browsing flag).  Each module which needs to store data which can identify the websites that a user has previously visited needs to handle these notifications in order to adjust its behavior depending on the PB mode flag, and refrain from storing such data inside this mode.  For more information on how the existing API works, see [https://developer.mozilla.org/En/Supporting_private_browsing_mode this document].
== Per-window Private Browsing Mode Design ==
In order to move towards a per-window PB design, we can't represent the PB state as a global flag any more.  At a birds-eye view, we need to store a per-window boolean flag and each module which needs to handle its storage needs based on the PB status should somehow be able to know which window is ultimately responsible for the request at hand.
The per-window flag is going to be handled by a Gecko object called a ''docshell''.  A docshell is simply an object which stores the information associated which every document that Gecko loads which has a presentation.  Each docshell can either be a ''content'' or a ''chrome'' docshell.  A chrome docshell represents a document which has chrome privileges, such as browser.xul which renders Firefox's main window, or about:addons.  A content docshell represents a document which does not have chrome privileges, which is most often used to load a website inside the browser.
Confirmed users
657

edits

Navigation menu