Add admin policy for Web Discovery (#30023) * Fix Web Discovery API to account for policy, add Web Discovery test * Move IsWebDiscoveryEnabled/pref_names to components/web_discovery/common * Check Web Discovery Native feature before loading extension background page * Use PrefService ref in IsWebDiscoveryEnabled * Mark WDP policy as pending development for Android * Move Web Discovery enabled/disabled via policy prefs to //brave/components/constants
62 lines
1.7 KiB
JSON
62 lines
1.7 KiB
JSON
// Copyright (c) 2025 The Brave Authors. All rights reserved.
|
|
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
// You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
[
|
|
{
|
|
"namespace": "webDiscovery",
|
|
"description": "Includes Web Discovery functions for the Brave extension",
|
|
"compiler_options": {
|
|
"implemented_in": "brave/browser/extensions/api/web_discovery_api.h"
|
|
},
|
|
"functions": [
|
|
{
|
|
"name": "retrieveBackupResults",
|
|
"type": "function",
|
|
"description": "Requests search results from backup provider and returns SERP HTML",
|
|
"parameters": [
|
|
{
|
|
"name": "url",
|
|
"type": "string"
|
|
}
|
|
],
|
|
"returns_async": {
|
|
"name": "callback",
|
|
"parameters": [
|
|
{
|
|
"name": "result",
|
|
"type": "object",
|
|
"properties": {
|
|
"responseCode": {
|
|
"type": "integer",
|
|
"description": "The last response code while fetching SERP"
|
|
},
|
|
"html": {
|
|
"type": "string",
|
|
"description": "The HTML contents of the SERP"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "isWebDiscoveryExtensionEnabled",
|
|
"type": "function",
|
|
"description": "Returns true if Web Discovery extension should be active",
|
|
"parameters": [],
|
|
"returns_async": {
|
|
"name": "callback",
|
|
"parameters": [
|
|
{
|
|
"name": "enabled",
|
|
"type": "boolean"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|