-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Private browsing student project
Josh Matthews edited this page Feb 9, 2016
·
3 revisions
Background information: All major web browsers support a mode where persistent data such as cookies, logins, history, and downloads are forgotten after the session ends. Additionally, this mode is allowed to run concurrently with the regular, persistent session, without the data from either one interfering with the other. Servo is currently designed around global, shared storage for these sorts of features and therefore lacks this mode. The goal of this project is to implement support for this session partitioning feature.
Initial steps:
- compile Servo and ensure that it runs on
tests/html/about-mozilla.html - email the mozilla.dev.servo mailing list introducing your group and your progress
- add a member to the
IFrameLoadInfostruct that indicates if the iframe is private or not. Set this member based on the presence of themozprivatebrowsingattribute on the iframe element, but only if it's amozbrowseriframe too. - add a field to the
Pipelinestruct that indicates if the pipeline is private or not. Set this member as part of callingnew_pipelinefromhandle_script_loaded_url_in_iframe_msg. - define a
ConstellationMsgenum incomponents/net_traits/lib.rswhich has aIsPrivatemessage that contains aPipelineIdas well as aSender<bool>value for returning an answer. Add a method toConstellationthat can process the "is this pipeline private" request and send an appropriate reply. This must check the provided pipeline for privacy, as well as any ancestors.
Subsequent steps:
-
create an automated test for the desired functionality - an iframe that performs an XHR that sends a cookie and checks localstorage, and the same iframe but private that shows independent results. This will need to live in
tests/wpt/mozilla/tests/mozilla/mozbrowser/(see other tests there for inspiration). - add a "New private tab" button to servo-shell to allow using the new feature. It should set the
mozprivatebrowsingattribute on the new tab that is created. - add a
Receivermember toConstellationthat can receive the newConstellationMsgenum defined previously. Create a channel inConstellation::start, send theSendervalue to theResourceThread, and use the receiver inConstellation::handle_requestto receive messages and call the new method previously defined. - define a new struct in
resource_thread.rswhich encapsulates thecookie_storage,hsts_list, andconnectorvalues. Replace these members with two instances of the new type. Create a method that accepts an optionalPipelineIdvalue and returns a reference to the new type, returning an appropriate instance based on whether the pipeline should be treated as private or not. - repeat the two previous steps for
StorageThreadinstorage_thread.rs, in order to handlelocalStorageandsessionStoragein the same manner.