Compare Revisions

Supporting per-window private browsing

Revision 347261:

Revision 347261 by jdm on

Revision 350969:

Revision 350969 by darktrojan 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 347261
Revision 350969
n14      Determining whether or not a given DOM window is private isn14      Determining whether or not a given DOM window is private is
> simple: import <a href="http://mxr.mozilla.org/mozilla-central/s> simple: import <a href="http://mxr.mozilla.org/mozilla-central/s
>ource/toolkit/content/PrivateBrowsingUtils.jsm" title="http://mxr>ource/toolkit/content/PrivateBrowsingUtils.jsm" title="http://mxr
>.mozilla.org/mozilla-central/source/toolkit/content/PrivateBrowsi>.mozilla.org/mozilla-central/source/toolkit/content/PrivateBrowsi
>ngUtils.jsm"><code>chrome://gre/modules/PrivateBrowsingUtils.jsm<>ngUtils.jsm"><code>resource://gre/modules/PrivateBrowsingUtils.js
>/code></a> and use <code>PrivateBrowsingUtils.isWindowPrivate(win>m</code></a> and use <code>PrivateBrowsingUtils.isWindowPrivate(w
>)</code>. You can then take action based on this value, as any da>in)</code>. You can then take action based on this value, as any 
>ta or actions originating from this window should be considered p>data or actions originating from this window should be considered
>rivate.> private.
t20      Some APIs (such as <code>nsITransferable</code> and <code>nt20      Some APIs (such as <code>nsITransferable</code> and <code>n
>sIWebBrowserPersist</code>) take <code>nsILoadContext</code> argu>sIWebBrowserPersist</code>) take <code>nsILoadContext</code> argu
>ments that are used to determine whether they should be classed a>ments that are used to determine whether they should be classed a
>s private or not (for example, whether the URI being persisted by>s private or not (for example, whether the URI being persisted by
> <code>saveURI</code> should be added to the permanent download h> <code>saveURI</code> should be added to the permanent download h
>istory). Just import <a href="http://mxr.mozilla.org/mozilla-cent>istory). Just import <a href="http://mxr.mozilla.org/mozilla-cent
>ral/source/toolkit/content/PrivateBrowsingUtils.jsm" title="http:>ral/source/toolkit/content/PrivateBrowsingUtils.jsm" title="http:
>//mxr.mozilla.org/mozilla-central/source/toolkit/content/PrivateB>//mxr.mozilla.org/mozilla-central/source/toolkit/content/PrivateB
>rowsingUtils.jsm"><code>chrome://gre/modules/PrivateBrowsingUtils>rowsingUtils.jsm"><code>resource://gre/modules/PrivateBrowsingUti
>.jsm</code></a> and use <code>PrivateBrowsingUtils.getPrivacyCont>ls.jsm</code></a> and use <code>PrivateBrowsingUtils.getPrivacyCo
>extFromWindow(win)</code>, passing a Window object that is relate>ntextFromWindow(win)</code>, passing a Window object that is rela
>d to the content in question.>ted to the content in question.

Back to History