webext-schema 2.1.0 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -15,24 +15,24 @@
15
15
  "lint": "eslint --fix .",
16
16
  "start": "node index",
17
17
  "test": "npm run test:central",
18
- "test:beta": "c8 mocha test/*.test.js --require test/mocha/setup.js --channel=beta --exit",
19
- "test:central": "c8 mocha test/*.test.js --require test/mocha/setup.js --channel=central --exit",
20
- "test:esr": "c8 mocha test/*.test.js --require test/mocha/setup.js --channel=esr --exit",
21
- "test:release": "c8 mocha test/*.test.js --require test/mocha/setup.js --channel=release --exit",
18
+ "test:beta": "c8 mocha --require=test/mocha/setup.js --channel=beta --exit test/*.test.js",
19
+ "test:central": "c8 mocha --require=test/mocha/setup.js --channel=central --exit test/*.test.js",
20
+ "test:esr": "c8 mocha --require=test/mocha/setup.js --channel=esr --exit test/*.test.js",
21
+ "test:release": "c8 mocha --require=test/mocha/setup.js --channel=release --exit test/*.test.js",
22
22
  "test_all": "npm-run-all -s test:*",
23
23
  "update": "node index update -i",
24
- "update:beta": "node index update -c beta -i",
25
- "update:central": "node index update -c central -i",
26
- "update:esr": "node index update -c esr -i",
27
- "update:mail": "node index update -c mail -i",
28
- "update:release": "node index update -c release -i"
24
+ "update:beta": "node index update --channel=beta -i",
25
+ "update:central": "node index update --channel=central -i",
26
+ "update:esr": "node index update --channel=esr -i",
27
+ "update:mail": "node index update --channel=mail -i",
28
+ "update:release": "node index update --channel=release -i"
29
29
  },
30
30
  "dependencies": {
31
31
  "camelize": "^1.0.0",
32
32
  "commander": "^9.0.0",
33
33
  "decamelize": "^6.0.0",
34
34
  "json5": "^2.2.0",
35
- "node-fetch": "^3.2.0",
35
+ "node-fetch": "^3.2.3",
36
36
  "sinon": "^13.0.1"
37
37
  },
38
38
  "devDependencies": {
@@ -41,12 +41,12 @@
41
41
  "eslint": "^7.32.0",
42
42
  "eslint-config-standard": "^16.0.3",
43
43
  "eslint-plugin-import": "^2.25.4",
44
- "eslint-plugin-jsdoc": "^37.8.2",
44
+ "eslint-plugin-jsdoc": "^37.9.7",
45
45
  "eslint-plugin-node": "^11.1.0",
46
46
  "eslint-plugin-promise": "^5.2.0",
47
- "mocha": "^9.2.0",
47
+ "mocha": "^9.2.2",
48
48
  "nock": "^13.2.4",
49
49
  "npm-run-all": "^4.1.5"
50
50
  },
51
- "version": "2.1.0"
51
+ "version": "2.1.3"
52
52
  }
@@ -15206,7 +15206,8 @@
15206
15206
  "s390x",
15207
15207
  "sparc64",
15208
15208
  "x86-32",
15209
- "x86-64"
15209
+ "x86-64",
15210
+ "noarch"
15210
15211
  ],
15211
15212
  "allowedContexts": [
15212
15213
  "content",
@@ -16028,6 +16029,65 @@
16028
16029
  "description": "Details specifying the target into which to inject the CSS."
16029
16030
  }
16030
16031
  }
16032
+ },
16033
+ {
16034
+ "id": "ContentScriptFilter",
16035
+ "type": "object",
16036
+ "properties": {
16037
+ "ids": {
16038
+ "type": "array",
16039
+ "optional": true,
16040
+ "description": "The IDs of specific scripts to retrieve with <code>getRegisteredContentScripts()</code> or to unregister with <code>unregisterContentScripts()</code>.",
16041
+ "items": {
16042
+ "type": "string"
16043
+ }
16044
+ }
16045
+ }
16046
+ },
16047
+ {
16048
+ "id": "RegisteredContentScript",
16049
+ "type": "object",
16050
+ "properties": {
16051
+ "allFrames": {
16052
+ "type": "boolean",
16053
+ "optional": true,
16054
+ "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."
16055
+ },
16056
+ "excludeMatches": {
16057
+ "type": "array",
16058
+ "optional": true,
16059
+ "description": "Excludes pages that this content script would otherwise be injected into.",
16060
+ "items": {
16061
+ "type": "string"
16062
+ }
16063
+ },
16064
+ "id": {
16065
+ "type": "string",
16066
+ "description": "The id of the content script, specified in the API call."
16067
+ },
16068
+ "js": {
16069
+ "type": "array",
16070
+ "optional": true,
16071
+ "description": "The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array.",
16072
+ "items": {
16073
+ "$ref": "manifest.ExtensionURL"
16074
+ }
16075
+ },
16076
+ "matches": {
16077
+ "type": "array",
16078
+ "optional": true,
16079
+ "description": "Specifies which pages this content script will be injected into. Must be specified for <code>registerContentScripts()</code>.",
16080
+ "items": {
16081
+ "type": "string"
16082
+ }
16083
+ },
16084
+ "runAt": {
16085
+ "$ref": "extensionTypes.RunAt",
16086
+ "optional": true,
16087
+ "default": "document_idle",
16088
+ "description": "Specifies when JavaScript files are injected into the web page. The preferred and default value is <code>document_idle</code>."
16089
+ }
16090
+ }
16031
16091
  }
