webext-schema 5.6.1 → 7.0.0
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/.github/FUNDING.yml +13 -0
- package/.github/workflows/node.js.yml +31 -0
- package/eslint.config.mjs +52 -0
- package/modules/browser.js +5 -5
- package/modules/common.js +7 -7
- package/modules/schema.js +3 -4
- package/modules/update.js +0 -9
- package/package.json +17 -19
- package/schemas/beta/webext.json +41 -166
- package/schemas/central/webext.json +35 -206
- package/schemas/mail/mailext.json +325 -97
- package/test/browser.test.js +3040 -0
- package/test/commander.test.js +134 -0
- package/test/common.test.js +120 -0
- package/test/constant.test.js +34 -0
- package/test/file/test 2.cmd +2 -0
- package/test/file/test 2.sh +2 -0
- package/test/file/test.cmd +2 -0
- package/test/file/test.js +1 -0
- package/test/file/test.sh +2 -0
- package/test/file/test.txt +1 -0
- package/test/file-util.test.js +370 -0
- package/test/index.test.js +13 -0
- package/test/mocha/setup.js +40 -0
- package/test/schema.test.js +1280 -0
- package/test/update.test.js +1022 -0
- package/types/modules/browser.d.ts +5 -5
- package/types/modules/common.d.ts +5 -5
- package/types/modules/update.d.ts +0 -1
- package/schemas/esr/webext.json +0 -21462
- package/schemas/release/webext.json +0 -22485
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# These are supported funding model platforms
|
|
2
|
+
|
|
3
|
+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
|
4
|
+
patreon: # Replace with a single Patreon username
|
|
5
|
+
open_collective: # Replace with a single Open Collective username
|
|
6
|
+
ko_fi: # Replace with a single Ko-fi username
|
|
7
|
+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
|
8
|
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
9
|
+
liberapay: # Replace with a single Liberapay username
|
|
10
|
+
issuehunt: # Replace with a single IssueHunt username
|
|
11
|
+
otechie: # Replace with a single Otechie username
|
|
12
|
+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
|
13
|
+
custom: ['https://paypal.me/asamuzakjp'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
3
|
+
|
|
4
|
+
name: build
|
|
5
|
+
permissions:
|
|
6
|
+
contents: read
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
branches: [ main ]
|
|
11
|
+
pull_request:
|
|
12
|
+
branches: [ main ]
|
|
13
|
+
release:
|
|
14
|
+
types: [ created ]
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
build:
|
|
18
|
+
strategy:
|
|
19
|
+
matrix:
|
|
20
|
+
node-version: [ 20.x, lts/*, latest ]
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v6
|
|
24
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
25
|
+
uses: actions/setup-node@v6
|
|
26
|
+
with:
|
|
27
|
+
node-version: ${{ matrix.node-version }}
|
|
28
|
+
check-latest: true
|
|
29
|
+
- run: npm ci
|
|
30
|
+
- run: npm run lint
|
|
31
|
+
- run: npm run testall
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import jsdoc from 'eslint-plugin-jsdoc';
|
|
2
|
+
import regexp from 'eslint-plugin-regexp';
|
|
3
|
+
import unicorn from 'eslint-plugin-unicorn';
|
|
4
|
+
import globals from 'globals';
|
|
5
|
+
import neostandard, { plugins as neostdplugins } from 'neostandard';
|
|
6
|
+
|
|
7
|
+
export default [
|
|
8
|
+
...neostandard({
|
|
9
|
+
semi: true
|
|
10
|
+
}),
|
|
11
|
+
jsdoc.configs['flat/recommended'],
|
|
12
|
+
regexp.configs['flat/recommended'],
|
|
13
|
+
{
|
|
14
|
+
languageOptions: {
|
|
15
|
+
globals: {
|
|
16
|
+
...globals.browser,
|
|
17
|
+
...globals.node,
|
|
18
|
+
...globals.webextensions
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
linterOptions: {
|
|
22
|
+
reportUnusedDisableDirectives: true
|
|
23
|
+
},
|
|
24
|
+
plugins: {
|
|
25
|
+
'@stylistic': neostdplugins['@stylistic'],
|
|
26
|
+
regexp,
|
|
27
|
+
unicorn
|
|
28
|
+
},
|
|
29
|
+
rules: {
|
|
30
|
+
'@stylistic/space-before-function-paren': ['error', {
|
|
31
|
+
anonymous: 'always',
|
|
32
|
+
asyncArrow: 'always',
|
|
33
|
+
named: 'never'
|
|
34
|
+
}],
|
|
35
|
+
'import-x/order': ['error', {
|
|
36
|
+
alphabetize: {
|
|
37
|
+
order: 'ignore',
|
|
38
|
+
caseInsensitive: false
|
|
39
|
+
}
|
|
40
|
+
}],
|
|
41
|
+
'no-await-in-loop': 'error',
|
|
42
|
+
'no-use-before-define': ['error', {
|
|
43
|
+
allowNamedExports: false,
|
|
44
|
+
classes: true,
|
|
45
|
+
functions: true,
|
|
46
|
+
variables: true
|
|
47
|
+
}],
|
|
48
|
+
'prefer-object-has-own': 'error',
|
|
49
|
+
'unicorn/prefer-node-protocol': 'error'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
];
|
package/modules/browser.js
CHANGED
|
@@ -428,7 +428,7 @@ export const makeConnection = async (id, info) => {
|
|
|
428
428
|
/**
|
|
429
429
|
* send message
|
|
430
430
|
* @param {number|string} id - tab ID / extension ID
|
|
431
|
-
* @param {
|
|
431
|
+
* @param {string|Array|object} msg - message
|
|
432
432
|
* @param {object} opt - options
|
|
433
433
|
* @returns {Promise.<object>} - tabs.sendMessage() | runtime.sendMessage()
|
|
434
434
|
*/
|
|
@@ -679,7 +679,7 @@ export const getAllStorage = async (area = 'local') => {
|
|
|
679
679
|
|
|
680
680
|
/**
|
|
681
681
|
* get storage
|
|
682
|
-
* @param {
|
|
682
|
+
* @param {string|Array|object} key - key
|
|
683
683
|
* @param {string} area - storage area
|
|
684
684
|
* @returns {Promise.<object>} - stored data
|
|
685
685
|
*/
|
|
@@ -698,7 +698,7 @@ export const getStorage = async (key, area = 'local') => {
|
|
|
698
698
|
|
|
699
699
|
/**
|
|
700
700
|
* remove storage
|
|
701
|
-
* @param {
|
|
701
|
+
* @param {string|Array|object} key - key
|
|
702
702
|
* @param {string} area - storage area
|
|
703
703
|
* @returns {Promise.<void>} - void
|
|
704
704
|
*/
|
|
@@ -814,7 +814,7 @@ export const execScriptToTabs = async (opt = {}) => {
|
|
|
814
814
|
* execute scripts to tab in order
|
|
815
815
|
* @param {number|Array} tabId - tabId or array of options
|
|
816
816
|
* @param {Array} opts - array of options
|
|
817
|
-
* @returns {Promise
|
|
817
|
+
* @returns {Promise.<?Array|boolean>} - result of the last executed script
|
|
818
818
|
*/
|
|
819
819
|
export const execScriptsToTabInOrder = async (tabId, opts = []) => {
|
|
820
820
|
const func = [];
|
|
@@ -1058,7 +1058,7 @@ export const captureVisibleTab = async (windowId, opt) => {
|
|
|
1058
1058
|
|
|
1059
1059
|
/**
|
|
1060
1060
|
* is tab
|
|
1061
|
-
* @param {
|
|
1061
|
+
* @param {number} tabId - tab ID
|
|
1062
1062
|
* @returns {Promise.<boolean>} - result
|
|
1063
1063
|
*/
|
|
1064
1064
|
export const isTab = async tabId => {
|
package/modules/common.js
CHANGED
|
@@ -9,7 +9,7 @@ const TYPE_TO = -1;
|
|
|
9
9
|
/**
|
|
10
10
|
* throw error
|
|
11
11
|
* @param {!object} e - Error
|
|
12
|
-
* @throws - Error
|
|
12
|
+
* @throws {Error} - Error
|
|
13
13
|
*/
|
|
14
14
|
export const throwErr = e => {
|
|
15
15
|
throw e;
|
|
@@ -27,7 +27,7 @@ export const logErr = e => {
|
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* log warn
|
|
30
|
-
* @param {
|
|
30
|
+
* @param {string|object} msg - message
|
|
31
31
|
* @returns {boolean} - false
|
|
32
32
|
*/
|
|
33
33
|
export const logWarn = msg => {
|
|
@@ -37,8 +37,8 @@ export const logWarn = msg => {
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* log message
|
|
40
|
-
* @param {
|
|
41
|
-
* @returns {
|
|
40
|
+
* @param {string|object} msg - message
|
|
41
|
+
* @returns {string|object} - message
|
|
42
42
|
*/
|
|
43
43
|
export const logMsg = msg => {
|
|
44
44
|
msg && console.log(msg);
|
|
@@ -47,7 +47,7 @@ export const logMsg = msg => {
|
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* get type
|
|
50
|
-
* @param {
|
|
50
|
+
* @param {object} o - object to check
|
|
51
51
|
* @returns {string} - type of object
|
|
52
52
|
*/
|
|
53
53
|
export const getType = o =>
|
|
@@ -55,7 +55,7 @@ export const getType = o =>
|
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* is object, and not an empty object
|
|
58
|
-
* @param {
|
|
58
|
+
* @param {object} o - object to check;
|
|
59
59
|
* @returns {boolean} - result
|
|
60
60
|
*/
|
|
61
61
|
export const isObjectNotEmpty = o => {
|
|
@@ -65,7 +65,7 @@ export const isObjectNotEmpty = o => {
|
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* is string
|
|
68
|
-
* @param {
|
|
68
|
+
* @param {object} o - object to check
|
|
69
69
|
* @returns {boolean} - result
|
|
70
70
|
*/
|
|
71
71
|
export const isString = o => typeof o === 'string' || o instanceof String;
|
package/modules/schema.js
CHANGED
|
@@ -22,14 +22,13 @@ export class Schema {
|
|
|
22
22
|
* construct
|
|
23
23
|
* @param {...(string|object)} [args] - optional arguments
|
|
24
24
|
* {string} - release channel.
|
|
25
|
-
*
|
|
26
|
-
* "release", "esr", "mail".
|
|
25
|
+
* "beta", "central", "mail".
|
|
27
26
|
* {object} - sinon config
|
|
28
27
|
*/
|
|
29
28
|
constructor(...args) {
|
|
30
29
|
const [arg1, arg2] = args;
|
|
31
30
|
this.#channel =
|
|
32
|
-
isString(arg1) &&
|
|
31
|
+
isString(arg1) && /^(?:central|mail)$/.test(arg1)
|
|
33
32
|
? arg1
|
|
34
33
|
: 'beta';
|
|
35
34
|
this._sandbox =
|
|
@@ -48,7 +47,7 @@ export class Schema {
|
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
set channel(ch) {
|
|
51
|
-
if (isString(ch) &&
|
|
50
|
+
if (isString(ch) && /^(?:central|mail|beta)$/.test(ch)) {
|
|
52
51
|
this.#channel = ch;
|
|
53
52
|
}
|
|
54
53
|
}
|
package/modules/update.js
CHANGED
|
@@ -14,7 +14,6 @@ import { createFile } from './file-util.js';
|
|
|
14
14
|
import { CHAR, INDENT } from './constant.js';
|
|
15
15
|
const DIR_CWD = process.cwd();
|
|
16
16
|
const PERM_FILE = 0o644;
|
|
17
|
-
export const ESR_VER = 115;
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
19
|
* fetch text
|
|
@@ -45,15 +44,9 @@ export const getChannelUrl = channel => {
|
|
|
45
44
|
case 'central':
|
|
46
45
|
dir = 'mozilla-central/';
|
|
47
46
|
break;
|
|
48
|
-
case 'esr':
|
|
49
|
-
dir = `releases/mozilla-esr${ESR_VER}/`;
|
|
50
|
-
break;
|
|
51
47
|
case 'mail':
|
|
52
48
|
dir = 'comm-central/';
|
|
53
49
|
break;
|
|
54
|
-
case 'release':
|
|
55
|
-
dir = 'releases/mozilla-release/';
|
|
56
|
-
break;
|
|
57
50
|
default:
|
|
58
51
|
dir = 'releases/mozilla-beta/';
|
|
59
52
|
}
|
|
@@ -277,8 +270,6 @@ export const updateSchemas = async (cmdOpts = {}) => {
|
|
|
277
270
|
func.push(
|
|
278
271
|
saveSchemaFile('beta', info),
|
|
279
272
|
saveSchemaFile('central', info),
|
|
280
|
-
saveSchemaFile('esr', info),
|
|
281
|
-
saveSchemaFile('release', info),
|
|
282
273
|
saveSchemaFile('mail', info)
|
|
283
274
|
);
|
|
284
275
|
}
|
package/package.json
CHANGED
|
@@ -19,26 +19,26 @@
|
|
|
19
19
|
"types": "types/index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"camelize": "^1.0.1",
|
|
22
|
-
"commander": "^14.0.
|
|
23
|
-
"decamelize": "^6.0.
|
|
22
|
+
"commander": "^14.0.2",
|
|
23
|
+
"decamelize": "^6.0.1",
|
|
24
24
|
"json5": "^2.2.3",
|
|
25
|
-
"sinon": "^21.0.
|
|
25
|
+
"sinon": "^21.0.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@types/firefox-webext-browser": "^
|
|
29
|
-
"@types/node": "^
|
|
30
|
-
"@types/sinon": "^
|
|
28
|
+
"@types/firefox-webext-browser": "^143.0.0",
|
|
29
|
+
"@types/node": "^25.0.9",
|
|
30
|
+
"@types/sinon": "^21.0.0",
|
|
31
31
|
"c8": "^10.1.3",
|
|
32
|
-
"eslint": "^9.
|
|
33
|
-
"eslint-plugin-jsdoc": "^
|
|
34
|
-
"eslint-plugin-regexp": "^2.
|
|
35
|
-
"eslint-plugin-unicorn": "^
|
|
36
|
-
"globals": "^
|
|
37
|
-
"mocha": "^11.7.
|
|
32
|
+
"eslint": "^9.39.2",
|
|
33
|
+
"eslint-plugin-jsdoc": "^62.1.0",
|
|
34
|
+
"eslint-plugin-regexp": "^2.10.0",
|
|
35
|
+
"eslint-plugin-unicorn": "^62.0.0",
|
|
36
|
+
"globals": "^17.0.0",
|
|
37
|
+
"mocha": "^11.7.5",
|
|
38
38
|
"neostandard": "^0.12.2",
|
|
39
39
|
"npm-run-all2": "^8.0.4",
|
|
40
|
-
"typescript": "^5.9.
|
|
41
|
-
"undici": "^7.
|
|
40
|
+
"typescript": "^5.9.3",
|
|
41
|
+
"undici": "^7.18.2"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "npm run tsc && npm run lint && npm run test",
|
|
@@ -51,12 +51,10 @@
|
|
|
51
51
|
"test:release": "c8 mocha --require=test/mocha/setup.js --channel=release --exit test/*.test.js",
|
|
52
52
|
"testall": "npm-run-all -s test:*",
|
|
53
53
|
"tsc": "node index clean --dir=types -i && npx tsc",
|
|
54
|
-
"update": "
|
|
54
|
+
"update": "npm-run-all -s update:*",
|
|
55
55
|
"update:beta": "node index update --channel=beta -i",
|
|
56
56
|
"update:central": "node index update --channel=central -i",
|
|
57
|
-
"update:
|
|
58
|
-
"update:mail": "node index update --channel=mail -i",
|
|
59
|
-
"update:release": "node index update --channel=release -i"
|
|
57
|
+
"update:mail": "node index update --channel=mail -i"
|
|
60
58
|
},
|
|
61
|
-
"version": "
|
|
59
|
+
"version": "7.0.0"
|
|
62
60
|
}
|
package/schemas/beta/webext.json
CHANGED
|
@@ -6447,6 +6447,12 @@
|
|
|
6447
6447
|
],
|
|
6448
6448
|
"description": "The tab's new favicon URL. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission."
|
|
6449
6449
|
},
|
|
6450
|
+
"groupId": {
|
|
6451
|
+
"type": "integer",
|
|
6452
|
+
"optional": true,
|
|
6453
|
+
"minimum": -1,
|
|
6454
|
+
"description": "The tab's new group ID. $(ref:tabGroups.TAB_GROUP_ID_NONE) (-1) if the tab no longer belongs to a tab group."
|
|
6455
|
+
},
|
|
6450
6456
|
"hidden": {
|
|
6451
6457
|
"type": "boolean",
|
|
6452
6458
|
"optional": true,
|
|
@@ -9116,6 +9122,11 @@
|
|
|
9116
9122
|
"optional": true,
|
|
9117
9123
|
"description": "The JavaScript world for a script to execute within. Defaults to \"ISOLATED\"."
|
|
9118
9124
|
},
|
|
9125
|
+
"cssOrigin": {
|
|
9126
|
+
"$ref": "extensionTypes.CSSOrigin",
|
|
9127
|
+
"optional": true,
|
|
9128
|
+
"description": "The css origin of the stylesheet to inject. Defaults to \"author\"."
|
|
9129
|
+
},
|
|
9119
9130
|
"cookieStoreId": {
|
|
9120
9131
|
"choices": [
|
|
9121
9132
|
{
|
|
@@ -12564,7 +12575,8 @@
|
|
|
12564
12575
|
"user",
|
|
12565
12576
|
"author"
|
|
12566
12577
|
],
|
|
12567
|
-
"description": "The origin of the CSS to inject, this affects the cascading order (priority) of the stylesheet."
|
|
12578
|
+
"description": "The origin of the CSS to inject, this affects the cascading order (priority) of the stylesheet.",
|
|
12579
|
+
"preprocess": "stringToLowerCase"
|
|
12568
12580
|
},
|
|
12569
12581
|
{
|
|
12570
12582
|
"id": "InjectDetails",
|
|
@@ -12606,6 +12618,7 @@
|
|
|
12606
12618
|
"cssOrigin": {
|
|
12607
12619
|
"$ref": "CSSOrigin",
|
|
12608
12620
|
"optional": true,
|
|
12621
|
+
"default": "author",
|
|
12609
12622
|
"description": "The css origin of the stylesheet to inject. Defaults to \"author\"."
|
|
12610
12623
|
}
|
|
12611
12624
|
}
|
|
@@ -12824,7 +12837,8 @@
|
|
|
12824
12837
|
"memory",
|
|
12825
12838
|
"tracing",
|
|
12826
12839
|
"sandbox",
|
|
12827
|
-
"flows"
|
|
12840
|
+
"flows",
|
|
12841
|
+
"jssources"
|
|
12828
12842
|
]
|
|
12829
12843
|
},
|
|
12830
12844
|
{
|
|
@@ -13503,7 +13517,7 @@
|
|
|
13503
13517
|
},
|
|
13504
13518
|
{
|
|
13505
13519
|
"id": "ExtensionInstallType",
|
|
13506
|
-
"description": "How the extension was installed
|
|
13520
|
+
"description": "How the extension was installed.<dl><dt>development</dt><dd>The extension was loaded unpacked in developer mode,</dd><dt>normal</dt><dd>The extension was installed normally via an .xpi file</dd><dt>sideload</dt><dd>The extension was installed by other software on the machine</dd><dt>admin</dt><dd>The extension was installed by policy</dd><dt>other</dt><dd>The extension was installed by other means.</dd></dl>",
|
|
13507
13521
|
"type": "string",
|
|
13508
13522
|
"enum": [
|
|
13509
13523
|
"development",
|
|
@@ -13854,8 +13868,7 @@
|
|
|
13854
13868
|
"manifest_version": {
|
|
13855
13869
|
"type": "integer",
|
|
13856
13870
|
"minimum": 2,
|
|
13857
|
-
"maximum": 3
|
|
13858
|
-
"postprocess": "manifestVersionCheck"
|
|
13871
|
+
"maximum": 3
|
|
13859
13872
|
},
|
|
13860
13873
|
"applications": {
|
|
13861
13874
|
"$ref": "DeprecatedApplications",
|
|
@@ -14552,6 +14565,9 @@
|
|
|
14552
14565
|
"optional": true,
|
|
14553
14566
|
"default": false
|
|
14554
14567
|
}
|
|
14568
|
+
},
|
|
14569
|
+
"additionalProperties": {
|
|
14570
|
+
"$ref": "UnrecognizedProperty"
|
|
14555
14571
|
}
|
|
14556
14572
|
}
|
|
14557
14573
|
},
|
|
@@ -14698,6 +14714,11 @@
|
|
|
14698
14714
|
"$ref": "ExtensionURL"
|
|
14699
14715
|
}
|
|
14700
14716
|
},
|
|
14717
|
+
"css_origin": {
|
|
14718
|
+
"$ref": "extensionTypes.CSSOrigin",
|
|
14719
|
+
"default": "author",
|
|
14720
|
+
"optional": true
|
|
14721
|
+
},
|
|
14701
14722
|
"js": {
|
|
14702
14723
|
"type": "array",
|
|
14703
14724
|
"optional": true,
|
|
@@ -16600,6 +16621,7 @@
|
|
|
16600
16621
|
"aarch64",
|
|
16601
16622
|
"arm",
|
|
16602
16623
|
"ppc64",
|
|
16624
|
+
"riscv64",
|
|
16603
16625
|
"s390x",
|
|
16604
16626
|
"sparc64",
|
|
16605
16627
|
"x86-32",
|
|
@@ -16976,7 +16998,7 @@
|
|
|
16976
16998
|
],
|
|
16977
16999
|
"returns": {
|
|
16978
17000
|
"$ref": "Port",
|
|
16979
|
-
"description": "Port through which messages can be sent and received. The port's $(ref:runtime.Port
|
|
17001
|
+
"description": "Port through which messages can be sent and received. The port's $(ref:runtime.Port.onDisconnect) event is fired if the extension/app does not exist. "
|
|
16980
17002
|
}
|
|
16981
17003
|
},
|
|
16982
17004
|
{
|
|
@@ -17632,6 +17654,10 @@
|
|
|
17632
17654
|
"items": {
|
|
17633
17655
|
"$ref": "manifest.ExtensionURL"
|
|
17634
17656
|
}
|
|
17657
|
+
},
|
|
17658
|
+
"cssOrigin": {
|
|
17659
|
+
"$ref": "extensionTypes.CSSOrigin",
|
|
17660
|
+
"optional": true
|
|
17635
17661
|
}
|
|
17636
17662
|
}
|
|
17637
17663
|
}
|
|
@@ -17889,7 +17915,6 @@
|
|
|
17889
17915
|
},
|
|
17890
17916
|
{
|
|
17891
17917
|
"name": "getBytesInUse",
|
|
17892
|
-
"unsupported": true,
|
|
17893
17918
|
"type": "function",
|
|
17894
17919
|
"description": "Gets the amount of space (in bytes) being used by one or more items.",
|
|
17895
17920
|
"async": "callback",
|
|
@@ -17925,173 +17950,23 @@
|
|
|
17925
17950
|
]
|
|
17926
17951
|
},
|
|
17927
17952
|
{
|
|
17928
|
-
"name": "
|
|
17929
|
-
"type": "function",
|
|
17930
|
-
"description": "Sets multiple items.",
|
|
17931
|
-
"async": "callback",
|
|
17932
|
-
"parameters": [
|
|
17933
|
-
{
|
|
17934
|
-
"name": "items",
|
|
17935
|
-
"type": "object",
|
|
17936
|
-
"additionalProperties": {
|
|
17937
|
-
"type": "any"
|
|
17938
|
-
},
|
|
17939
|
-
"description": "<p>An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected.</p><p>Primitive values such as numbers will serialize as expected. Values with a <code>typeof</code> <code>\"object\"</code> and <code>\"function\"</code> will typically serialize to <code>{}</code>, with the exception of <code>Array</code> (serializes as expected), <code>Date</code>, and <code>Regex</code> (serialize using their <code>String</code> representation).</p>"
|
|
17940
|
-
},
|
|
17941
|
-
{
|
|
17942
|
-
"name": "callback",
|
|
17943
|
-
"type": "function",
|
|
17944
|
-
"description": "Callback on success, or on failure (in which case $(ref:runtime.lastError) will be set).",
|
|
17945
|
-
"parameters": [],
|
|
17946
|
-
"optional": true
|
|
17947
|
-
}
|
|
17948
|
-
]
|
|
17949
|
-
},
|
|
17950
|
-
{
|
|
17951
|
-
"name": "remove",
|
|
17952
|
-
"type": "function",
|
|
17953
|
-
"description": "Removes one or more items from storage.",
|
|
17954
|
-
"async": "callback",
|
|
17955
|
-
"parameters": [
|
|
17956
|
-
{
|
|
17957
|
-
"name": "keys",
|
|
17958
|
-
"choices": [
|
|
17959
|
-
{
|
|
17960
|
-
"type": "string"
|
|
17961
|
-
},
|
|
17962
|
-
{
|
|
17963
|
-
"type": "array",
|
|
17964
|
-
"items": {
|
|
17965
|
-
"type": "string"
|
|
17966
|
-
}
|
|
17967
|
-
}
|
|
17968
|
-
],
|
|
17969
|
-
"description": "A single key or a list of keys for items to remove."
|
|
17970
|
-
},
|
|
17971
|
-
{
|
|
17972
|
-
"name": "callback",
|
|
17973
|
-
"type": "function",
|
|
17974
|
-
"description": "Callback on success, or on failure (in which case $(ref:runtime.lastError) will be set).",
|
|
17975
|
-
"parameters": [],
|
|
17976
|
-
"optional": true
|
|
17977
|
-
}
|
|
17978
|
-
]
|
|
17979
|
-
},
|
|
17980
|
-
{
|
|
17981
|
-
"name": "clear",
|
|
17982
|
-
"type": "function",
|
|
17983
|
-
"description": "Removes all items from storage.",
|
|
17984
|
-
"async": "callback",
|
|
17985
|
-
"parameters": [
|
|
17986
|
-
{
|
|
17987
|
-
"name": "callback",
|
|
17988
|
-
"type": "function",
|
|
17989
|
-
"description": "Callback on success, or on failure (in which case $(ref:runtime.lastError) will be set).",
|
|
17990
|
-
"parameters": [],
|
|
17991
|
-
"optional": true
|
|
17992
|
-
}
|
|
17993
|
-
]
|
|
17994
|
-
}
|
|
17995
|
-
],
|
|
17996
|
-
"events": [
|
|
17997
|
-
{
|
|
17998
|
-
"name": "onChanged",
|
|
17999
|
-
"type": "function",
|
|
18000
|
-
"description": "Fired when one or more items change.",
|
|
18001
|
-
"parameters": [
|
|
18002
|
-
{
|
|
18003
|
-
"name": "changes",
|
|
18004
|
-
"type": "object",
|
|
18005
|
-
"additionalProperties": {
|
|
18006
|
-
"$ref": "StorageChange"
|
|
18007
|
-
},
|
|
18008
|
-
"description": "Object mapping each key that changed to its corresponding $(ref:storage.StorageChange) for that item."
|
|
18009
|
-
}
|
|
18010
|
-
]
|
|
18011
|
-
}
|
|
18012
|
-
]
|
|
18013
|
-
},
|
|
18014
|
-
{
|
|
18015
|
-
"id": "StorageAreaWithUsage",
|
|
18016
|
-
"type": "object",
|
|
18017
|
-
"functions": [
|
|
18018
|
-
{
|
|
18019
|
-
"name": "get",
|
|
17953
|
+
"name": "getKeys",
|
|
18020
17954
|
"type": "function",
|
|
18021
|
-
"description": "Gets
|
|
17955
|
+
"description": "Gets the keys of all items in storage.",
|
|
18022
17956
|
"async": "callback",
|
|
18023
17957
|
"parameters": [
|
|
18024
|
-
{
|
|
18025
|
-
"name": "keys",
|
|
18026
|
-
"choices": [
|
|
18027
|
-
{
|
|
18028
|
-
"type": "string"
|
|
18029
|
-
},
|
|
18030
|
-
{
|
|
18031
|
-
"type": "array",
|
|
18032
|
-
"items": {
|
|
18033
|
-
"type": "string"
|
|
18034
|
-
}
|
|
18035
|
-
},
|
|
18036
|
-
{
|
|
18037
|
-
"type": "object",
|
|
18038
|
-
"description": "Storage items to return in the callback, where the values are replaced with those from storage if they exist.",
|
|
18039
|
-
"additionalProperties": {
|
|
18040
|
-
"type": "any"
|
|
18041
|
-
}
|
|
18042
|
-
}
|
|
18043
|
-
],
|
|
18044
|
-
"description": "A single key to get, list of keys to get, or a dictionary specifying default values (see description of the object). An empty list or object will return an empty result object. Pass in <code>null</code> to get the entire contents of storage.",
|
|
18045
|
-
"optional": true
|
|
18046
|
-
},
|
|
18047
17958
|
{
|
|
18048
17959
|
"name": "callback",
|
|
18049
17960
|
"type": "function",
|
|
18050
|
-
"description": "Callback with
|
|
17961
|
+
"description": "Callback with the keys of all items in storage, or on failure (in which case $(ref:runtime.lastError) will be set).",
|
|
18051
17962
|
"parameters": [
|
|
18052
17963
|
{
|
|
18053
|
-
"name": "
|
|
18054
|
-
"type": "object",
|
|
18055
|
-
"additionalProperties": {
|
|
18056
|
-
"type": "any"
|
|
18057
|
-
},
|
|
18058
|
-
"description": "Object with items in their key-value mappings."
|
|
18059
|
-
}
|
|
18060
|
-
]
|
|
18061
|
-
}
|
|
18062
|
-
]
|
|
18063
|
-
},
|
|
18064
|
-
{
|
|
18065
|
-
"name": "getBytesInUse",
|
|
18066
|
-
"type": "function",
|
|
18067
|
-
"description": "Gets the amount of space (in bytes) being used by one or more items.",
|
|
18068
|
-
"async": "callback",
|
|
18069
|
-
"parameters": [
|
|
18070
|
-
{
|
|
18071
|
-
"name": "keys",
|
|
18072
|
-
"choices": [
|
|
18073
|
-
{
|
|
18074
|
-
"type": "string"
|
|
18075
|
-
},
|
|
18076
|
-
{
|
|
17964
|
+
"name": "keys",
|
|
18077
17965
|
"type": "array",
|
|
18078
17966
|
"items": {
|
|
18079
17967
|
"type": "string"
|
|
18080
|
-
}
|
|
18081
|
-
|
|
18082
|
-
],
|
|
18083
|
-
"description": "A single key or list of keys to get the total usage for. An empty list will return 0. Pass in <code>null</code> to get the total usage of all of storage.",
|
|
18084
|
-
"optional": true
|
|
18085
|
-
},
|
|
18086
|
-
{
|
|
18087
|
-
"name": "callback",
|
|
18088
|
-
"type": "function",
|
|
18089
|
-
"description": "Callback with the amount of space being used by storage, or on failure (in which case $(ref:runtime.lastError) will be set).",
|
|
18090
|
-
"parameters": [
|
|
18091
|
-
{
|
|
18092
|
-
"name": "bytesInUse",
|
|
18093
|
-
"type": "integer",
|
|
18094
|
-
"description": "Amount of space being used in storage, in bytes."
|
|
17968
|
+
},
|
|
17969
|
+
"description": "The keys of all items in storage."
|
|
18095
17970
|
}
|
|
18096
17971
|
]
|
|
18097
17972
|
}
|
|
@@ -18202,14 +18077,14 @@
|
|
|
18202
18077
|
{
|
|
18203
18078
|
"name": "areaName",
|
|
18204
18079
|
"type": "string",
|
|
18205
|
-
"description": "The name of the storage area (<code>\"sync\"</code>, <code>\"local\"</code> or <code>\"managed\"</code>) the changes are for."
|
|
18080
|
+
"description": "The name of the storage area (<code>\"session\"</code>, <code>\"sync\"</code>, <code>\"local\"</code> or <code>\"managed\"</code>) the changes are for."
|
|
18206
18081
|
}
|
|
18207
18082
|
]
|
|
18208
18083
|
}
|
|
18209
18084
|
],
|
|
18210
18085
|
"properties": {
|
|
18211
18086
|
"sync": {
|
|
18212
|
-
"$ref": "
|
|
18087
|
+
"$ref": "StorageArea",
|
|
18213
18088
|
"description": "Items in the <code>sync</code> storage area are synced by the browser.",
|
|
18214
18089
|
"properties": {
|
|
18215
18090
|
"QUOTA_BYTES": {
|
|
@@ -18263,7 +18138,7 @@
|
|
|
18263
18138
|
"allowedContexts": [
|
|
18264
18139
|
"devtools"
|
|
18265
18140
|
],
|
|
18266
|
-
"$ref": "
|
|
18141
|
+
"$ref": "StorageArea",
|
|
18267
18142
|
"description": "Items in the <code>session</code> storage area are kept in memory, and only until the either browser or extension is closed or reloaded.",
|
|
18268
18143
|
"properties": {
|
|
18269
18144
|
"QUOTA_BYTES": {
|