-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: Add RMF Service spec docs, examples * fix: Examples * docs: Update new-tab app * fix: RMF service
- Loading branch information
1 parent
360983f
commit 6f94a00
Showing
4 changed files
with
104 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* @type {import("../../../types/new-tab").RMFData} | ||
*/ | ||
const rmfDataSmallMsg = { | ||
"content": { | ||
"messageType": "small", | ||
"id": "id-1", | ||
"titleText": "Tell Us Your Thoughts on Privacy Pro", | ||
"descriptionText": "Lorem Ipsum is simply dummy text of the printing and typesetting industry." | ||
}, | ||
} | ||
|
||
/** | ||
* @type {import("../../../types/new-tab").RMFData} | ||
*/ | ||
const rmfDataMediumMsg = { | ||
"content": { | ||
messageType: 'medium', | ||
id: 'id-2', | ||
icon: 'DDGAnnounce', | ||
titleText: 'New Search Feature!', | ||
descriptionText: 'DuckDuckGo now offers Instant Answers for quicker access to the information you need.' | ||
}, | ||
} | ||
|
||
/** | ||
* @type {import("../../../types/new-tab").RMFData} | ||
*/ | ||
const rmfDataBigSingleActionMsg = { | ||
"content": { | ||
messageType: 'big_single_action', | ||
id: 'id-big-single', | ||
titleText: 'Tell Us Your Thoughts on Privacy Pro', | ||
descriptionText: 'Take our short anonymous survey and share your feedback.', | ||
icon: 'PrivacyPro', | ||
primaryActionText: 'Take Survey' | ||
} | ||
} | ||
|
||
/** | ||
* @type {import("../../../types/new-tab").RMFData} | ||
*/ | ||
const rmfDataBigTwoActionMsg = { | ||
"content": { | ||
messageType: 'big_two_action', | ||
id: 'id-big-two', | ||
titleText: 'Tell Us Your Thoughts on Privacy Pro', | ||
descriptionText: 'Take our short anonymous survey and share your feedback.', | ||
icon: 'Announce', | ||
primaryActionText: 'Take Survey', | ||
secondaryActionText: 'Remind me' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
special-pages/pages/new-tab/app/remote-messaging-framework/rmf.service.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
title: Remote Messaging Framework | ||
--- | ||
|
||
## Requests: | ||
- {@link "NewTab Messages".RmfGetDataRequest `rmf_getData`} | ||
- Used to fetch the initial data (during the first render) | ||
- returns {@link "NewTab Messages".RMFData} | ||
|
||
## Subscriptions: | ||
- {@link "NewTab Messages".RmfOnDataUpdateSubscription `rmf_onDataUpdate`}. | ||
- The messages available for the platform | ||
- returns {@link "NewTab Messages".RMFData} | ||
|
||
## Notifications: | ||
- {@link "NewTab Messages".RmfPrimaryActionNotification `rmf_primaryAction`} | ||
- Sent when the user clicks the primaryAction button | ||
- sends {@link "NewTab Messages".RMFPrimaryAction} | ||
- example payload: | ||
```json | ||
{ | ||
"id": "windows_privacy_pro_survey_2" | ||
} | ||
``` | ||
- {@link "NewTab Messages".RmfSecondaryActionNotification `rmf_secondaryAction`} | ||
- Sent when the user clicks the secondaryAction button | ||
- sends {@link "NewTab Messages".RMFSecondaryAction} | ||
- example payload: | ||
```json | ||
{ | ||
"id": "windows_privacy_pro_survey_2" | ||
} | ||
``` | ||
- {@link "NewTab Messages".RmfDismissNotification `rmf_dismiss`} | ||
- Sent when the user clicks the dismiss button | ||
- sends {@link "NewTab Messages".RMFDismissAction} | ||
- example payload: | ||
```json | ||
{ | ||
"id": "windows_privacy_pro_survey_2" | ||
} | ||
``` | ||
|
||
## Examples: | ||
|
||
The following examples show the data types in JSON format: | ||
[messages/new-tab/examples/stats.js](../../../../messages/new-tab/examples/rmf.js) |