Skip to content

Commit 4fb2937

Browse files
committed
ntp: batched api
1 parent b131675 commit 4fb2937

32 files changed

+1566
-490
lines changed

special-pages/pages/new-tab/app/activity/ActivityProvider.js

Lines changed: 197 additions & 130 deletions
Large diffs are not rendered by default.

special-pages/pages/new-tab/app/activity/activity.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,35 @@ Notes:
6262
- {@link "NewTab Messages".ActivityGetConfigRequest}
6363
- Used to fetch the initial config data (eg: expanded vs collapsed)
6464
- returns {@link "NewTab Messages".ActivityConfig}
65-
-
65+
66+
### `activity_getUrls`
67+
- {@link "NewTab Messages".ActivityGetUrlsRequest}
68+
- Used to fetch the initial config data (eg: expanded vs collapsed)
69+
- returns {@link "NewTab Messages".UrlInfo}
70+
71+
```json
72+
{
73+
"urls": ["..."],
74+
"totalTrackersBlocked": 123
75+
}
76+
```
77+
78+
### `activity_getDataForUrls`
79+
- {@link "NewTab Messages".ActivityGetDataForUrlsRequest}
80+
- Used to confirm the burn action - native side may or may not show a modal
81+
- sends {@link "NewTab Messages".DataForUrlsParams}
82+
- returns {@link "NewTab Messages".ActivityData}
83+
- Note: This response is the same format as `activity_getData`, where DomainActivity items are delivered under `.activity`
84+
85+
```json
86+
{
87+
"activity": [
88+
{"...": "..."}
89+
]
90+
}
91+
```
92+
93+
6694
### `activity_confirmBurn`
6795
- {@link "NewTab Messages".ActivityConfirmBurnRequest}
6896
- Used to confirm the burn action - native side may or may not show a modal
@@ -93,6 +121,27 @@ by sending the notification `activity_burnAnimationComplete`
93121
- The activity data used in the feed.
94122
- returns {@link "NewTab Messages".ActivityData}
95123

124+
### `activity_onDataPatch`
125+
- {@link "NewTab Messages".ActivityOnDataPatchSubscription}
126+
- The activity data used in the feed.
127+
- returns {@link "NewTab Messages".UrlInfo} + optional {@link "NewTab Messages".PatchData}
128+
129+
```json
130+
{
131+
"urls": ["..."],
132+
"totalTrackersBlocked": 123
133+
}
134+
```
135+
```json
136+
{
137+
"urls": ["..."],
138+
"totalTrackersBlocked": 123,
139+
"patch": {
140+
"...": "..."
141+
}
142+
}
143+
```
144+
96145
### `activity_onConfigUpdate`
97146
- {@link "NewTab Messages".ActivityOnDataUpdateSubscription }
98147
- The widget config

special-pages/pages/new-tab/app/activity/activity.service.js

Lines changed: 0 additions & 167 deletions
This file was deleted.

0 commit comments

Comments
 (0)