diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /toolkit/components/extensions/schemas/user_scripts.json | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/extensions/schemas/user_scripts.json')
-rw-r--r-- | toolkit/components/extensions/schemas/user_scripts.json | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/toolkit/components/extensions/schemas/user_scripts.json b/toolkit/components/extensions/schemas/user_scripts.json new file mode 100644 index 0000000000..a5120cb372 --- /dev/null +++ b/toolkit/components/extensions/schemas/user_scripts.json @@ -0,0 +1,136 @@ +/* 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 http://mozilla.org/MPL/2.0/. */ + +[ + { + "namespace": "manifest", + "types": [ + { + "$extend": "WebExtensionManifest", + "properties": { + "user_scripts": { + "type": "object", + "max_manifest_version": 2, + "optional": true, + "properties": { + "api_script": { + "optional": true, + "$ref": "manifest.ExtensionURL" + } + }, + "additionalProperties": { "$ref": "UnrecognizedProperty" } + } + } + } + ] + }, + { + "namespace": "userScripts", + "max_manifest_version": 2, + "permissions": ["manifest:user_scripts"], + "types": [ + { + "id": "UserScriptOptions", + "type": "object", + "description": "Details of a user script", + "properties": { + "js": { + "type": "array", + "optional": false, + "description": "The list of JS files to inject", + "minItems": 1, + "items": { "$ref": "extensionTypes.ExtensionFileOrCode" } + }, + "scriptMetadata": { + "description": "An opaque user script metadata value", + "$ref": "extensionTypes.PlainJSONValue", + "optional": true + }, + "matches": { + "type": "array", + "optional": false, + "minItems": 1, + "items": { "$ref": "manifest.MatchPattern" } + }, + "excludeMatches": { + "type": "array", + "optional": true, + "minItems": 1, + "items": { "$ref": "manifest.MatchPattern" } + }, + "includeGlobs": { + "type": "array", + "optional": true, + "items": { "type": "string" } + }, + "excludeGlobs": { + "type": "array", + "optional": true, + "items": { "type": "string" } + }, + "allFrames": { + "type": "boolean", + "default": false, + "optional": true, + "description": "If allFrames is <code>true</code>, implies that the JavaScript should be injected into all frames of current page. By default, it's <code>false</code> and is only injected into the top frame." + }, + "matchAboutBlank": { + "type": "boolean", + "default": false, + "optional": true, + "description": "If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is <code>false</code>." + }, + "runAt": { + "$ref": "extensionTypes.RunAt", + "default": "document_idle", + "optional": true, + "description": "The soonest that the JavaScript will be injected into the tab. Defaults to \"document_idle\"." + }, + "cookieStoreId": { + "choices": [ + { + "type": "array", + "minItems": 1, + "items": { "type": "string" } + }, + { + "type": "string" + } + ], + "optional": true, + "description": "limit the set of matched tabs to those that belong to the given cookie store id" + } + } + }, + { + "id": "RegisteredUserScript", + "type": "object", + "description": "An object that represents a user script registered programmatically", + "functions": [ + { + "name": "unregister", + "type": "function", + "description": "Unregister a user script registered programmatically", + "async": true, + "parameters": [] + } + ] + } + ], + "functions": [ + { + "name": "register", + "type": "function", + "description": "Register a user script programmatically given its $(ref:userScripts.UserScriptOptions), and resolves to a $(ref:userScripts.RegisteredUserScript) instance", + "async": true, + "parameters": [ + { + "name": "userScriptOptions", + "$ref": "UserScriptOptions" + } + ] + } + ] + } +] |