The initial handshake - this is the first thing called to determine the feature set supported by the native platform in question
{
"features": {
"remoteResources": {
"resources": [
{
"id": "privacy-configuration",
"url": "https://staticcdn.duckduckgo.com/trackerblocking/config/v2/macos-config.json",
"name": "Privacy Config"
},
{
"id": "tracker-data-set",
"url": "https://staticcdn.duckduckgo.com/trackerblocking/v3/apple-tds.json",
"name": "Tracker Data Set (TDS)"
}
]
}
}
}
Retrieve a single Remote Resource.
In this example current
represents what the platform has currently applied.
See RemoteResource for the other variants (for example, a debug-tools override)
{
"id": "privacy-configuration",
"url": "https://staticcdn.duckduckgo.com/trackerblocking/config/v2/macos-config.json",
"name": "Privacy Config",
"current": {
"source": {
"remote": {
"url": "https://staticcdn.duckduckgo.com/trackerblocking/config/v2/macos-config.json",
"fetchedAt": "2023-07-05T12:34:56Z"
}
},
"contents": "{\n \"foo\": \"bar\"\n}",
"contentType": "application/json"
}
}
Get the currently open tabs. This is used to target certain modifications to a particular domain if possible.
For example, applying a domain exception for a particular feature
{
"tabs": [
{
"id": "957670663",
"url": "https://duckduckgo.com/extension-success?atb=v386-1",
"title": "Privacy, simplified. — DuckDuckGo Browser Extension & Mobile App"
},
{
"id": "957670668",
"url": "https://browsersync.io/",
"title": "Browsersync - Time-saving synchronised browser testing"
}
]
}
A subscription for receiving new lists of tabs - it's the push version of getTabs
Updating a resource is used in all cases where we want to make a change, for example
For native implementors, you should assume any message received here is an indication to reload any rules/resources related to it. It's a fresh start for the resource in question.
This occurs when we want to fetch a resource fresh and apply it. Note this URL might match what's already applied - and that's fine, you should ALWAYS re-fetch it.
params:
{
"id": "privacy-configuration",
"source": {
"remote": {
"url": "https://example.com/macos-config.json"
}
}
}
returns: RemoteResource
This occurs when a resource was edited in the panel.
Note You should accept the string verbatim, just as you would from a remote. And then re-apply any relevant rules
{
"id": "privacy-configuration",
"source": {
"debugTools": {
"content": "{ \"foo\": \"baz\" }"
}
}
}
returns: RemoteResource
Generated using TypeDoc
Messaging