summaryrefslogtreecommitdiffstats
path: root/browser/components/asrouter/docs/private-browsing.md
blob: 405a5a10190895ce2bee75479b1c5771ba86e36d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# PrivateBrowsing

## What is PrivateBrowsing?
Messages shown inside `about:privatebrowsing` (incognito) content page. This messaging surface allows experimentation on content shown (promotion and info section) when new private window or tab is opened.

### Example of a PrivateBrowsing window
![Private Browsing](./private-browsing.png)

## Testing PrivateBrowsing

### Via the dev tools:
1. In the search tab go to `about:config`, set `browser.newtabpage.activity-stream.asrouter.devtoolsEnabled` to `true`
2. Open a new tab, in the search tab go to `about:asrouter`
3. On the left navigation, click on `Private Browsing`
4. This shows all example messages developed for `about:privatebrowsing` messaging surface
5. You can directly modify the message in the text area with your changes or by pasting your custom message JSON. Ensure that all required properties are covered according to the [Private Browsing Schema](https://searchfox.org/mozilla-central/source/browser/components/asrouter/content-src/templates/PBNewtab/NewtabPromoMessage.schema.json)
6. To view message in private browsing window, click the circle to select respective message. Then hit the blue `Open a Private Browsing Window` at the top of the screen. This opens new private window with promotion and info section updated with custom message.

![Circle](./selected-PB.png)

7. To reset the chosen PrivateBrowsing window and choose another, click `Reset Message State` at the top of the screen

### Via Experiments:
You can test any `privatebrowsing` custom message UI by creating an experiment. [Messaging Journey](https://experimenter.info/messaging/desktop-messaging-journey) captures creating experiments via Nimbus.

### Example of messaging in privatebrowsing window
```
{
  "id": "TEST_PBM_PROMO",
  "template": "pb_newtab",
  "content": {
    "promoEnabled": true,
    "promoType": "VPN",
    "infoEnabled": true,
    "infoBody": "Nightly clears your search and browsing history",
    "infoLinkText": "Click Here to Learn More",
    "infoTitleEnabled": false,
    "promoLinkType": "button",
    "promoLinkText": "fluent:about-private-browsing-prominent-cta",
    "promoSectionStyle": "below-search",
    "promoHeader": "Get privacy protections",
    "promoTitle": "Hide browsing activity and location with Mozilla VPN. One click creates a secure connection",
    "promoTitleEnabled": true,
    "promoImageLarge": "chrome://browser/content/assets/moz-vpn.svg",
    "promoButton": {
      "action": {
        "type": "OPEN_URL",
        "data": {
          "args": "https://vpn.mozilla.org/"
        }
      }
    }
  },
  "targeting": "firefoxVersion >= 89",
  "frequency": {
    "lifetime": 3
  }
}
```