Bug 1878081 - Drop per-file license header comments from schema files, r=willdurand...
[gecko.git] / toolkit / components / extensions / schemas / user_scripts_content.json
blob6e6581ed2e3147943559851cba24483024683071
2   {
3     "namespace": "userScripts",
4     "max_manifest_version": 2,
5     "permissions": ["manifest:user_scripts"],
6     "allowedContexts": ["content"],
7     "events": [
8       {
9         "name": "onBeforeScript",
10         "permissions": ["manifest:user_scripts.api_script"],
11         "allowedContexts": ["content", "content_only"],
12         "type": "function",
13         "description": "Event called when a new userScript global has been created",
14         "parameters": [
15           {
16             "type": "object",
17             "name": "userScript",
18             "properties": {
19               "metadata": {
20                 "type": "any",
21                 "description": "The userScript metadata (as set in userScripts.register)"
22               },
23               "global": {
24                 "type": "any",
25                 "description": "The userScript global"
26               },
27               "defineGlobals": {
28                 "type": "function",
29                 "description": "Exports all the properties of a given plain object as userScript globals",
30                 "parameters": [
31                   {
32                     "type": "object",
33                     "name": "sourceObject",
34                     "description": "A plain object whose properties are exported as userScript globals"
35                   }
36                 ]
37               },
38               "export": {
39                 "type": "function",
40                 "description": "Convert a given value to make it accessible to the userScript code",
41                 "parameters": [
42                   {
43                     "type": "any",
44                     "name": "value",
45                     "description": "A value to convert into an object accessible to the userScript"
46                   }
47                 ],
48                 "returns": {
49                   "type": "any"
50                 }
51               }
52             }
53           }
54         ]
55       }
56     ]
57   }