16032
16092
  ],
16033
16093
  "functions": [
@@ -16095,6 +16155,76 @@
16095
16155
  "parameters": []
16096
16156
  }
16097
16157
  ]
16158
+ },
16159
+ {
16160
+ "name": "registerContentScripts",
16161
+ "type": "function",
16162
+ "description": "Registers one or more content scripts for this extension.",
16163
+ "async": "callback",
16164
+ "parameters": [
16165
+ {
16166
+ "name": "scripts",
16167
+ "type": "array",
16168
+ "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.",
16169
+ "items": {
16170
+ "$ref": "RegisteredContentScript"
16171
+ }
16172
+ },
16173
+ {
16174
+ "name": "callback",
16175
+ "type": "function",
16176
+ "description": "Invoked upon completion of the registration.",
16177
+ "parameters": []
16178
+ }
16179
+ ]
16180
+ },
16181
+ {
16182
+ "name": "getRegisteredContentScripts",
16183
+ "type": "function",
16184
+ "description": "Returns all dynamically registered content scripts for this extension that match the given filter.",
16185
+ "async": "callback",
16186
+ "parameters": [
16187
+ {
16188
+ "name": "filter",
16189
+ "$ref": "ContentScriptFilter",
16190
+ "optional": true,
16191
+ "description": "An object to filter the extension's dynamically registered scripts."
16192
+ },
16193
+ {
16194
+ "name": "callback",
16195
+ "type": "function",
16196
+ "description": "The resulting array contains the registered content scripts.",
16197
+ "parameters": [
16198
+ {
16199
+ "name": "scripts",
16200
+ "type": "array",
16201
+ "items": {
16202
+ "$ref": "RegisteredContentScript"
16203
+ }
16204
+ }
16205
+ ]
16206
+ }
16207
+ ]
16208
+ },
16209
+ {
16210
+ "name": "unregisterContentScripts",
16211
+ "type": "function",
16212
+ "description": "Unregisters one or more content scripts for this extension.",
16213
+ "async": "callback",
16214
+ "parameters": [
16215
+ {
16216
+ "name": "filter",
16217
+ "$ref": "ContentScriptFilter",
16218
+ "optional": true,
16219
+ "description": "If specified, only unregisters dynamic content scripts which match the filter. Otherwise, all of the extension's dynamic content scripts are unregistered."
16220
+ },
16221
+ {
16222
+ "name": "callback",
16223
+ "type": "function",
16224
+ "description": "Invoked upon completion of the unregistration.",
16225
+ "parameters": []
16226
+ }
16227
+ ]
16098
16228
  }
16099
16229
  ]
16100
16230
  }
@@ -13018,6 +13018,11 @@
13018
13018
  }
13019
13019
  ]
13020
13020
  },
