Compare Revisions

Supporting per-window private browsing

Revision 346501:

Revision 346501 by jdm on

Revision 346685:

Revision 346685 by Ehsan on

Title:
Supporting per-window private browsing
Supporting per-window private browsing
Slug:
Supporting_per-window_private_browsing
Supporting_per-window_private_browsing
Content:

Revision 346501
Revision 346685
tt58    <h2>
59      Forcing a channel into private mode
60    </h2>
61    <p>
62      Usually, network channels inherit the privacy status of the
 > document which created them, which means that they work correctl
 >y most of the time.&nbsp; However, sometimes you need to adjust t
 >he privacy status on a channel manually, for example, if you have
 > created the channel directly yourself.&nbsp; You can use the nsI
 >PrivateBrowsingChannel interface for this purpose.&nbsp; The exam
 >ple below creates a channel to load a URL, and forces it to be in
 > private mode.
63    </p>
64    <pre>
65<code>var channel = Services.io.newChannel("http://example.org", 
 >null, null);
66 
67channel.QueryInterface(Components.interfaces.nsIPrivateBrowsingCh
 >annel);
68channel.setPrivate(true); // force the channel to be loaded in pr
 >ivate mode
69</code>
70</pre>

Back to History