Skip to content

Commit 43d38c9

Browse files
authored
feat: Imported Firefox 99.0b8 schema (mozilla#4236)
1 parent 6669a83 commit 43d38c9

File tree

2 files changed

+144
-1
lines changed

2 files changed

+144
-1
lines changed

src/schema/imported/runtime.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,8 @@
762762
"s390x",
763763
"sparc64",
764764
"x86-32",
765-
"x86-64"
765+
"x86-64",
766+
"noarch"
766767
],
767768
"allowedContexts": [
768769
"content",

src/schema/imported/scripting.json

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,88 @@
8888
"parameters": []
8989
}
9090
]
91+
},
92+
{
93+
"name": "registerContentScripts",
94+
"type": "function",
95+
"description": "Registers one or more content scripts for this extension.",
96+
"async": "callback",
97+
"parameters": [
98+
{
99+
"name": "scripts",
100+
"type": "array",
101+
"description": "Contains a list of scripts to be registered. If there are errors during script parsing/file validation, or if the IDs specified already exist, then no scripts are registered.",
102+
"items": {
103+
"$ref": "#/types/RegisteredContentScript"
104+
}
105+
},
106+
{
107+
"name": "callback",
108+
"type": "function",
109+
"description": "Invoked upon completion of the registration.",
110+
"parameters": []
111+
}
112+
]
113+
},
114+
{
115+
"name": "getRegisteredContentScripts",
116+
"type": "function",
117+
"description": "Returns all dynamically registered content scripts for this extension that match the given filter.",
118+
"async": "callback",
119+
"parameters": [
120+
{
121+
"allOf": [
122+
{
123+
"$ref": "#/types/ContentScriptFilter"
124+
},
125+
{
126+
"name": "filter",
127+
"optional": true,
128+
"description": "An object to filter the extension's dynamically registered scripts."
129+
}
130+
]
131+
},
132+
{
133+
"name": "callback",
134+
"type": "function",
135+
"description": "The resulting array contains the registered content scripts.",
136+
"parameters": [
137+
{
138+
"name": "scripts",
139+
"type": "array",
140+
"items": {
141+
"$ref": "#/types/RegisteredContentScript"
142+
}
143+
}
144+
]
145+
}
146+
]
147+
},
148+
{
149+
"name": "unregisterContentScripts",
150+
"type": "function",
151+
"description": "Unregisters one or more content scripts for this extension.",
152+
"async": "callback",
153+
"parameters": [
154+
{
155+
"allOf": [
156+
{
157+
"$ref": "#/types/ContentScriptFilter"
158+
},
159+
{
160+
"name": "filter",
161+
"optional": true,
162+
"description": "If specified, only unregisters dynamic content scripts which match the filter. Otherwise, all of the extension's dynamic content scripts are unregistered."
163+
}
164+
]
165+
},
166+
{
167+
"name": "callback",
168+
"type": "function",
169+
"description": "Invoked upon completion of the unregistration.",
170+
"parameters": []
171+
}
172+
]
91173
}
92174
],
93175
"definitions": {
@@ -236,6 +318,66 @@
236318
"required": [
237319
"target"
238320
]
321+
},
322+
"ContentScriptFilter": {
323+
"type": "object",
324+
"properties": {
325+
"ids": {
326+
"type": "array",
327+
"description": "The IDs of specific scripts to retrieve with <code>getRegisteredContentScripts()</code> or to unregister with <code>unregisterContentScripts()</code>.",
328+
"items": {
329+
"type": "string"
330+
}
331+
}
332+
}
333+
},
334+
"RegisteredContentScript": {
335+
"type": "object",
336+
"properties": {
337+
"allFrames": {
338+
"type": "boolean",
339+
"description": "If specified true, it will inject into all frames, even if the frame is not the top-most frame in the tab. Each frame is checked independently for URL requirements; it will not inject into child frames if the URL requirements are not met. Defaults to false, meaning that only the top frame is matched."
340+
},
341+
"excludeMatches": {
342+
"type": "array",
343+
"description": "Excludes pages that this content script would otherwise be injected into.",
344+
"items": {
345+
"type": "string"
346+
}
347+
},
348+
"id": {
349+
"type": "string",
350+
"description": "The id of the content script, specified in the API call."
351+
},
352+
"js": {
353+
"type": "array",
354+
"description": "The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array.",
355+
"items": {
356+
"$ref": "manifest#/types/ExtensionURL"
357+
}
358+
},
359+
"matches": {
360+
"type": "array",
361+
"description": "Specifies which pages this content script will be injected into. Must be specified for <code>registerContentScripts()</code>.",
362+
"items": {
363+
"type": "string"
364+
}
365+
},
366+
"runAt": {
367+
"allOf": [
368+
{
369+
"$ref": "extensionTypes#/types/RunAt"
370+
},
371+
{
372+
"default": "document_idle",
373+
"description": "Specifies when JavaScript files are injected into the web page. The preferred and default value is <code>document_idle</code>."
374+
}
375+
]
376+
}
377+
},
378+
"required": [
379+
"id"
380+
]
239381
}
240382
}
241383
}

0 commit comments

Comments
 (0)