13021
+ "granted_host_permissions": {
13022
+ "type": "boolean",
13023
+ "optional": true,
13024
+ "default": false
13025
+ },
13021
13026
  "host_permissions": {
13022
13027
  "min_manifest_version": 3,
13023
13028
  "type": "array",
@@ -14493,9 +14498,6 @@
14493
14498
  "permissions.json": [
14494
14499
  {
14495
14500
  "namespace": "permissions",
14496
- "permissions": [
14497
- "manifest:optional_permissions"
14498
- ],
14499
14501
  "types": [
14500
14502
  {
14501
14503
  "id": "Permissions",
@@ -15206,7 +15208,8 @@
15206
15208
  "s390x",
15207
15209
  "sparc64",
15208
15210
  "x86-32",
15209
- "x86-64"
15211
+ "x86-64",
15212
+ "noarch"
15210
15213
  ],
15211
15214
  "allowedContexts": [
15212
15215
  "content",
@@ -16028,6 +16031,72 @@
16028
16031
  "description": "Details specifying the target into which to inject the CSS."
16029
16032
  }
16030
16033
  }
16034
+ },
16035
+ {
16036
+ "id": "ContentScriptFilter",
16037
+ "type": "object",
16038
+ "properties": {
16039
+ "ids": {
16040
+ "type": "array",
16041
+ "optional": true,
16042
+ "description": "The IDs of specific scripts to retrieve with <code>getRegisteredContentScripts()</code> or to unregister with <code>unregisterContentScripts()</code>.",
16043
+ "items": {
16044
+ "type": "string"
16045
+ }
16046
+ }
16047
+ }
16048
+ },
16049
+ {
16050
+ "id": "RegisteredContentScript",
16051
+ "type": "object",
16052
+ "properties": {
16053
+ "allFrames": {
16054
+ "type": "boolean",
16055
+ "optional": true,
16056
+ "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."
16057
+ },
16058
+ "excludeMatches": {
16059
+ "type": "array",
16060
+ "optional": true,
16061
+ "description": "Excludes pages that this content script would otherwise be injected into.",
16062
+ "items": {
16063
+ "type": "string"
16064
+ }
16065
+ },
16066
+ "id": {
16067
+ "type": "string",
16068
+ "description": "The id of the content script, specified in the API call."
16069
+ },
16070
+ "js": {
16071
+ "type": "array",
16072
+ "optional": true,
16073
+ "description": "The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array.",
16074
+ "items": {
16075
+ "$ref": "manifest.ExtensionURL"
16076
+ }
16077
+ },
16078
+ "matches": {
16079
+ "type": "array",
16080
+ "optional": true,
16081
+ "description": "Specifies which pages this content script will be injected into. Must be specified for <code>registerContentScripts()</code>.",
16082
+ "items": {
16083
+ "type": "string"
16084
+ }
16085
+ },
16086
+ "runAt": {
16087
+ "$ref": "extensionTypes.RunAt",
16088
+ "optional": true,
16089
+ "default": "document_idle",
16090
+ "description": "Specifies when JavaScript files are injected into the web page. The preferred and default value is <code>document_idle</code>."
16091
+ },
16092
+ "persistAcrossSessions": {
16093
+ "type": "boolean",
16094
+ "enum": [
16095
+ false
16096
+ ],
16097
+ "description": "Specifies if this content script will persist into future sessions. This is currently NOT supported."
16098
+ }
16099
+ }
16031
16100
  }
16032
16101
  ],
16033
16102
  "functions": [
@@ -16095,6 +16164,76 @@
16095
16164
  "parameters": []
16096
16165
  }
16097
16166
  ]
16167
+ },
16168
+ {
16169
+ "name": "registerContentScripts",
16170
+ "type": "function",
16171
+ "description": "Registers one or more content scripts for this extension.",
16172
+ "async": "callback",
16173
+ "parameters": [
16174
+ {
16175
+ "name": "scripts",
16176
+ "type": "array",
16177
+ "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.",
16178
+ "items": {
16179
+ "$ref": "RegisteredContentScript"
16180
+ }
16181
+ },
16182
+ {
16183
+ "name": "callback",
16184
+ "type": "function",
16185
+ "description": "Invoked upon completion of the registration.",
16186
+ "parameters": []
16187
+ }
16188
+ ]
16189
+ },
16190
+ {
16191
+ "name": "getRegisteredContentScripts",
16192
+ "type": "function",
16193
+ "description": "Returns all dynamically registered content scripts for this extension that match the given filter.",
16194
+ "async": "callback",
16195
+ "parameters": [
16196
+ {
16197
+ "name": "filter",
16198
+ "$ref": "ContentScriptFilter",
16199
+ "optional": true,
16200
+ "description": "An object to filter the extension's dynamically registered scripts."
16201
+ },
16202
+ {
16203
+ "name": "callback",
16204
+ "type": "function",
16205
+ "description": "The resulting array contains the registered content scripts.",
16206
+ "parameters": [
16207
+ {
16208
+ "name": "scripts",
16209
+ "type": "array",
16210
+ "items": {
16211
+ "$ref": "RegisteredContentScript"
16212
+ }
16213
+ }
16214
+ ]
16215
+ }
16216
+ ]
16217
+ },
16218
+ {
16219
+ "name": "unregisterContentScripts",
16220
+ "type": "function",
16221
+ "description": "Unregisters one or more content scripts for this extension.",
16222
+ "async": "callback",
16223
+ "parameters": [
16224
+ {
16225
+ "name": "filter",
16226
+ "$ref": "ContentScriptFilter",
16227
+ "optional": true,
16228
+ "description": "If specified, only unregisters dynamic content scripts which match the filter. Otherwise, all of the extension's dynamic content scripts are unregistered."
16229
+ },
16230
+ {
16231
+ "name": "callback",
16232
+ "type": "function",
16233
+ "description": "Invoked upon completion of the unregistration.",
16234
+ "parameters": []
16235
+ }
16236
+ ]
16098
16237
  }
16099
16238
  ]
16100
16239
  }
@@ -1300,9 +1300,6 @@
1300
1300
  "permissions.json": [
1301
1301
  {
1302
1302
  "namespace": "permissions",
1303
- "permissions": [
1304
- "manifest:optional_permissions"
1305
- ],
1306
1303
  "types": [
1307
1304
  {
1308
1305
  "id": "Permissions",
@@ -1583,7 +1580,8 @@
1583
1580
  "s390x",
1584
1581
  "sparc64",
1585
1582
  "x86-32",
1586
- "x86-64"
1583
+ "x86-64",
1584
+ "noarch"
1587
1585
  ],
1588
1586
  "allowedContexts": [
1589
1587
  "content",