diff --git a/interfaces/firefox/LICENSE.md b/interfaces/firefox/LICENSE.md
new file mode 100644
index 00000000..8bffb355
--- /dev/null
+++ b/interfaces/firefox/LICENSE.md
@@ -0,0 +1,24 @@
+This source code is available under licenses which are both [free]
+and [open source].
+
+More specifically, most of the source code is available under the
+[Mozilla Public License 2.0][MPL].
+
+Additionally, parts of the schema files originated from Chromium
+source code:
+
+> Copyright (c) 2012 The Chromium Authors. All rights reserved.
+> Use of this source code is governed by a BSD-style license that can be
+> found in the [LICENSE][CHROMIUM] file.
+
+You are not granted rights or licenses to the trademarks of the
+Mozilla Foundation or any party, including without limitation the
+Firefox name or logo.
+
+For more information, see:
+http://www.mozilla.org/foundation/licensing.html
+
+[free]: https://www.gnu.org/philosophy/free-sw.html
+[open source]: https://www.opensource.org/docs/definition.php
+[CHROMIUM]: schemas/LICENSE-CHROMIUM
+[MPL]: schemas/LICENSE-MPL
diff --git a/interfaces/firefox/README.md b/interfaces/firefox/README.md
new file mode 100644
index 00000000..5ffb48cf
--- /dev/null
+++ b/interfaces/firefox/README.md
@@ -0,0 +1,11 @@
+Thes directory contains a 2023Q1 snapshot of most JSON Schema files used
+in Firefox.
+
+It includes APIs that are already supported across browsers, and those we
+believe might be of interest to other browsers. We omitted APIs which are
+considered internal to Firefox.
+
+The full and up to date list can always be found using this query from
+[mozilla-central](https://searchfox.org/mozilla-central/search?path=extensions/schemas).
+
+See [LICENSE](LICENSE.md) for copyright details.
diff --git a/interfaces/firefox/schemas/LICENSE-CHROMIUM b/interfaces/firefox/schemas/LICENSE-CHROMIUM
new file mode 100644
index 00000000..9314092f
--- /dev/null
+++ b/interfaces/firefox/schemas/LICENSE-CHROMIUM
@@ -0,0 +1,27 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/interfaces/firefox/schemas/LICENSE-MPL b/interfaces/firefox/schemas/LICENSE-MPL
new file mode 100644
index 00000000..e87a115e
--- /dev/null
+++ b/interfaces/firefox/schemas/LICENSE-MPL
@@ -0,0 +1,363 @@
+Mozilla Public License, version 2.0
+
+1. Definitions
+
+1.1. "Contributor"
+
+ means each individual or legal entity that creates, contributes to the
+ creation of, or owns Covered Software.
+
+1.2. "Contributor Version"
+
+ means the combination of the Contributions of others (if any) used by a
+ Contributor and that particular Contributor's Contribution.
+
+1.3. "Contribution"
+
+ means Covered Software of a particular Contributor.
+
+1.4. "Covered Software"
+
+ means Source Code Form to which the initial Contributor has attached the
+ notice in Exhibit A, the Executable Form of such Source Code Form, and
+ Modifications of such Source Code Form, in each case including portions
+ thereof.
+
+1.5. "Incompatible With Secondary Licenses"
+ means
+
+ a. that the initial Contributor has attached the notice described in
+ Exhibit B to the Covered Software; or
+
+ b. that the Covered Software was made available under the terms of
+ version 1.1 or earlier of the License, but not also under the terms of
+ a Secondary License.
+
+1.6. "Executable Form"
+
+ means any form of the work other than Source Code Form.
+
+1.7. "Larger Work"
+
+ means a work that combines Covered Software with other material, in a
+ separate file or files, that is not Covered Software.
+
+1.8. "License"
+
+ means this document.
+
+1.9. "Licensable"
+
+ means having the right to grant, to the maximum extent possible, whether
+ at the time of the initial grant or subsequently, any and all of the
+ rights conveyed by this License.
+
+1.10. "Modifications"
+
+ means any of the following:
+
+ a. any file in Source Code Form that results from an addition to,
+ deletion from, or modification of the contents of Covered Software; or
+
+ b. any new file in Source Code Form that contains any Covered Software.
+
+1.11. "Patent Claims" of a Contributor
+
+ means any patent claim(s), including without limitation, method,
+ process, and apparatus claims, in any patent Licensable by such
+ Contributor that would be infringed, but for the grant of the License,
+ by the making, using, selling, offering for sale, having made, import,
+ or transfer of either its Contributions or its Contributor Version.
+
+1.12. "Secondary License"
+
+ means either the GNU General Public License, Version 2.0, the GNU Lesser
+ General Public License, Version 2.1, the GNU Affero General Public
+ License, Version 3.0, or any later versions of those licenses.
+
+1.13. "Source Code Form"
+
+ means the form of the work preferred for making modifications.
+
+1.14. "You" (or "Your")
+
+ means an individual or a legal entity exercising rights under this
+ License. For legal entities, "You" includes any entity that controls, is
+ controlled by, or is under common control with You. For purposes of this
+ definition, "control" means (a) the power, direct or indirect, to cause
+ the direction or management of such entity, whether by contract or
+ otherwise, or (b) ownership of more than fifty percent (50%) of the
+ outstanding shares or beneficial ownership of such entity.
+
+
+2. License Grants and Conditions
+
+2.1. Grants
+
+ Each Contributor hereby grants You a world-wide, royalty-free,
+ non-exclusive license:
+
+ a. under intellectual property rights (other than patent or trademark)
+ Licensable by such Contributor to use, reproduce, make available,
+ modify, display, perform, distribute, and otherwise exploit its
+ Contributions, either on an unmodified basis, with Modifications, or
+ as part of a Larger Work; and
+
+ b. under Patent Claims of such Contributor to make, use, sell, offer for
+ sale, have made, import, and otherwise transfer either its
+ Contributions or its Contributor Version.
+
+2.2. Effective Date
+
+ The licenses granted in Section 2.1 with respect to any Contribution
+ become effective for each Contribution on the date the Contributor first
+ distributes such Contribution.
+
+2.3. Limitations on Grant Scope
+
+ The licenses granted in this Section 2 are the only rights granted under
+ this License. No additional rights or licenses will be implied from the
+ distribution or licensing of Covered Software under this License.
+ Notwithstanding Section 2.1(b) above, no patent license is granted by a
+ Contributor:
+
+ a. for any code that a Contributor has removed from Covered Software; or
+
+ b. for infringements caused by: (i) Your and any other third party's
+ modifications of Covered Software, or (ii) the combination of its
+ Contributions with other software (except as part of its Contributor
+ Version); or
+
+ c. under Patent Claims infringed by Covered Software in the absence of
+ its Contributions.
+
+ This License does not grant any rights in the trademarks, service marks,
+ or logos of any Contributor (except as may be necessary to comply with
+ the notice requirements in Section 3.4).
+
+2.4. Subsequent Licenses
+
+ No Contributor makes additional grants as a result of Your choice to
+ distribute the Covered Software under a subsequent version of this
+ License (see Section 10.2) or under the terms of a Secondary License (if
+ permitted under the terms of Section 3.3).
+
+2.5. Representation
+
+ Each Contributor represents that the Contributor believes its
+ Contributions are its original creation(s) or it has sufficient rights to
+ grant the rights to its Contributions conveyed by this License.
+
+2.6. Fair Use
+
+ This License is not intended to limit any rights You have under
+ applicable copyright doctrines of fair use, fair dealing, or other
+ equivalents.
+
+2.7. Conditions
+
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
+ Section 2.1.
+
+
+3. Responsibilities
+
+3.1. Distribution of Source Form
+
+ All distribution of Covered Software in Source Code Form, including any
+ Modifications that You create or to which You contribute, must be under
+ the terms of this License. You must inform recipients that the Source
+ Code Form of the Covered Software is governed by the terms of this
+ License, and how they can obtain a copy of this License. You may not
+ attempt to alter or restrict the recipients' rights in the Source Code
+ Form.
+
+3.2. Distribution of Executable Form
+
+ If You distribute Covered Software in Executable Form then:
+
+ a. such Covered Software must also be made available in Source Code Form,
+ as described in Section 3.1, and You must inform recipients of the
+ Executable Form how they can obtain a copy of such Source Code Form by
+ reasonable means in a timely manner, at a charge no more than the cost
+ of distribution to the recipient; and
+
+ b. You may distribute such Executable Form under the terms of this
+ License, or sublicense it under different terms, provided that the
+ license for the Executable Form does not attempt to limit or alter the
+ recipients' rights in the Source Code Form under this License.
+
+3.3. Distribution of a Larger Work
+
+ You may create and distribute a Larger Work under terms of Your choice,
+ provided that You also comply with the requirements of this License for
+ the Covered Software. If the Larger Work is a combination of Covered
+ Software with a work governed by one or more Secondary Licenses, and the
+ Covered Software is not Incompatible With Secondary Licenses, this
+ License permits You to additionally distribute such Covered Software
+ under the terms of such Secondary License(s), so that the recipient of
+ the Larger Work may, at their option, further distribute the Covered
+ Software under the terms of either this License or such Secondary
+ License(s).
+
+3.4. Notices
+
+ You may not remove or alter the substance of any license notices
+ (including copyright notices, patent notices, disclaimers of warranty, or
+ limitations of liability) contained within the Source Code Form of the
+ Covered Software, except that You may alter any license notices to the
+ extent required to remedy known factual inaccuracies.
+
+3.5. Application of Additional Terms
+
+ You may choose to offer, and to charge a fee for, warranty, support,
+ indemnity or liability obligations to one or more recipients of Covered
+ Software. However, You may do so only on Your own behalf, and not on
+ behalf of any Contributor. You must make it absolutely clear that any
+ such warranty, support, indemnity, or liability obligation is offered by
+ You alone, and You hereby agree to indemnify every Contributor for any
+ liability incurred by such Contributor as a result of warranty, support,
+ indemnity or liability terms You offer. You may include additional
+ disclaimers of warranty and limitations of liability specific to any
+ jurisdiction.
+
+4. Inability to Comply Due to Statute or Regulation
+
+ If it is impossible for You to comply with any of the terms of this License
+ with respect to some or all of the Covered Software due to statute,
+ judicial order, or regulation then You must: (a) comply with the terms of
+ this License to the maximum extent possible; and (b) describe the
+ limitations and the code they affect. Such description must be placed in a
+ text file included with all distributions of the Covered Software under
+ this License. Except to the extent prohibited by statute or regulation,
+ such description must be sufficiently detailed for a recipient of ordinary
+ skill to be able to understand it.
+
+5. Termination
+
+5.1. The rights granted under this License will terminate automatically if You
+ fail to comply with any of its terms. However, if You become compliant,
+ then the rights granted under this License from a particular Contributor
+ are reinstated (a) provisionally, unless and until such Contributor
+ explicitly and finally terminates Your grants, and (b) on an ongoing
+ basis, if such Contributor fails to notify You of the non-compliance by
+ some reasonable means prior to 60 days after You have come back into
+ compliance. Moreover, Your grants from a particular Contributor are
+ reinstated on an ongoing basis if such Contributor notifies You of the
+ non-compliance by some reasonable means, this is the first time You have
+ received notice of non-compliance with this License from such
+ Contributor, and You become compliant prior to 30 days after Your receipt
+ of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent
+ infringement claim (excluding declaratory judgment actions,
+ counter-claims, and cross-claims) alleging that a Contributor Version
+ directly or indirectly infringes any patent, then the rights granted to
+ You by any and all Contributors for the Covered Software under Section
+ 2.1 of this License shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
+ license agreements (excluding distributors and resellers) which have been
+ validly granted by You or Your distributors under this License prior to
+ termination shall survive termination.
+
+6. Disclaimer of Warranty
+
+ Covered Software is provided under this License on an "as is" basis,
+ without warranty of any kind, either expressed, implied, or statutory,
+ including, without limitation, warranties that the Covered Software is free
+ of defects, merchantable, fit for a particular purpose or non-infringing.
+ The entire risk as to the quality and performance of the Covered Software
+ is with You. Should any Covered Software prove defective in any respect,
+ You (not any Contributor) assume the cost of any necessary servicing,
+ repair, or correction. This disclaimer of warranty constitutes an essential
+ part of this License. No use of any Covered Software is authorized under
+ this License except under this disclaimer.
+
+7. Limitation of Liability
+
+ Under no circumstances and under no legal theory, whether tort (including
+ negligence), contract, or otherwise, shall any Contributor, or anyone who
+ distributes Covered Software as permitted above, be liable to You for any
+ direct, indirect, special, incidental, or consequential damages of any
+ character including, without limitation, damages for lost profits, loss of
+ goodwill, work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses, even if such party shall have been
+ informed of the possibility of such damages. This limitation of liability
+ shall not apply to liability for death or personal injury resulting from
+ such party's negligence to the extent applicable law prohibits such
+ limitation. Some jurisdictions do not allow the exclusion or limitation of
+ incidental or consequential damages, so this exclusion and limitation may
+ not apply to You.
+
+8. Litigation
+
+ Any litigation relating to this License may be brought only in the courts
+ of a jurisdiction where the defendant maintains its principal place of
+ business and such litigation shall be governed by laws of that
+ jurisdiction, without reference to its conflict-of-law provisions. Nothing
+ in this Section shall prevent a party's ability to bring cross-claims or
+ counter-claims.
+
+9. Miscellaneous
+
+ This License represents the complete agreement concerning the subject
+ matter hereof. If any provision of this License is held to be
+ unenforceable, such provision shall be reformed only to the extent
+ necessary to make it enforceable. Any law or regulation which provides that
+ the language of a contract shall be construed against the drafter shall not
+ be used to construe this License against a Contributor.
+
+
+10. Versions of the License
+
+10.1. New Versions
+
+ Mozilla Foundation is the license steward. Except as provided in Section
+ 10.3, no one other than the license steward has the right to modify or
+ publish new versions of this License. Each version will be given a
+ distinguishing version number.
+
+10.2. Effect of New Versions
+
+ You may distribute the Covered Software under the terms of the version
+ of the License under which You originally received the Covered Software,
+ or under the terms of any subsequent version published by the license
+ steward.
+
+10.3. Modified Versions
+
+ If you create software not governed by this License, and you want to
+ create a new license for such software, you may create and use a
+ modified version of this License if you rename the license and remove
+ any references to the name of the license steward (except to note that
+ such modified license differs from this License).
+
+10.4. Distributing Source Code Form that is Incompatible With Secondary
+ Licenses If You choose to distribute Source Code Form that is
+ Incompatible With Secondary Licenses under the terms of this version of
+ the License, the notice described in Exhibit B of this License must be
+ attached.
+
+Exhibit A - Source Code Form License Notice
+
+ 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/.
+
+If it is not possible or desirable to put the notice in a particular file,
+then You may include the notice in a location (such as a LICENSE file in a
+relevant directory) where a recipient would be likely to look for such a
+notice.
+
+You may add additional accurate notices of copyright ownership.
+
+Exhibit B - "Incompatible With Secondary Licenses" Notice
+
+ This Source Code Form is "Incompatible
+ With Secondary Licenses", as defined by
+ the Mozilla Public License, v. 2.0.
+
diff --git a/interfaces/firefox/schemas/alarms.json b/interfaces/firefox/schemas/alarms.json
new file mode 100644
index 00000000..ad278e64
--- /dev/null
+++ b/interfaces/firefox/schemas/alarms.json
@@ -0,0 +1,145 @@
+[
+ {
+ "namespace": "alarms",
+ "permissions": ["alarms"],
+ "types": [
+ {
+ "id": "Alarm",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of this alarm."
+ },
+ "scheduledTime": {
+ "type": "number",
+ "description": "Time when the alarm is scheduled to fire, in milliseconds past the epoch."
+ },
+ "periodInMinutes": {
+ "type": "number",
+ "optional": true,
+ "description": "When present, signals that the alarm triggers periodically after so many minutes."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "create",
+ "type": "function",
+ "description": "Creates an alarm. After the delay is expired, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "name",
+ "optional": true,
+ "description": "Optional name to identify this alarm. Defaults to the empty string."
+ },
+ {
+ "type": "object",
+ "name": "alarmInfo",
+ "description": "Details about the alarm. The alarm first fires either at 'when' milliseconds past the epoch (if 'when' is provided), after 'delayInMinutes' minutes from the current time (if 'delayInMinutes' is provided instead), or after 'periodInMinutes' minutes from the current time (if only 'periodInMinutes' is provided). Users should never provide both 'when' and 'delayInMinutes'. If 'periodInMinutes' is provided, then the alarm recurs repeatedly after that many minutes.",
+ "properties": {
+ "when": {"type": "number", "optional": true,
+ "description": "Time when the alarm is scheduled to first fire, in milliseconds past the epoch."},
+ "delayInMinutes": {"type": "number", "optional": true,
+ "description": "Number of minutes from the current time after which the alarm should first fire."},
+ "periodInMinutes": {"type": "number", "optional": true,
+ "description": "Number of minutes after which the alarm should recur repeatedly."}
+ }
+ }
+ ]
+ },
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Retrieves details about the specified alarm.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "name",
+ "optional": true,
+ "description": "The name of the alarm to get. Defaults to the empty string."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "alarm",
+ "$ref": "Alarm",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getAll",
+ "type": "function",
+ "description": "Gets an array of all the alarms.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ { "name": "alarms", "type": "array", "items": { "$ref": "Alarm" } }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "clear",
+ "type": "function",
+ "description": "Clears the alarm with the given name.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "name",
+ "optional": true,
+ "description": "The name of the alarm to clear. Defaults to the empty string."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ { "name": "wasCleared", "type": "boolean", "description": "Whether an alarm of the given name was found to clear." }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "clearAll",
+ "type": "function",
+ "description": "Clears all alarms.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ { "name": "wasCleared", "type": "boolean", "description": "Whether any alarm was found to clear." }
+ ]
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onAlarm",
+ "type": "function",
+ "description": "Fired when an alarm has expired. Useful for transient background pages.",
+ "parameters": [
+ {
+ "name": "name",
+ "$ref": "Alarm",
+ "description": "The alarm that has expired."
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/bookmarks.json b/interfaces/firefox/schemas/bookmarks.json
new file mode 100644
index 00000000..6126ad40
--- /dev/null
+++ b/interfaces/firefox/schemas/bookmarks.json
@@ -0,0 +1,550 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "bookmarks"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "bookmarks",
+ "description": "Use the browser.bookmarks
API to create, organize, and otherwise manipulate bookmarks. Also see $(topic:override)[Override Pages], which you can use to create a custom Bookmark Manager page.",
+ "permissions": ["bookmarks"],
+ "types": [
+ {
+ "id": "BookmarkTreeNodeUnmodifiable",
+ "type": "string",
+ "enum": ["managed"],
+ "description": "Indicates the reason why this node is unmodifiable. The managed value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default)."
+ },
+ {
+ "id": "BookmarkTreeNodeType",
+ "type": "string",
+ "enum": ["bookmark", "folder", "separator"],
+ "description": "Indicates the type of a BookmarkTreeNode, which can be one of bookmark, folder or separator."
+ },
+ {
+ "id": "BookmarkTreeNode",
+ "type": "object",
+ "description": "A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the browser is restarted."
+ },
+ "parentId": {
+ "type": "string",
+ "optional": true,
+ "description": "The id
of the parent folder. Omitted for the root node."
+ },
+ "index": {
+ "type": "integer",
+ "optional": true,
+ "description": "The 0-based position of this node within its parent folder."
+ },
+ "url": {
+ "type": "string",
+ "optional": true,
+ "description": "The URL navigated to when a user clicks the bookmark. Omitted for folders."
+ },
+ "title": {
+ "type": "string",
+ "description": "The text displayed for the node."
+ },
+ "dateAdded": {
+ "type": "number",
+ "optional": true,
+ "description": "When this node was created, in milliseconds since the epoch (new Date(dateAdded)
)."
+ },
+ "dateGroupModified": {
+ "type": "number",
+ "optional": true,
+ "description": "When the contents of this folder last changed, in milliseconds since the epoch."
+ },
+ "unmodifiable": {
+ "$ref": "BookmarkTreeNodeUnmodifiable",
+ "optional": true,
+ "description": "Indicates the reason why this node is unmodifiable. The managed value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default)."
+ },
+ "type": {
+ "$ref": "BookmarkTreeNodeType",
+ "optional": true,
+ "description": "Indicates the type of the BookmarkTreeNode, which can be one of bookmark, folder or separator."
+ },
+ "children": {
+ "type": "array",
+ "optional": true,
+ "items": { "$ref": "BookmarkTreeNode" },
+ "description": "An ordered list of children of this node."
+ }
+ }
+ },
+ {
+ "id": "CreateDetails",
+ "description": "Object passed to the create() function.",
+ "type": "object",
+ "properties": {
+ "parentId": {
+ "type": "string",
+ "optional": true,
+ "description": "Defaults to the Other Bookmarks folder."
+ },
+ "index": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true
+ },
+ "title": {
+ "type": "string",
+ "optional": true
+ },
+ "url": {
+ "type": "string",
+ "optional": true
+ },
+ "type": {
+ "$ref": "BookmarkTreeNodeType",
+ "optional": true,
+ "description": "Indicates the type of BookmarkTreeNode to create, which can be one of bookmark, folder or separator."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Retrieves the specified BookmarkTreeNode(s).",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "idOrIdList",
+ "description": "A single string-valued id, or an array of string-valued ids",
+ "choices": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "minItems": 1
+ }
+ ]
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "results",
+ "type": "array",
+ "items": { "$ref": "BookmarkTreeNode" }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getChildren",
+ "type": "function",
+ "description": "Retrieves the children of the specified BookmarkTreeNode id.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "results",
+ "type": "array",
+ "items": { "$ref": "BookmarkTreeNode"}
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getRecent",
+ "type": "function",
+ "description": "Retrieves the recently added bookmarks.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "minimum": 1,
+ "name": "numberOfItems",
+ "description": "The maximum number of items to return."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "results",
+ "type": "array",
+ "items": { "$ref": "BookmarkTreeNode" }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getTree",
+ "type": "function",
+ "description": "Retrieves the entire Bookmarks hierarchy.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "results",
+ "type": "array",
+ "items": { "$ref": "BookmarkTreeNode" }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getSubTree",
+ "type": "function",
+ "description": "Retrieves part of the Bookmarks hierarchy, starting at the specified node.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id",
+ "description": "The ID of the root of the subtree to retrieve."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "results",
+ "type": "array",
+ "items": { "$ref": "BookmarkTreeNode" }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "search",
+ "type": "function",
+ "description": "Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "query",
+ "description": "Either a string of words that are matched against bookmark URLs and titles, or an object. If an object, the properties query
, url
, and title
may be specified and bookmarks matching all specified properties will be produced.",
+ "choices": [
+ {
+ "type": "string",
+ "description": "A string of words that are matched against bookmark URLs and titles."
+ },
+ {
+ "type": "object",
+ "description": "An object specifying properties and values to match when searching. Produces bookmarks matching all properties.",
+ "properties": {
+ "query": {
+ "type": "string",
+ "optional": true,
+ "description": "A string of words that are matched against bookmark URLs and titles."
+ },
+ "url": {
+ "type": "string",
+ "format": "url",
+ "optional": true,
+ "description": "The URL of the bookmark; matches verbatim. Note that folders have no URL."
+ },
+ "title": {
+ "type": "string",
+ "optional": true,
+ "description": "The title of the bookmark; matches verbatim."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "results",
+ "type": "array",
+ "items": { "$ref": "BookmarkTreeNode" }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "create",
+ "type": "function",
+ "description": "Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder.",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "CreateDetails",
+ "name": "bookmark"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "result",
+ "$ref": "BookmarkTreeNode"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "move",
+ "type": "function",
+ "description": "Moves the specified BookmarkTreeNode to the provided location.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id"
+ },
+ {
+ "type": "object",
+ "name": "destination",
+ "properties": {
+ "parentId": {
+ "type": "string",
+ "optional": true
+ },
+ "index": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "result",
+ "$ref": "BookmarkTreeNode"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "update",
+ "type": "function",
+ "description": "Updates the properties of a bookmark or folder. Specify only the properties that you want to change; unspecified properties will be left unchanged. Note: Currently, only 'title' and 'url' are supported.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id"
+ },
+ {
+ "type": "object",
+ "name": "changes",
+ "properties": {
+ "title": {
+ "type": "string",
+ "optional": true
+ },
+ "url": {
+ "type": "string",
+ "optional": true
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "result",
+ "$ref": "BookmarkTreeNode"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "remove",
+ "type": "function",
+ "description": "Removes a bookmark or an empty bookmark folder.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "removeTree",
+ "type": "function",
+ "description": "Recursively removes a bookmark folder.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onCreated",
+ "type": "function",
+ "description": "Fired when a bookmark or folder is created.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id"
+ },
+ {
+ "$ref": "BookmarkTreeNode",
+ "name": "bookmark"
+ }
+ ]
+ },
+ {
+ "name": "onRemoved",
+ "type": "function",
+ "description": "Fired when a bookmark or folder is removed. When a folder is removed recursively, a single notification is fired for the folder, and none for its contents.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id"
+ },
+ {
+ "type": "object",
+ "name": "removeInfo",
+ "properties": {
+ "parentId": { "type": "string" },
+ "index": { "type": "integer" },
+ "node": { "$ref": "BookmarkTreeNode" }
+ }
+ }
+ ]
+ },
+ {
+ "name": "onChanged",
+ "type": "function",
+ "description": "Fired when a bookmark or folder changes. Note: Currently, only title and url changes trigger this.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id"
+ },
+ {
+ "type": "object",
+ "name": "changeInfo",
+ "properties": {
+ "title": { "type": "string" },
+ "url": {
+ "type": "string",
+ "optional": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "onMoved",
+ "type": "function",
+ "description": "Fired when a bookmark or folder is moved to a different parent folder.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id"
+ },
+ {
+ "type": "object",
+ "name": "moveInfo",
+ "properties": {
+ "parentId": { "type": "string" },
+ "index": { "type": "integer" },
+ "oldParentId": { "type": "string" },
+ "oldIndex": { "type": "integer" }
+ }
+ }
+ ]
+ },
+ {
+ "name": "onChildrenReordered",
+ "unsupported": true,
+ "type": "function",
+ "description": "Fired when the children of a folder have changed their order due to the order being sorted in the UI. This is not called as a result of a move().",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id"
+ },
+ {
+ "type": "object",
+ "name": "reorderInfo",
+ "properties": {
+ "childIds": {
+ "type": "array",
+ "items": { "type": "string" }
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "onImportBegan",
+ "unsupported": true,
+ "type": "function",
+ "description": "Fired when a bookmark import session is begun. Expensive observers should ignore onCreated updates until onImportEnded is fired. Observers should still handle other notifications immediately.",
+ "parameters": []
+ },
+ {
+ "name": "onImportEnded",
+ "unsupported": true,
+ "type": "function",
+ "description": "Fired when a bookmark import session is ended.",
+ "parameters": []
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/browser_action.json b/interfaces/firefox/schemas/browser_action.json
new file mode 100644
index 00000000..a823173a
--- /dev/null
+++ b/interfaces/firefox/schemas/browser_action.json
@@ -0,0 +1,513 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "id": "ActionManifest",
+ "type": "object",
+ "additionalProperties": { "$ref": "UnrecognizedProperty" },
+ "properties": {
+ "default_title": {
+ "type": "string",
+ "optional": true,
+ "preprocess": "localize"
+ },
+ "default_icon": {
+ "$ref": "IconPath",
+ "optional": true
+ },
+ "theme_icons": {
+ "type": "array",
+ "optional": true,
+ "minItems": 1,
+ "items": { "$ref": "ThemeIcons" },
+ "description": "Specifies icons to use for dark and light themes"
+ },
+ "default_popup": {
+ "type": "string",
+ "format": "relativeUrl",
+ "optional": true,
+ "preprocess": "localize"
+ },
+ "browser_style": {
+ "type": "boolean",
+ "optional": true,
+ "default": false
+ },
+ "default_area": {
+ "description": "Defines the location the browserAction will appear by default. The default location is navbar.",
+ "type": "string",
+ "enum": ["navbar", "menupanel", "tabstrip", "personaltoolbar"],
+ "optional": true
+ }
+ }
+ },
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "action": {
+ "min_manifest_version": 3,
+ "$ref": "ActionManifest",
+ "optional": true
+ }
+ }
+ },
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "browser_action": {
+ "max_manifest_version": 2,
+ "$ref": "ActionManifest",
+ "optional": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "namespace": "action",
+ "description": "Use browser actions to put icons in the main browser toolbar, to the right of the address bar. In addition to its icon, a browser action can also have a tooltip, a badge, and a popup.",
+ "permissions": ["manifest:action", "manifest:browser_action"],
+ "min_manifest_version": 3,
+ "types": [
+ {
+ "id": "Details",
+ "type": "object",
+ "description": "Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.",
+ "properties": {
+ "tabId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": 0,
+ "description": "When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "description": "When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited."
+ }
+ }
+ },
+ {
+ "id": "ColorArray",
+ "type": "array",
+ "items": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 255
+ },
+ "minItems": 4,
+ "maxItems": 4
+ },
+ {
+ "id": "ImageDataType",
+ "type": "object",
+ "isInstanceOf": "ImageData",
+ "additionalProperties": { "type": "any" },
+ "postprocess": "convertImageDataToURL",
+ "description": "Pixel data for an image. Must be an ImageData object (for example, from a canvas
element)."
+ },
+ {
+ "id": "ColorValue",
+ "description": "An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is [255, 0, 0, 255]
. Can also be a string with a CSS value, with opaque red being #FF0000
or #F00
.",
+ "choices": [
+ {"type": "string"},
+ {"$ref": "ColorArray"},
+ {"type": "null"}
+ ]
+ },
+ {
+ "id": "OnClickData",
+ "type": "object",
+ "description": "Information sent when a browser action is clicked.",
+ "properties": {
+ "modifiers": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["Shift", "Alt", "Command", "Ctrl", "MacCtrl"]
+ },
+ "description": "An array of keyboard modifiers that were held while the menu item was clicked."
+ },
+ "button": {
+ "type": "integer",
+ "optional": true,
+ "description": "An integer value of button by which menu item was clicked."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "setTitle",
+ "type": "function",
+ "description": "Sets the title of the browser action. This shows up in the tooltip.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "$import": "Details",
+ "properties": {
+ "title": {
+ "choices": [
+ {"type": "string"},
+ {"type": "null"}
+ ],
+ "description": "The string the browser action should display when moused over."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "getTitle",
+ "type": "function",
+ "description": "Gets the title of the browser action.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "$ref": "Details"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setIcon",
+ "type": "function",
+ "description": "Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "$import": "Details",
+ "properties": {
+ "imageData": {
+ "choices": [
+ { "$ref": "ImageDataType" },
+ {
+ "type": "object",
+ "patternProperties": {
+ "^[1-9]\\d*$": {"$ref": "ImageDataType"}
+ }
+ }
+ ],
+ "optional": true,
+ "description": "Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale
, then image with size scale
* 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'"
+ },
+ "path": {
+ "choices": [
+ { "type": "string" },
+ {
+ "type": "object",
+ "patternProperties": {
+ "^[1-9]\\d*$": { "type": "string" }
+ }
+ }
+ ],
+ "optional": true,
+ "description": "Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale
, then image with size scale
* 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'"
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "setPopup",
+ "type": "function",
+ "description": "Sets the html document to be opened as a popup when the user clicks on the browser action's icon.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "$import": "Details",
+ "properties": {
+ "popup": {
+ "choices": [
+ {"type": "string"},
+ {"type": "null"}
+ ],
+ "description": "The html file to show in a popup. If set to the empty string (''), no popup is shown."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "getPopup",
+ "type": "function",
+ "description": "Gets the html document set as the popup for this browser action.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "$ref": "Details"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setBadgeText",
+ "type": "function",
+ "description": "Sets the badge text for the browser action. The badge is displayed on top of the icon.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "$import": "Details",
+ "properties": {
+ "text": {
+ "choices": [
+ {"type": "string"},
+ {"type": "null"}
+ ],
+ "description": "Any number of characters can be passed, but only about four can fit in the space."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "getBadgeText",
+ "type": "function",
+ "description": "Gets the badge text of the browser action. If no tab nor window is specified is specified, the global badge text is returned.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "$ref": "Details"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setBadgeBackgroundColor",
+ "type": "function",
+ "description": "Sets the background color for the badge.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "$import": "Details",
+ "properties": {
+ "color": { "$ref": "ColorValue" }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "getBadgeBackgroundColor",
+ "type": "function",
+ "description": "Gets the background color of the browser action badge.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "$ref": "Details"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "$ref": "ColorArray"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setBadgeTextColor",
+ "type": "function",
+ "description": "Sets the text color for the badge.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "$import": "Details",
+ "properties": {
+ "color": { "$ref": "ColorValue" }
+ }
+ }
+ ]
+ },
+ {
+ "name": "getBadgeTextColor",
+ "type": "function",
+ "description": "Gets the text color of the browser action badge.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "details",
+ "$ref": "Details"
+ }
+ ]
+ },
+ {
+ "name": "enable",
+ "type": "function",
+ "description": "Enables the browser action for a tab. By default, browser actions are enabled.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "optional": true,
+ "name": "tabId",
+ "minimum": 0,
+ "description": "The id of the tab for which you want to modify the browser action."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "disable",
+ "type": "function",
+ "description": "Disables the browser action for a tab.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "optional": true,
+ "name": "tabId",
+ "minimum": 0,
+ "description": "The id of the tab for which you want to modify the browser action."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "isEnabled",
+ "type": "function",
+ "description": "Checks whether the browser action is enabled.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "details",
+ "$ref": "Details"
+ }
+ ]
+ },
+ {
+ "name": "openPopup",
+ "type": "function",
+ "description": "Opens the extension popup window in the specified window.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "options",
+ "optional": true,
+ "type": "object",
+ "description": "An object with information about the popup to open.",
+ "properties": {
+ "windowId": {
+ "type": "integer",
+ "minimum": -2,
+ "optional": true,
+ "description": "Defaults to the $(topic:current-window)[current window]."
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onClicked",
+ "type": "function",
+ "description": "Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup.",
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ },
+ {
+ "name": "info",
+ "$ref": "OnClickData",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "namespace": "browserAction",
+ "permissions": ["manifest:action", "manifest:browser_action"],
+ "max_manifest_version": 2,
+ "$import": "action"
+ }
+]
diff --git a/interfaces/firefox/schemas/browser_settings.json b/interfaces/firefox/schemas/browser_settings.json
new file mode 100644
index 00000000..0a584d5c
--- /dev/null
+++ b/interfaces/firefox/schemas/browser_settings.json
@@ -0,0 +1,135 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [
+ {
+ "type": "string",
+ "enum": ["browserSettings"]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "namespace": "browserSettings",
+ "description": "Use the browser.browserSettings
API to control global settings of the browser.",
+ "permissions": ["browserSettings"],
+ "types": [
+ {
+ "id": "ImageAnimationBehavior",
+ "type": "string",
+ "enum": ["normal", "none", "once"],
+ "description": "How images should be animated in the browser."
+ },
+ {
+ "id": "ContextMenuMouseEvent",
+ "type": "string",
+ "enum": ["mouseup", "mousedown"],
+ "description": "After which mouse event context menus should popup."
+ },
+ {
+ "id": "ColorManagementMode",
+ "type": "string",
+ "enum": ["off", "full", "tagged_only"],
+ "description": "Color management mode."
+ }
+ ],
+ "properties": {
+ "allowPopupsForUserEvents": {
+ "$ref": "types.Setting",
+ "description": "Allows or disallows pop-up windows from opening in response to user events."
+ },
+ "cacheEnabled": {
+ "$ref": "types.Setting",
+ "description": "Enables or disables the browser cache."
+ },
+ "closeTabsByDoubleClick": {
+ "$ref": "types.Setting",
+ "description": "This boolean setting controls whether the selected tab can be closed with a double click."
+ },
+ "contextMenuShowEvent": {
+ "$ref": "types.Setting",
+ "description": "Controls after which mouse event context menus popup. This setting's value is of type ContextMenuMouseEvent, which has possible values of mouseup
and mousedown
."
+ },
+ "ftpProtocolEnabled": {
+ "$ref": "types.Setting",
+ "description": "Returns whether the FTP protocol is enabled. Read-only.",
+ "deprecated": "FTP support was removed from Firefox in bug 1574475"
+ },
+ "homepageOverride": {
+ "$ref": "types.Setting",
+ "description": "Returns the value of the overridden home page. Read-only."
+ },
+ "imageAnimationBehavior": {
+ "$ref": "types.Setting",
+ "description": "Controls the behaviour of image animation in the browser. This setting's value is of type ImageAnimationBehavior, defaulting to normal
."
+ },
+ "newTabPageOverride": {
+ "$ref": "types.Setting",
+ "description": "Returns the value of the overridden new tab page. Read-only."
+ },
+ "newTabPosition": {
+ "$ref": "types.Setting",
+ "description": "Controls where new tabs are opened. `afterCurrent` will open all new tabs next to the current tab, `relatedAfterCurrent` will open only related tabs next to the current tab, and `atEnd` will open all tabs at the end of the tab strip. The default is `relatedAfterCurrent`."
+ },
+ "openBookmarksInNewTabs": {
+ "$ref": "types.Setting",
+ "description": "This boolean setting controls whether bookmarks are opened in the current tab or in a new tab."
+ },
+ "openSearchResultsInNewTabs": {
+ "$ref": "types.Setting",
+ "description": "This boolean setting controls whether search results are opened in the current tab or in a new tab."
+ },
+ "openUrlbarResultsInNewTabs": {
+ "$ref": "types.Setting",
+ "description": "This boolean setting controls whether urlbar results are opened in the current tab or in a new tab."
+ },
+ "webNotificationsDisabled": {
+ "$ref": "types.Setting",
+ "description": "Disables webAPI notifications."
+ },
+ "overrideDocumentColors": {
+ "$ref": "types.Setting",
+ "description": "This setting controls whether the user-chosen colors override the page's colors."
+ },
+ "overrideContentColorScheme": {
+ "$ref": "types.Setting",
+ "description": "This setting controls whether a light or dark color scheme overrides the page's preferred color scheme."
+ },
+ "useDocumentFonts": {
+ "$ref": "types.Setting",
+ "description": "This setting controls whether the document's fonts are used."
+ },
+ "zoomFullPage": {
+ "$ref": "types.Setting",
+ "description": "This boolean setting controls whether zoom is applied to the full page or to text only."
+ },
+ "zoomSiteSpecific": {
+ "$ref": "types.Setting",
+ "description": "This boolean setting controls whether zoom is applied on a per-site basis or to the current tab only. If privacy.resistFingerprinting is true, this setting has no effect and zoom is applied to the current tab only."
+ }
+ }
+ },
+ {
+ "namespace": "browserSettings.colorManagement",
+ "description": "Use the browserSettings.colorManagement
API to query and set items related to color management.",
+ "permissions": ["browserSettings"],
+ "properties": {
+ "mode": {
+ "$ref": "types.Setting",
+ "description": "This setting controls the mode used for color management and must be a string from $(ref:browserSettings.ColorManagementMode)"
+ },
+ "useNativeSRGB": {
+ "$ref": "types.Setting",
+ "description": "This boolean setting controls whether or not native sRGB color management is used."
+ },
+ "useWebRenderCompositor": {
+ "$ref": "types.Setting",
+ "description": "This boolean setting controls whether or not the WebRender compositor is used."
+ }
+ }
+ }
+]
diff --git a/interfaces/firefox/schemas/browsing_data.json b/interfaces/firefox/schemas/browsing_data.json
new file mode 100644
index 00000000..943cd8ea
--- /dev/null
+++ b/interfaces/firefox/schemas/browsing_data.json
@@ -0,0 +1,419 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "browsingData"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "browsingData",
+ "description": "Use the chrome.browsingData
API to remove browsing data from a user's local profile.",
+ "permissions": ["browsingData"],
+ "types": [
+ {
+ "id": "RemovalOptions",
+ "type": "object",
+ "description": "Options that determine exactly what data will be removed.",
+ "properties": {
+ "since": {
+ "$ref": "extensionTypes.Date",
+ "optional": true,
+ "description": "Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the getTime
method of the JavaScript Date
object). If absent, defaults to 0 (which would remove all browsing data)."
+ },
+ "hostnames": {
+ "type": "array",
+ "items": {"type": "string", "format": "hostname"},
+ "optional": true,
+ "description": "Only remove data associated with these hostnames (only applies to cookies and localStorage)."
+ },
+ "cookieStoreId": {
+ "type": "string",
+ "description": "Only remove data associated with this specific cookieStoreId.",
+ "optional": true
+ },
+ "originTypes": {
+ "type": "object",
+ "optional": true,
+ "description": "An object whose properties specify which origin types ought to be cleared. If this object isn't specified, it defaults to clearing only \"unprotected\" origins. Please ensure that you really want to remove application data before adding 'protectedWeb' or 'extensions'.",
+ "properties": {
+ "unprotectedWeb": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Normal websites."
+ },
+ "protectedWeb": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Websites that have been installed as hosted applications (be careful!)."
+ },
+ "extension": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Extensions and packaged applications a user has installed (be _really_ careful!)."
+ }
+ }
+ }
+ }
+ },
+ {
+ "id": "DataTypeSet",
+ "type": "object",
+ "description": "A set of data types. Missing data types are interpreted as false
.",
+ "properties": {
+ "cache": {
+ "type": "boolean",
+ "optional": true,
+ "description": "The browser's cache. Note: when removing data, this clears the entire cache: it is not limited to the range you specify."
+ },
+ "cookies": {
+ "type": "boolean",
+ "optional": true,
+ "description": "The browser's cookies."
+ },
+ "downloads": {
+ "type": "boolean",
+ "optional": true,
+ "description": "The browser's download list."
+ },
+ "formData": {
+ "type": "boolean",
+ "optional": true,
+ "description": "The browser's stored form data."
+ },
+ "history": {
+ "type": "boolean",
+ "optional": true,
+ "description": "The browser's history."
+ },
+ "indexedDB": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Websites' IndexedDB data."
+ },
+ "localStorage": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Websites' local storage data."
+ },
+ "serverBoundCertificates": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Server-bound certificates."
+ },
+ "passwords": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Stored passwords."
+ },
+ "pluginData": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Plugins' data."
+ },
+ "serviceWorkers": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Service Workers."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "settings",
+ "description": "Reports which types of data are currently selected in the 'Clear browsing data' settings UI. Note: some of the data types included in this API are not available in the settings UI, and some UI settings control more than one data type listed here.",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "object",
+ "properties": {
+ "options": {
+ "$ref": "RemovalOptions"
+ },
+ "dataToRemove": {
+ "$ref": "DataTypeSet",
+ "description": "All of the types will be present in the result, with values of true
if they are both selected to be removed and permitted to be removed, otherwise false
."
+ },
+ "dataRemovalPermitted": {
+ "$ref": "DataTypeSet",
+ "description": "All of the types will be present in the result, with values of true
if they are permitted to be removed (e.g., by enterprise policy) and false
if not."
+ }
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "remove",
+ "description": "Clears various types of browsing data stored in a user's profile.",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "RemovalOptions",
+ "name": "options"
+ },
+ {
+ "name": "dataToRemove",
+ "$ref": "DataTypeSet",
+ "description": "The set of data types to remove."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when deletion has completed.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "removeAppcache",
+ "description": "Clears websites' appcache data.",
+ "type": "function",
+ "async": "callback",
+ "unsupported": true,
+ "parameters": [
+ {
+ "$ref": "RemovalOptions",
+ "name": "options"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when websites' appcache data has been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "removeCache",
+ "description": "Clears the browser's cache.",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "RemovalOptions",
+ "name": "options"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when the browser's cache has been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "removeCookies",
+ "description": "Clears the browser's cookies and server-bound certificates modified within a particular timeframe.",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "RemovalOptions",
+ "name": "options"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when the browser's cookies and server-bound certificates have been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "removeDownloads",
+ "description": "Clears the browser's list of downloaded files (not the downloaded files themselves).",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "RemovalOptions",
+ "name": "options"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when the browser's list of downloaded files has been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "removeFileSystems",
+ "description": "Clears websites' file system data.",
+ "type": "function",
+ "async": "callback",
+ "unsupported": true,
+ "parameters": [
+ {
+ "$ref": "RemovalOptions",
+ "name": "options"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when websites' file systems have been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "removeFormData",
+ "description": "Clears the browser's stored form data (autofill).",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "RemovalOptions",
+ "name": "options"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when the browser's form data has been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "removeHistory",
+ "description": "Clears the browser's history.",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "RemovalOptions",
+ "name": "options"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when the browser's history has cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "removeIndexedDB",
+ "description": "Clears websites' IndexedDB data.",
+ "type": "function",
+ "async": "callback",
+ "unsupported": true,
+ "parameters": [
+ {
+ "$ref": "RemovalOptions",
+ "name": "options"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when websites' IndexedDB data has been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "removeLocalStorage",
+ "description": "Clears websites' local storage data.",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "RemovalOptions",
+ "name": "options"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when websites' local storage has been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "removePluginData",
+ "description": "Clears plugins' data.",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "RemovalOptions",
+ "name": "options"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when plugins' data has been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "removePasswords",
+ "description": "Clears the browser's stored passwords.",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "RemovalOptions",
+ "name": "options"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when the browser's passwords have been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "removeWebSQL",
+ "description": "Clears websites' WebSQL data.",
+ "type": "function",
+ "async": "callback",
+ "unsupported": true,
+ "parameters": [
+ {
+ "$ref": "RemovalOptions",
+ "name": "options"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when websites' WebSQL databases have been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/captive_portal.json b/interfaces/firefox/schemas/captive_portal.json
new file mode 100644
index 00000000..b6f4392d
--- /dev/null
+++ b/interfaces/firefox/schemas/captive_portal.json
@@ -0,0 +1,75 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "PermissionNoPrompt",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "captivePortal"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "captivePortal",
+ "description": "This API provides the ability detect the captive portal state of the users connection.",
+ "permissions": ["captivePortal"],
+ "properties": {
+ "canonicalURL": {
+ "$ref": "types.Setting",
+ "description": "Return the canonical captive-portal detection URL. Read-only."
+ }
+ },
+ "functions": [
+ {
+ "name": "getState",
+ "type": "function",
+ "description": "Returns the current portal state, one of `unknown`, `not_captive`, `unlocked_portal`, `locked_portal`.",
+ "async": true,
+ "parameters": []
+ },
+ {
+ "name": "getLastChecked",
+ "type": "function",
+ "description": "Returns the time difference between NOW and the last time a request was completed in milliseconds.",
+ "async": true,
+ "parameters": []
+ }
+ ],
+ "events": [
+ {
+ "name": "onStateChanged",
+ "type": "function",
+ "description": "Fired when the captive portal state changes.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "state": {
+ "type": "string",
+ "enum": ["unknown", "not_captive", "unlocked_portal", "locked_portal"],
+ "description": "The current captive portal state."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "onConnectivityAvailable",
+ "type": "function",
+ "description": "This notification will be emitted when the captive portal service has determined that we can connect to the internet. The service will pass either `captive` if there is an unlocked captive portal present, or `clear` if no captive portal was detected.",
+ "parameters": [
+ {
+ "name": "status",
+ "enum": ["captive", "clear"],
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/chrome_settings_overrides.json b/interfaces/firefox/schemas/chrome_settings_overrides.json
new file mode 100644
index 00000000..96144745
--- /dev/null
+++ b/interfaces/firefox/schemas/chrome_settings_overrides.json
@@ -0,0 +1,200 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "chrome_settings_overrides": {
+ "type": "object",
+ "optional": true,
+ "additionalProperties": { "$ref": "UnrecognizedProperty" },
+ "properties": {
+ "homepage": {
+ "type": "string",
+ "format": "homepageUrl",
+ "optional": true,
+ "preprocess": "localize"
+ },
+ "search_provider": {
+ "type": "object",
+ "optional": true,
+ "additionalProperties": { "$ref": "UnrecognizedProperty" },
+ "properties": {
+ "name": {
+ "type": "string",
+ "preprocess": "localize"
+ },
+ "keyword": {
+ "optional": true,
+ "choices": [
+ {
+ "type": "string",
+ "preprocess": "localize"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "preprocess": "localize"
+ },
+ "minItems": 1
+ }
+ ]
+ },
+ "search_url": {
+ "type": "string",
+ "format": "url",
+ "pattern": "^(https://|http://(localhost|127\\.0\\.0\\.1|\\[::1\\])(:\\d*)?(/|$)).*$",
+ "preprocess": "localize"
+ },
+ "favicon_url": {
+ "choices": [
+ {
+ "type": "string",
+ "format": "relativeUrl",
+ "max_manifest_version": 2
+ },
+ {
+ "type": "string",
+ "format": "strictRelativeUrl"
+ }
+ ],
+ "optional": true,
+ "preprocess": "localize"
+ },
+ "suggest_url": {
+ "type": "string",
+ "optional": true,
+ "pattern": "^$|^(https://|http://(localhost|127\\.0\\.0\\.1|\\[::1\\])(:\\d*)?(/|$)).*$",
+ "preprocess": "localize"
+ },
+ "instant_url": {
+ "type": "string",
+ "optional": true,
+ "format": "url",
+ "preprocess": "localize",
+ "deprecated": "Unsupported on Firefox at this time."
+ },
+ "image_url": {
+ "type": "string",
+ "optional": true,
+ "format": "url",
+ "preprocess": "localize",
+ "deprecated": "Unsupported on Firefox at this time."
+ },
+ "search_url_get_params": {
+ "type": "string",
+ "optional": true,
+ "preprocess": "localize",
+ "description": "GET parameters to the search_url as a query string."
+ },
+ "search_url_post_params": {
+ "type": "string",
+ "optional": true,
+ "preprocess": "localize",
+ "description": "POST parameters to the search_url as a query string."
+ },
+ "suggest_url_get_params": {
+ "type": "string",
+ "optional": true,
+ "preprocess": "localize",
+ "description": "GET parameters to the suggest_url as a query string."
+ },
+ "suggest_url_post_params": {
+ "type": "string",
+ "optional": true,
+ "preprocess": "localize",
+ "description": "POST parameters to the suggest_url as a query string."
+ },
+ "instant_url_post_params": {
+ "type": "string",
+ "optional": true,
+ "preprocess": "localize",
+ "deprecated": "Unsupported on Firefox at this time."
+ },
+ "image_url_post_params": {
+ "type": "string",
+ "optional": true,
+ "preprocess": "localize",
+ "deprecated": "Unsupported on Firefox at this time."
+ },
+ "search_form": {
+ "type": "string",
+ "optional": true,
+ "format": "url",
+ "pattern": "^(https://|http://(localhost|127\\.0\\.0\\.1|\\[::1\\])(:\\d*)?(/|$)).*$",
+ "preprocess": "localize"
+ },
+ "alternate_urls": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "url",
+ "preprocess": "localize"
+ },
+ "optional": true,
+ "deprecated": "Unsupported on Firefox at this time."
+ },
+ "prepopulated_id": {
+ "type": "integer",
+ "optional": true,
+ "deprecated": "Unsupported on Firefox."
+ },
+ "encoding": {
+ "type": "string",
+ "optional": true,
+ "description": "Encoding of the search term."
+ },
+ "is_default": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Sets the default engine to a built-in engine only."
+ },
+ "params": {
+ "optional": true,
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "A url parameter name"
+ },
+ "condition": {
+ "type": "string",
+ "optional": true,
+ "enum": ["purpose", "pref"],
+ "description": "The type of param can be either \"purpose\" or \"pref\"."
+ },
+ "pref": {
+ "type": "string",
+ "optional": true,
+ "description": "The preference to retrieve the value from.",
+ "preprocess": "localize"
+ },
+ "purpose": {
+ "type": "string",
+ "optional": true,
+ "enum": ["contextmenu", "searchbar", "homepage", "keyword", "newtab"],
+ "description": "The context that initiates a search, required if condition is \"purpose\"."
+ },
+ "value": {
+ "type": "string",
+ "optional": true,
+ "description": "A url parameter value.",
+ "preprocess": "localize"
+ }
+ }
+ },
+ "description": "A list of optional search url parameters. This allows the additon of search url parameters based on how the search is performed in Firefox."
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/clipboard.json b/interfaces/firefox/schemas/clipboard.json
new file mode 100644
index 00000000..010a003c
--- /dev/null
+++ b/interfaces/firefox/schemas/clipboard.json
@@ -0,0 +1,30 @@
+[
+ {
+ "namespace": "clipboard",
+ "description": "Offers the ability to write to the clipboard. Reading is not supported because the clipboard can already be read through the standard web platform APIs.",
+ "permissions": ["clipboardWrite"],
+ "functions": [
+ {
+ "name": "setImageData",
+ "type": "function",
+ "description": "Copy an image to the clipboard. The image is re-encoded before it is written to the clipboard. If the image is invalid, the clipboard is not modified.",
+ "async": true,
+ "parameters": [
+ {
+ "type": "object",
+ "isInstanceOf": "ArrayBuffer",
+ "additionalProperties": true,
+ "name": "imageData",
+ "description": "The image data to be copied."
+ },
+ {
+ "type": "string",
+ "name": "imageType",
+ "enum": ["jpeg", "png"],
+ "description": "The type of imageData."
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/commands.json b/interfaces/firefox/schemas/commands.json
new file mode 100644
index 00000000..4f165400
--- /dev/null
+++ b/interfaces/firefox/schemas/commands.json
@@ -0,0 +1,179 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "id": "KeyName",
+ "type": "string",
+ "format": "manifestShortcutKey"
+ },
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "commands": {
+ "type": "object",
+ "optional": true,
+ "additionalProperties": {
+ "type": "object",
+ "additionalProperties": { "$ref": "UnrecognizedProperty" },
+ "properties": {
+ "suggested_key": {
+ "type": "object",
+ "optional": true,
+ "properties": {
+ "default": {
+ "$ref": "KeyName",
+ "optional": true
+ },
+ "mac": {
+ "$ref": "KeyName",
+ "optional": true
+ },
+ "linux": {
+ "$ref": "KeyName",
+ "optional": true
+ },
+ "windows": {
+ "$ref": "KeyName",
+ "optional": true
+ },
+ "chromeos": {
+ "type": "string",
+ "optional": true
+ },
+ "android": {
+ "type": "string",
+ "optional": true
+ },
+ "ios": {
+ "type": "string",
+ "optional": true
+ },
+ "additionalProperties": {
+ "type": "string",
+ "deprecated": "Unknown platform name",
+ "optional": true
+ }
+ }
+ },
+ "description": {
+ "type": "string",
+ "preprocess": "localize",
+ "optional": true
+ }
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ {
+ "namespace": "commands",
+ "description": "Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the xtension.",
+ "permissions": ["manifest:commands"],
+ "types": [
+ {
+ "id": "Command",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "optional": true,
+ "description": "The name of the Extension Command"
+ },
+ "description": {
+ "type": "string",
+ "optional": true,
+ "description": "The Extension Command description"
+ },
+ "shortcut": {
+ "type": "string",
+ "optional": true,
+ "description": "The shortcut active for this command, or blank if not active."
+ }
+ }
+ }
+ ],
+ "events": [
+ {
+ "name": "onCommand",
+ "description": "Fired when a registered command is activated using a keyboard shortcut.",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "command",
+ "type": "string"
+ }
+ ]
+ }
+ ],
+ "functions": [
+ {
+ "name": "update",
+ "type": "function",
+ "async": true,
+ "description": "Update the details of an already defined command.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "detail",
+ "description": "The new description for the command.",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the command."
+ },
+ "description": {
+ "type": "string",
+ "optional": true,
+ "description": "The new description for the command."
+ },
+ "shortcut": {
+ "type": "string",
+ "format": "manifestShortcutKeyOrEmpty",
+ "optional": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "reset",
+ "type": "function",
+ "async": true,
+ "description": "Reset a command's details to what is specified in the manifest.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "name",
+ "description": "The name of the command."
+ }
+ ]
+ },
+ {
+ "name": "getAll",
+ "type": "function",
+ "async": "callback",
+ "description": "Returns all the registered extension commands for this extension and their shortcut (if active).",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "commands",
+ "type": "array",
+ "items": {
+ "$ref": "Command"
+ }
+ }
+ ],
+ "description": "Called to return the registered commands."
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/content_scripts.json b/interfaces/firefox/schemas/content_scripts.json
new file mode 100644
index 00000000..cadec1c3
--- /dev/null
+++ b/interfaces/firefox/schemas/content_scripts.json
@@ -0,0 +1,98 @@
+[
+ {
+ "namespace": "contentScripts",
+ "max_manifest_version": 2,
+ "types": [
+ {
+ "id": "RegisteredContentScriptOptions",
+ "type": "object",
+ "description": "Details of a content script registered programmatically",
+ "properties": {
+ "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" }
+ },
+ "css": {
+ "type": "array",
+ "optional": true,
+ "description": "The list of CSS files to inject",
+ "items": { "$ref": "extensionTypes.ExtensionFileOrCode" }
+ },
+ "js": {
+ "type": "array",
+ "optional": true,
+ "description": "The list of JS files to inject",
+ "items": { "$ref": "extensionTypes.ExtensionFileOrCode" }
+ },
+ "allFrames": {"type": "boolean", "optional": true, "description": "If allFrames is true
, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's false
and is only injected into the top frame."},
+ "matchAboutBlank": {"type": "boolean", "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 false
."},
+ "runAt": {
+ "$ref": "extensionTypes.RunAt",
+ "optional": true,
+ "description": "The soonest that the JavaScript or CSS 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": "RegisteredContentScript",
+ "type": "object",
+ "description": "An object that represents a content script registered programmatically",
+ "functions": [
+ {
+ "name": "unregister",
+ "type": "function",
+ "description": "Unregister a content script registered programmatically",
+ "async": true,
+ "parameters": []
+ }
+ ]
+ }
+ ],
+ "functions": [
+ {
+ "name": "register",
+ "type": "function",
+ "description": "Register a content script programmatically",
+ "async": true,
+ "parameters": [
+ {
+ "name": "contentScriptOptions",
+ "$ref": "RegisteredContentScriptOptions"
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/contextual_identities.json b/interfaces/firefox/schemas/contextual_identities.json
new file mode 100644
index 00000000..e0c5337b
--- /dev/null
+++ b/interfaces/firefox/schemas/contextual_identities.json
@@ -0,0 +1,165 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "PermissionNoPrompt",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "contextualIdentities"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "contextualIdentities",
+ "description": "Use the browser.contextualIdentities
API to query and modify contextual identity, also called as containers.",
+ "permissions": ["contextualIdentities"],
+ "types": [
+ {
+ "id": "ContextualIdentity",
+ "type": "object",
+ "description": "Represents information about a contextual identity.",
+ "properties": {
+ "name": {"type": "string", "description": "The name of the contextual identity."},
+ "icon": {"type": "string", "description": "The icon name of the contextual identity."},
+ "iconUrl": {"type": "string", "description": "The icon url of the contextual identity."},
+ "color": {"type": "string", "description": "The color name of the contextual identity."},
+ "colorCode": {"type": "string", "description": "The color hash of the contextual identity."},
+ "cookieStoreId": {"type": "string", "description": "The cookie store ID of the contextual identity."}
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Retrieves information about a single contextual identity.",
+ "async": true,
+ "parameters": [
+ {
+ "type": "string",
+ "name": "cookieStoreId",
+ "description": "The ID of the contextual identity cookie store. "
+ }
+ ]
+ },
+ {
+ "name": "query",
+ "type": "function",
+ "description": "Retrieves all contextual identities",
+ "async": true,
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "description": "Information to filter the contextual identities being retrieved.",
+ "properties": {
+ "name": {"type": "string", "optional": true, "description": "Filters the contextual identity by name."}
+ }
+ }
+ ]
+ },
+ {
+ "name": "create",
+ "type": "function",
+ "description": "Creates a contextual identity with the given data.",
+ "async": true,
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "description": "Details about the contextual identity being created.",
+ "properties": {
+ "name": {"type": "string", "optional": false, "description": "The name of the contextual identity." },
+ "color": {"type": "string", "optional": false, "description": "The color of the contextual identity." },
+ "icon": {"type": "string", "optional": false, "description": "The icon of the contextual identity." }
+ }
+ }
+ ]
+ },
+ {
+ "name": "update",
+ "type": "function",
+ "description": "Updates a contextual identity with the given data.",
+ "async": true,
+ "parameters": [
+ {
+ "type": "string",
+ "name": "cookieStoreId",
+ "description": "The ID of the contextual identity cookie store. "
+ },
+ {
+ "type": "object",
+ "name": "details",
+ "description": "Details about the contextual identity being created.",
+ "properties": {
+ "name": {"type": "string", "optional": true, "description": "The name of the contextual identity." },
+ "color": {"type": "string", "optional": true, "description": "The color of the contextual identity." },
+ "icon": {"type": "string", "optional": true, "description": "The icon of the contextual identity." }
+ }
+ }
+ ]
+ },
+ {
+ "name": "remove",
+ "type": "function",
+ "description": "Deletes a contetual identity by its cookie Store ID.",
+ "async": true,
+ "parameters": [
+ {
+ "type": "string",
+ "name": "cookieStoreId",
+ "description": "The ID of the contextual identity cookie store. "
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onUpdated",
+ "type": "function",
+ "description": "Fired when a container is updated.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "changeInfo",
+ "properties": {
+ "contextualIdentity": {"$ref": "ContextualIdentity", "description": "Contextual identity that has been updated"}
+ }
+ }
+ ]
+ },
+ {
+ "name": "onCreated",
+ "type": "function",
+ "description": "Fired when a new container is created.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "changeInfo",
+ "properties": {
+ "contextualIdentity": {"$ref": "ContextualIdentity", "description": "Contextual identity that has been created"}
+ }
+ }
+ ]
+ },
+ {
+ "name": "onRemoved",
+ "type": "function",
+ "description": "Fired when a container is removed.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "changeInfo",
+ "properties": {
+ "contextualIdentity": {"$ref": "ContextualIdentity", "description": "Contextual identity that has been removed"}
+ }
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/cookies.json b/interfaces/firefox/schemas/cookies.json
new file mode 100644
index 00000000..aff0c615
--- /dev/null
+++ b/interfaces/firefox/schemas/cookies.json
@@ -0,0 +1,253 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermissionNoPrompt",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "cookies"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "cookies",
+ "description": "Use the browser.cookies
API to query and modify cookies, and to be notified when they change.",
+ "permissions": ["cookies"],
+ "types": [
+ {
+ "id": "SameSiteStatus",
+ "type": "string",
+ "enum": ["no_restriction", "lax", "strict"],
+ "description": "A cookie's 'SameSite' state (https://tools.ietf.org/html/draft-west-first-party-cookies). 'no_restriction' corresponds to a cookie set without a 'SameSite' attribute, 'lax' to 'SameSite=Lax', and 'strict' to 'SameSite=Strict'."
+ },
+ {
+ "id": "PartitionKey",
+ "type": "object",
+ "description": "The description of the storage partition of a cookie. This object may be omitted (null) if a cookie is not partitioned.",
+ "properties": {
+ "topLevelSite": {
+ "type": "string",
+ "optional": true,
+ "description": "The first-party URL of the cookie, if the cookie is in storage partitioned by the top-level site."
+ }
+ }
+ },
+ {
+ "id": "Cookie",
+ "type": "object",
+ "description": "Represents information about an HTTP cookie.",
+ "properties": {
+ "name": {"type": "string", "description": "The name of the cookie."},
+ "value": {"type": "string", "description": "The value of the cookie."},
+ "domain": {"type": "string", "description": "The domain of the cookie (e.g. \"www.google.com\", \"example.com\")."},
+ "hostOnly": {"type": "boolean", "description": "True if the cookie is a host-only cookie (i.e. a request's host must exactly match the domain of the cookie)."},
+ "path": {"type": "string", "description": "The path of the cookie."},
+ "secure": {"type": "boolean", "description": "True if the cookie is marked as Secure (i.e. its scope is limited to secure channels, typically HTTPS)."},
+ "httpOnly": {"type": "boolean", "description": "True if the cookie is marked as HttpOnly (i.e. the cookie is inaccessible to client-side scripts)."},
+ "sameSite": {"$ref": "SameSiteStatus", "description": "The cookie's same-site status (i.e. whether the cookie is sent with cross-site requests)."},
+ "session": {"type": "boolean", "description": "True if the cookie is a session cookie, as opposed to a persistent cookie with an expiration date."},
+ "expirationDate": {"type": "number", "optional": true, "description": "The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies."},
+ "storeId": {"type": "string", "description": "The ID of the cookie store containing this cookie, as provided in getAllCookieStores()."},
+ "firstPartyDomain": {"type": "string", "description": "The first-party domain of the cookie."},
+ "partitionKey": {"$ref": "PartitionKey", "optional": true, "description": "The cookie's storage partition, if any. null if not partitioned."}
+ }
+ },
+ {
+ "id": "CookieStore",
+ "type": "object",
+ "description": "Represents a cookie store in the browser. An incognito mode window, for instance, uses a separate cookie store from a non-incognito window.",
+ "properties": {
+ "id": {"type": "string", "description": "The unique identifier for the cookie store."},
+ "tabIds": {"type": "array", "items": {"type": "integer"}, "description": "Identifiers of all the browser tabs that share this cookie store."},
+ "incognito": {"type": "boolean", "description": "Indicates if this is an incognito cookie store"}
+ }
+ },
+ {
+ "id": "OnChangedCause",
+ "type": "string",
+ "enum": ["evicted", "expired", "explicit", "expired_overwrite", "overwrite"],
+ "description": "The underlying reason behind the cookie's change. If a cookie was inserted, or removed via an explicit call to $(ref:cookies.remove), \"cause\" will be \"explicit\". If a cookie was automatically removed due to expiry, \"cause\" will be \"expired\". If a cookie was removed due to being overwritten with an already-expired expiration date, \"cause\" will be set to \"expired_overwrite\". If a cookie was automatically removed due to garbage collection, \"cause\" will be \"evicted\". If a cookie was automatically removed due to a \"set\" call that overwrote it, \"cause\" will be \"overwrite\". Plan your response accordingly."
+ }
+ ],
+ "functions": [
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, the one with the longest path will be returned. For cookies with the same path length, the cookie with the earliest creation time will be returned.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "description": "Details to identify the cookie being retrieved.",
+ "properties": {
+ "url": {"type": "string", "description": "The URL with which the cookie to retrieve is associated. This argument may be a full URL, in which case any data following the URL path (e.g. the query string) is simply ignored. If host permissions for this URL are not specified in the manifest file, the API call will fail."},
+ "name": {"type": "string", "description": "The name of the cookie to retrieve."},
+ "storeId": {"type": "string", "optional": true, "description": "The ID of the cookie store in which to look for the cookie. By default, the current execution context's cookie store will be used."},
+ "firstPartyDomain": {"type": "string", "optional": true, "description": "The first-party domain which the cookie to retrieve is associated. This attribute is required if First-Party Isolation is enabled."},
+ "partitionKey": {"$ref": "PartitionKey", "optional": true, "description": "The storage partition, if the cookie is part of partitioned storage. By default, only non-partitioned cookies are returned."}
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "cookie", "$ref": "Cookie", "optional": true, "description": "Contains details about the cookie. This parameter is null if no such cookie was found."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getAll",
+ "type": "function",
+ "description": "Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "description": "Information to filter the cookies being retrieved.",
+ "properties": {
+ "url": {"type": "string", "optional": true, "description": "Restricts the retrieved cookies to those that would match the given URL."},
+ "name": {"type": "string", "optional": true, "description": "Filters the cookies by name."},
+ "domain": {"type": "string", "optional": true, "description": "Restricts the retrieved cookies to those whose domains match or are subdomains of this one."},
+ "path": {"type": "string", "optional": true, "description": "Restricts the retrieved cookies to those whose path exactly matches this string."},
+ "secure": {"type": "boolean", "optional": true, "description": "Filters the cookies by their Secure property."},
+ "session": {"type": "boolean", "optional": true, "description": "Filters out session vs. persistent cookies."},
+ "storeId": {"type": "string", "optional": true, "description": "The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used."},
+ "firstPartyDomain": {"type": "string", "optional": "omit-key-if-missing", "description": "Restricts the retrieved cookies to those whose first-party domains match this one. This attribute is required if First-Party Isolation is enabled. To not filter by a specific first-party domain, use `null` or `undefined`."},
+ "partitionKey": {"$ref": "PartitionKey", "optional": true, "description": "Selects a specific storage partition to look up cookies. Defaults to null, in which case only non-partitioned cookies are retrieved. If an object iis passed, partitioned cookies are also included, and filtered based on the keys present in the given PartitionKey description. An empty object ({}) returns all cookies (partitioned + unpartitioned), a non-empty object (e.g. {topLevelSite: '...'}) only returns cookies whose partition match all given attributes."}
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "cookies", "type": "array", "items": {"$ref": "Cookie"}, "description": "All the existing, unexpired cookies that match the given cookie info."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "set",
+ "type": "function",
+ "description": "Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "description": "Details about the cookie being set.",
+ "properties": {
+ "url": {"type": "string", "description": "The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail."},
+ "name": {"type": "string", "optional": true, "description": "The name of the cookie. Empty by default if omitted."},
+ "value": {"type": "string", "optional": true, "description": "The value of the cookie. Empty by default if omitted."},
+ "domain": {"type": "string", "optional": true, "description": "The domain of the cookie. If omitted, the cookie becomes a host-only cookie."},
+ "path": {"type": "string", "optional": true, "description": "The path of the cookie. Defaults to the path portion of the url parameter."},
+ "secure": {"type": "boolean", "optional": true, "description": "Whether the cookie should be marked as Secure. Defaults to false."},
+ "httpOnly": {"type": "boolean", "optional": true, "description": "Whether the cookie should be marked as HttpOnly. Defaults to false."},
+ "sameSite": {"$ref": "SameSiteStatus", "optional": true, "description": "The cookie's same-site status.", "default": "no_restriction"},
+ "expirationDate": {"type": "number", "optional": true, "description": "The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie."},
+ "storeId": {"type": "string", "optional": true, "description": "The ID of the cookie store in which to set the cookie. By default, the cookie is set in the current execution context's cookie store."},
+ "firstPartyDomain": {"type": "string", "optional": true, "description": "The first-party domain of the cookie. This attribute is required if First-Party Isolation is enabled."},
+ "partitionKey": {"$ref": "PartitionKey", "optional": true, "description": "The storage partition, if the cookie is part of partitioned storage. By default, non-partitioned storage is used."}
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "cookie", "$ref": "Cookie", "optional": true, "description": "Contains details about the cookie that's been set. If setting failed for any reason, this will be \"null\", and $(ref:runtime.lastError) will be set."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "remove",
+ "type": "function",
+ "description": "Deletes a cookie by name.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "description": "Information to identify the cookie to remove.",
+ "properties": {
+ "url": {"type": "string", "description": "The URL associated with the cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail."},
+ "name": {"type": "string", "description": "The name of the cookie to remove."},
+ "storeId": {"type": "string", "optional": true, "description": "The ID of the cookie store to look in for the cookie. If unspecified, the cookie is looked for by default in the current execution context's cookie store."},
+ "firstPartyDomain": {"type": "string", "optional": true, "description": "The first-party domain associated with the cookie. This attribute is required if First-Party Isolation is enabled."},
+ "partitionKey": {"$ref": "PartitionKey", "optional": true, "description": "The storage partition, if the cookie is part of partitioned storage. By default, non-partitioned storage is used."}
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "description": "Contains details about the cookie that's been removed. If removal failed for any reason, this will be \"null\", and $(ref:runtime.lastError) will be set.",
+ "optional": true,
+ "properties": {
+ "url": {"type": "string", "description": "The URL associated with the cookie that's been removed."},
+ "name": {"type": "string", "description": "The name of the cookie that's been removed."},
+ "storeId": {"type": "string", "description": "The ID of the cookie store from which the cookie was removed."},
+ "firstPartyDomain": {"type": "string", "description": "The first-party domain associated with the cookie that's been removed."},
+ "partitionKey": {"$ref": "PartitionKey", "optional": true, "description": "The storage partition, if the cookie is part of partitioned storage. null if not partitioned."}
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getAllCookieStores",
+ "type": "function",
+ "description": "Lists all existing cookie stores.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "cookieStores", "type": "array", "items": {"$ref": "CookieStore"}, "description": "All the existing cookie stores."
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onChanged",
+ "type": "function",
+ "description": "Fired when a cookie is set or removed. As a special case, note that updating a cookie's properties is implemented as a two step process: the cookie to be updated is first removed entirely, generating a notification with \"cause\" of \"overwrite\" . Afterwards, a new cookie is written with the updated values, generating a second notification with \"cause\" \"explicit\".",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "changeInfo",
+ "properties": {
+ "removed": {"type": "boolean", "description": "True if a cookie was removed."},
+ "cookie": {"$ref": "Cookie", "description": "Information about the cookie that was set or removed."},
+ "cause": {"$ref": "OnChangedCause", "description": "The underlying reason behind the cookie's change."}
+ }
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/declarative_net_request.json b/interfaces/firefox/schemas/declarative_net_request.json
new file mode 100644
index 00000000..7f9f9ba5
--- /dev/null
+++ b/interfaces/firefox/schemas/declarative_net_request.json
@@ -0,0 +1,776 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "Permission",
+ "choices": [{
+ "type": "string",
+ "enum": ["declarativeNetRequest"],
+ "min_manifest_version": 3
+ }]
+ },
+ {
+ "$extend": "OptionalPermission",
+ "choices": [{
+ "type": "string",
+ "enum": ["declarativeNetRequestFeedback"],
+ "min_manifest_version": 3
+ }]
+ },
+ {
+ "$extend": "PermissionNoPrompt",
+ "choices": [{
+ "type": "string",
+ "enum": ["declarativeNetRequestWithHostAccess"],
+ "min_manifest_version": 3
+ }]
+ },
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "declarative_net_request": {
+ "type": "object",
+ "min_manifest_version": 3,
+ "optional": true,
+ "additionalProperties": { "$ref": "UnrecognizedProperty" },
+ "properties": {
+ "rule_resources": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "additionalProperties": { "$ref": "UnrecognizedProperty" },
+ "properties": {
+ "id": {
+ "type": "string",
+ "pattern": "^[^_]",
+ "description": "A non-empty string uniquely identifying the ruleset. IDs beginning with '_' are reserved for internal use."
+ },
+ "enabled": {
+ "type": "boolean",
+ "description": "Whether the ruleset is enabled by default."
+ },
+ "path": {
+ "$ref": "manifest.ExtensionURL",
+ "description": "The path of the JSON ruleset relative to the extension directory."
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ {
+ "namespace": "declarativeNetRequest",
+ "description": "Use the declarativeNetRequest API to block or modify network requests by specifying declarative rules.",
+ "permissions": ["declarativeNetRequest", "declarativeNetRequestWithHostAccess"],
+ "types": [
+ {
+ "id": "ResourceType",
+ "type": "string",
+ "description": "How the requested resource will be used. Comparable to the webRequest.ResourceType type.",
+ "enum": [
+ "main_frame",
+ "sub_frame",
+ "stylesheet",
+ "script",
+ "image",
+ "object",
+ "object_subrequest",
+ "xmlhttprequest",
+ "xslt",
+ "ping",
+ "beacon",
+ "xml_dtd",
+ "font",
+ "media",
+ "websocket",
+ "csp_report",
+ "imageset",
+ "web_manifest",
+ "speculative",
+ "other"
+ ]
+ },
+ {
+ "id": "UnsupportedRegexReason",
+ "type": "string",
+ "description": "Describes the reason why a given regular expression isn't supported.",
+ "enum": [
+ "syntaxError",
+ "memoryLimitExceeded"
+ ]
+ },
+ {
+ "id": "MatchedRule",
+ "type": "object",
+ "properties": {
+ "ruleId": {
+ "type": "integer",
+ "description": "A matching rule's ID."
+ },
+ "rulesetId": {
+ "type": "string",
+ "description": "ID of the Ruleset this rule belongs to."
+ },
+ "extensionId": {
+ "type": "string",
+ "description": "ID of the extension, if this rule belongs to a different extension.",
+ "optional": true
+ }
+ }
+ },
+ {
+ "id": "URLTransform",
+ "type": "object",
+ "description": "Describes the type of the Rule.action.redirect.transform property.",
+ "properties": {
+ "scheme": {
+ "type": "string",
+ "optional": true,
+ "description": "The new scheme for the request.",
+ "enum": ["http", "https", "moz-extension"]
+ },
+ "username": {
+ "type": "string",
+ "optional": true,
+ "description": "The new username for the request."
+ },
+ "password": {
+ "type": "string",
+ "optional": true,
+ "description": "The new password for the request."
+ },
+ "host": {
+ "type": "string",
+ "optional": true,
+ "description": "The new host name for the request."
+ },
+ "port": {
+ "type": "string",
+ "optional": true,
+ "description": "The new port for the request. If empty, the existing port is cleared."
+ },
+ "path": {
+ "type": "string",
+ "optional": true,
+ "description": "The new path for the request. If empty, the existing path is cleared."
+ },
+ "query": {
+ "type": "string",
+ "optional": true,
+ "description": "The new query for the request. Should be either empty, in which case the existing query is cleared; or should begin with '?'. Cannot be specified if 'queryTransform' is specified."
+ },
+ "queryTransform": {
+ "type": "object",
+ "optional": true,
+ "description": "Add, remove or replace query key-value pairs. Cannot be specified if 'query' is specified.",
+ "properties": {
+ "removeParams": {
+ "type": "array",
+ "optional": true,
+ "description": "The list of query keys to be removed.",
+ "items": {
+ "type": "string"
+ }
+ },
+ "addOrReplaceParams": {
+ "type": "array",
+ "optional": true,
+ "description": "The list of query key-value pairs to be added or replaced.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "replaceOnly": {
+ "type": "boolean",
+ "optional": true,
+ "description": "If true, the query key is replaced only if it's already present. Otherwise, the key is also added if it's missing.",
+ "default": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "fragment": {
+ "type": "string",
+ "optional": true,
+ "description": "The new fragment for the request. Should be either empty, in which case the existing fragment is cleared; or should begin with '#'."
+ }
+ }
+ },
+ {
+ "id": "Rule",
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "An id which uniquely identifies a rule. Mandatory and should be >= 1.",
+ "minimum": 1
+ },
+ "priority": {
+ "type": "integer",
+ "optional": true,
+ "description": "Rule priority. Defaults to 1. When specified, should be >= 1",
+ "minimum": 1,
+ "default": 1
+ },
+ "condition": {
+ "type": "object",
+ "description": "The condition under which this rule is triggered.",
+ "properties": {
+ "urlFilter": {
+ "type": "string",
+ "optional": true,
+ "description": "TODO: link to doc explaining supported pattern. The pattern which is matched against the network request url. Only one of 'urlFilter' or 'regexFilter' can be specified."
+ },
+ "regexFilter": {
+ "type": "string",
+ "optional": true,
+ "description": "Regular expression to match against the network request url. Only one of 'urlFilter' or 'regexFilter' can be specified."
+ },
+ "isUrlFilterCaseSensitive": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether 'urlFilter' or 'regexFilter' is case-sensitive."
+ },
+ "initiatorDomains": {
+ "type": "array",
+ "optional": true,
+ "description": "The rule will only match network requests originating from the list of 'initiatorDomains'. If the list is omitted, the rule is applied to requests from all domains.",
+ "minItems": 1,
+ "items": {
+ "type": "string",
+ "format": "canonicalDomain"
+ }
+ },
+ "excludedInitiatorDomains": {
+ "type": "array",
+ "optional": true,
+ "description": "The rule will not match network requests originating from the list of 'initiatorDomains'. If the list is empty or omitted, no domains are excluded. This takes precedence over 'initiatorDomains'.",
+ "items": {
+ "type": "string",
+ "format": "canonicalDomain"
+ }
+ },
+ "requestDomains": {
+ "type": "array",
+ "optional": true,
+ "description": "The rule will only match network requests when the domain matches one from the list of 'requestDomains'. If the list is omitted, the rule is applied to requests from all domains.",
+ "minItems": 1,
+ "items": {
+ "type": "string",
+ "format": "canonicalDomain"
+ }
+ },
+ "excludedRequestDomains": {
+ "type": "array",
+ "optional": true,
+ "description": "The rule will not match network requests when the domains matches one from the list of 'excludedRequestDomains'. If the list is empty or omitted, no domains are excluded. This takes precedence over 'requestDomains'.",
+ "items": {
+ "type": "string",
+ "format": "canonicalDomain"
+ }
+ },
+ "resourceTypes": {
+ "type": "array",
+ "optional": true,
+ "description": "List of resource types which the rule can match. When the rule action is 'allowAllRequests', this must be specified and may only contain 'main_frame' or 'sub_frame'. Cannot be specified if 'excludedResourceTypes' is specified. If neither of them is specified, all resource types except 'main_frame' are matched.",
+ "minItems": 1,
+ "items": {
+ "$ref": "ResourceType"
+ }
+ },
+ "excludedResourceTypes": {
+ "type": "array",
+ "optional": true,
+ "description": "List of resource types which the rule won't match. Cannot be specified if 'resourceTypes' is specified. If neither of them is specified, all resource types except 'main_frame' are matched.",
+ "items": {
+ "$ref": "ResourceType"
+ }
+ },
+ "requestMethods": {
+ "type": "array",
+ "optional": true,
+ "description": "List of HTTP request methods which the rule can match. Should be a lower-case method such as 'connect', 'delete', 'get', 'head', 'options', 'patch', 'post', 'put'.'",
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
+ },
+ "excludedRequestMethods": {
+ "type": "array",
+ "optional": true,
+ "description": "List of request methods which the rule won't match. Cannot be specified if 'requestMethods' is specified. If neither of them is specified, all request methods are matched.",
+ "items": {
+ "type": "string"
+ }
+ },
+ "domainType": {
+ "type": "string",
+ "optional": true,
+ "description": "Specifies whether the network request is first-party or third-party to the domain from which it originated. If omitted, all requests are matched.",
+ "enum": ["firstParty", "thirdParty"]
+ },
+ "tabIds": {
+ "type": "array",
+ "optional": true,
+ "description": "List of tabIds which the rule should match. An ID of -1 matches requests which don't originate from a tab. Only supported for session-scoped rules.",
+ "minItems": 1,
+ "items": {
+ "type": "integer"
+ }
+ },
+ "excludedTabIds": {
+ "type": "array",
+ "optional": true,
+ "description": "List of tabIds which the rule should not match. An ID of -1 excludes requests which don't originate from a tab. Only supported for session-scoped rules.",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "action": {
+ "type": "object",
+ "description": "The action to take if this rule is matched.",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": ["block", "redirect", "allow", "upgradeScheme", "modifyHeaders", "allowAllRequests"]
+ },
+ "redirect": {
+ "type": "object",
+ "optional": true,
+ "description": "Describes how the redirect should be performed. Only valid when type is 'redirect'.",
+ "properties": {
+ "extensionPath": {
+ "type": "string",
+ "optional": true,
+ "description": "Path relative to the extension directory. Should start with '/'."
+ },
+ "transform": {
+ "$ref": "URLTransform",
+ "optional": true,
+ "description": "Url transformations to perform."
+ },
+ "url": {
+ "type": "string",
+ "format": "url",
+ "optional": true,
+ "description": "The redirect url. Redirects to JavaScript urls are not allowed."
+ },
+ "regexSubstitution": {
+ "type": "string",
+ "optional": true,
+ "description": "Substitution pattern for rules which specify a 'regexFilter'. The first match of regexFilter within the url will be replaced with this pattern. Within regexSubstitution, backslash-escaped digits (\\1 to \\9) can be used to insert the corresponding capture groups. \\0 refers to the entire matching text."
+ }
+ }
+ },
+ "requestHeaders": {
+ "type": "array",
+ "optional": true,
+ "description": "The request headers to modify for the request. Only valid when type is 'modifyHeaders'.",
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "header": {
+ "type": "string",
+ "description": "The name of the request header to be modified."
+ },
+ "operation": {
+ "type": "string",
+ "description": "The operation to be performed on a header.",
+ "enum": ["append", "set", "remove"]
+ },
+ "value": {
+ "type": "string",
+ "optional": true,
+ "description": "The new value for the header. Must be specified for the 'append' and 'set' operations."
+ }
+ }
+ }
+ },
+ "responseHeaders": {
+ "type": "array",
+ "optional": true,
+ "description": "The response headers to modify for the request. Only valid when type is 'modifyHeaders'.",
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "header": {
+ "type": "string",
+ "description": "The name of the response header to be modified."
+ },
+ "operation": {
+ "type": "string",
+ "description": "The operation to be performed on a header.",
+ "enum": ["append", "set", "remove"]
+ },
+ "value": {
+ "type": "string",
+ "optional": true,
+ "description": "The new value for the header. Must be specified for the 'append' and 'set' operations."
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "updateDynamicRules",
+ "type": "function",
+ "description": "Modifies the current set of dynamic rules for the extension. The rules with IDs listed in options.removeRuleIds are first removed, and then the rules given in options.addRules are added. These rules are persisted across browser sessions and extension updates.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "options",
+ "type": "object",
+ "properties": {
+ "removeRuleIds": {
+ "type": "array",
+ "optional": true,
+ "description": "IDs of the rules to remove. Any invalid IDs will be ignored.",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "addRules": {
+ "type": "array",
+ "optional": true,
+ "description": "Rules to add.",
+ "items": {
+ "$ref": "Rule"
+ }
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when the dynamic rules have been updated",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "updateSessionRules",
+ "type": "function",
+ "description": "Modifies the current set of session scoped rules for the extension. The rules with IDs listed in options.removeRuleIds are first removed, and then the rules given in options.addRules are added. These rules are not persisted across sessions and are backed in memory.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "options",
+ "type": "object",
+ "properties": {
+ "removeRuleIds": {
+ "type": "array",
+ "optional": true,
+ "description": "IDs of the rules to remove. Any invalid IDs will be ignored.",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "addRules": {
+ "type": "array",
+ "optional": true,
+ "description": "Rules to add.",
+ "items": {
+ "$ref": "Rule"
+ }
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when the session rules have been updated",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "getEnabledRulesets",
+ "type": "function",
+ "description": "Returns the ids for the current set of enabled static rulesets.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "type": "array",
+ "name": "rulesetIds",
+ "items": { "type": "string" }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "updateEnabledRulesets",
+ "type": "function",
+ "description": "Returns the ids for the current set of enabled static rulesets.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "updateRulesetOptions",
+ "type": "object",
+ "properties": {
+ "disableRulesetIds": {
+ "type": "array",
+ "items": { "type": "string" },
+ "optional": true,
+ "default": []
+ },
+ "enableRulesetIds": {
+ "type": "array",
+ "items": { "type": "string" },
+ "optional": true,
+ "default": []
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "getAvailableStaticRuleCount",
+ "type": "function",
+ "description": "Returns the remaining number of static rules an extension can enable",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "count",
+ "type": "integer"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getDynamicRules",
+ "type": "function",
+ "description": "Returns the current set of dynamic rules for the extension.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "dynamicRules",
+ "type": "array",
+ "items": {
+ "$ref": "Rule"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getSessionRules",
+ "type": "function",
+ "description": "Returns the current set of session scoped rules for the extension.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "sessionRules",
+ "type": "array",
+ "items": {
+ "$ref": "Rule"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "isRegexSupported",
+ "type": "function",
+ "description": "Checks if the given regular expression will be supported as a 'regexFilter' rule condition.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "regexOptions",
+ "type": "object",
+ "properties": {
+ "regex": {
+ "type": "string",
+ "description": "The regular expresson to check."
+ },
+ "isCaseSensitive": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the 'regex' specified is case sensitive.",
+ "default": false
+ },
+ "requireCapturing": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the 'regex' specified requires capturing. Capturing is only required for redirect rules which specify a 'regexSubstition' action.",
+ "default": false
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "object",
+ "properties": {
+ "isSupported": {
+ "type": "boolean",
+ "description": "Whether the given regex is supported"
+ },
+ "reason": {
+ "$ref": "UnsupportedRegexReason",
+ "optional": true,
+ "description": "Specifies the reason why the regular expression is not supported. Only provided if 'isSupported' is false."
+ }
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "testMatchOutcome",
+ "type": "function",
+ "description": "Checks if any of the extension's declarativeNetRequest rules would match a hypothetical request.",
+ "permissions": ["declarativeNetRequestFeedback"],
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "request",
+ "type": "object",
+ "description": "The details of the request to test.",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "The URL of the hypothetical request."
+ },
+ "initiator": {
+ "type": "string",
+ "description": "The initiator URL (if any) for the hypothetical request.",
+ "optional": true
+ },
+ "method": {
+ "type": "string",
+ "description": "Standard HTTP method of the hypothetical request.",
+ "optional": true,
+ "default": "get"
+ },
+ "type": {
+ "$ref": "ResourceType",
+ "description": "The resource type of the hypothetical request."
+ },
+ "tabId": {
+ "type": "integer",
+ "description": "The ID of the tab in which the hypothetical request takes place. Does not need to correspond to a real tab ID. Default is -1, meaning that the request isn't related to a tab.",
+ "optional": true,
+ "default": -1
+ }
+ }
+ },
+ {
+ "name": "options",
+ "type": "object",
+ "optional": true,
+ "properties": {
+ "includeOtherExtensions": {
+ "type": "boolean",
+ "description": "Whether to account for rules from other installed extensions during rule evaluation.",
+ "optional": true
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called with the details of matched rules.",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "object",
+ "properties": {
+ "matchedRules": {
+ "type": "array",
+ "description": "The rules (if any) that match the hypothetical request.",
+ "items": {
+ "$ref": "MatchedRule"
+ }
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "properties": {
+ "DYNAMIC_RULESET_ID": {
+ "type": "string",
+ "value": "_dynamic",
+ "description": "Ruleset ID for the dynamic rules added by the extension."
+ },
+ "GUARANTEED_MINIMUM_STATIC_RULES": {
+ "type": "number",
+ "description": "The minimum number of static rules guaranteed to an extension across its enabled static rulesets. Any rules above this limit will count towards the global static rule limit."
+ },
+ "MAX_NUMBER_OF_STATIC_RULESETS": {
+ "type": "number",
+ "description": "The maximum number of static Rulesets an extension can specify as part of the rule_resources manifest key."
+ },
+ "MAX_NUMBER_OF_ENABLED_STATIC_RULESETS": {
+ "type": "number",
+ "description": "The maximum number of static Rulesets an extension can enable at any one time."
+ },
+ "MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES": {
+ "type": "number",
+ "description": "The maximum number of dynamic and session rules an extension can add. NOTE: in the Firefox we are enforcing this limit to the session and dynamic rules count separately, instead of enforcing it to the rules count for both combined as the Chrome implementation does."
+ },
+ "MAX_NUMBER_OF_REGEX_RULES": {
+ "type": "number",
+ "description": "The maximum number of regular expression rules that an extension can add. This limit is evaluated separately for the set of session rules, dynamic rules and those specified in the rule_resources file."
+ },
+ "SESSION_RULESET_ID": {
+ "type": "string",
+ "value": "_session",
+ "description": "Ruleset ID for the session-scoped rules added by the extension."
+ }
+ }
+ }
+]
diff --git a/interfaces/firefox/schemas/devtools.json b/interfaces/firefox/schemas/devtools.json
new file mode 100644
index 00000000..7f0b81ba
--- /dev/null
+++ b/interfaces/firefox/schemas/devtools.json
@@ -0,0 +1,31 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "devtools_page": {
+ "$ref": "ExtensionURL",
+ "optional": true
+ }
+ }
+ },
+ {
+ "$extend": "OptionalPermission",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "devtools"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "devtools",
+ "permissions": ["manifest:devtools_page"],
+ "allowedContexts": ["devtools", "devtools_only"],
+ "defaultContexts": ["devtools", "devtools_only"]
+ }
+]
diff --git a/interfaces/firefox/schemas/devtools_inspected_window.json b/interfaces/firefox/schemas/devtools_inspected_window.json
new file mode 100644
index 00000000..bea135be
--- /dev/null
+++ b/interfaces/firefox/schemas/devtools_inspected_window.json
@@ -0,0 +1,267 @@
+[
+ {
+ "namespace": "devtools.inspectedWindow",
+ "allowedContexts": ["devtools", "devtools_only"],
+ "defaultContexts": ["devtools", "devtools_only"],
+ "description": "Use the chrome.devtools.inspectedWindow
API to interact with the inspected window: obtain the tab ID for the inspected page, evaluate the code in the context of the inspected window, reload the page, or obtain the list of resources within the page.",
+ "nocompile": true,
+ "types": [
+ {
+ "id": "Resource",
+ "type": "object",
+ "description": "A resource within the inspected page, such as a document, a script, or an image.",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "The URL of the resource."
+ }
+ },
+ "functions": [
+ {
+ "name": "getContent",
+ "unsupported": true,
+ "type": "function",
+ "async": "callback",
+ "description": "Gets the content of the resource.",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "A function that receives resource content when the request completes.",
+ "parameters": [
+ {
+ "name": "content",
+ "type": "string",
+ "description": "Content of the resource (potentially encoded)."
+ },
+ {
+ "name": "encoding",
+ "type": "string",
+ "description": "Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setContent",
+ "unsupported": true,
+ "type": "function",
+ "async": "callback",
+ "description": "Sets the content of the resource.",
+ "parameters": [
+ {
+ "name": "content",
+ "type": "string",
+ "description": "New content of the resource. Only resources with the text type are currently supported."
+ },
+ {
+ "name": "commit",
+ "type": "boolean",
+ "description": "True if the user has finished editing the resource, and the new content of the resource should be persisted; false if this is a minor change sent in progress of the user editing the resource."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "A function called upon request completion.",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "error",
+ "type": "object",
+ "additionalProperties": {"type": "any"},
+ "optional": true,
+ "description": "Set to undefined if the resource content was set successfully; describes error otherwise."
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "properties": {
+ "tabId": {
+ "description": "The ID of the tab being inspected. This ID may be used with chrome.tabs.* API.",
+ "type": "integer"
+ }
+ },
+ "functions": [
+ {
+ "name": "eval",
+ "type": "function",
+ "description": "Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. In either case, the result
parameter of the callback is undefined
. In the case of a DevTools-side error, the isException
parameter is non-null and has isError
set to true and code
set to an error code. In the case of a JavaScript error, isException
is set to true and value
is set to the string value of thrown object.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "expression",
+ "type": "string",
+ "description": "An expression to evaluate."
+ },
+ {
+ "name": "options",
+ "type": "object",
+ "optional": true,
+ "description": "The options parameter can contain one or more options.",
+ "properties": {
+ "frameURL": {
+ "type": "string",
+ "unsupported": true,
+ "optional": true,
+ "description": "If specified, the expression is evaluated on the iframe whose URL matches the one specified. By default, the expression is evaluated in the top frame of the inspected page."
+ },
+ "useContentScriptContext": {
+ "type": "boolean",
+ "unsupported": true,
+ "optional": true,
+ "description": "Evaluate the expression in the context of the content script of the calling extension, provided that the content script is already injected into the inspected page. If not, the expression is not evaluated and the callback is invoked with the exception parameter set to an object that has the isError
field set to true and the code
field set to E_NOTFOUND
."
+ },
+ "contextSecurityOrigin": {
+ "type": "string",
+ "unsupported": true,
+ "optional": true,
+ "description": "Evaluate the expression in the context of a content script of an extension that matches the specified origin. If given, contextSecurityOrigin overrides the 'true' setting on userContentScriptContext."
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "A function called when evaluation completes.",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "result",
+ "type": "any",
+ "description": "The result of evaluation."
+ },
+ {
+ "name": "exceptionInfo",
+ "type": "object",
+ "optional": true,
+ "description": "An object providing details if an exception occurred while evaluating the expression.",
+ "properties": {
+ "isError": {
+ "type": "boolean",
+ "description": "Set if the error occurred on the DevTools side before the expression is evaluated."
+ },
+ "code": {
+ "type": "string",
+ "description": "Set if the error occurred on the DevTools side before the expression is evaluated."
+ },
+ "description": {
+ "type": "string",
+ "description": "Set if the error occurred on the DevTools side before the expression is evaluated."
+ },
+ "details": {
+ "type": "array",
+ "items": { "type": "any" },
+ "description": "Set if the error occurred on the DevTools side before the expression is evaluated, contains the array of the values that may be substituted into the description string to provide more information about the cause of the error."
+ },
+ "isException": {
+ "type": "boolean",
+ "description": "Set if the evaluated code produces an unhandled exception."
+ },
+ "value": {
+ "type": "string",
+ "description": "Set if the evaluated code produces an unhandled exception."
+ }
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "reload",
+ "type": "function",
+ "description": "Reloads the inspected page.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "reloadOptions",
+ "optional": true,
+ "properties": {
+ "ignoreCache": {
+ "type": "boolean",
+ "optional": true,
+ "description": "When true, the loader will bypass the cache for all inspected page resources loaded before the load
event is fired. The effect is similar to pressing Ctrl+Shift+R in the inspected window or within the Developer Tools window."
+ },
+ "userAgent": {
+ "type": "string",
+ "optional": true,
+ "description": "If specified, the string will override the value of the User-Agent
HTTP header that's sent while loading the resources of the inspected page. The string will also override the value of the navigator.userAgent
property that's returned to any scripts that are running within the inspected page."
+ },
+ "injectedScript": {
+ "type": "string",
+ "optional": true,
+ "description": "If specified, the script will be injected into every frame of the inspected page immediately upon load, before any of the frame's scripts. The script will not be injected after subsequent reloads—for example, if the user presses Ctrl+R."
+ },
+ "preprocessorScript": {
+ "unsupported": true,
+ "type": "string",
+ "deprecated": "Please avoid using this parameter, it will be removed soon.",
+ "optional": true,
+ "description": "If specified, this script evaluates into a function that accepts three string arguments: the source to preprocess, the URL of the source, and a function name if the source is an DOM event handler. The preprocessorerScript function should return a string to be compiled by Chrome in place of the input source. In the case that the source is a DOM event handler, the returned source must compile to a single JS function."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "getResources",
+ "unsupported": true,
+ "type": "function",
+ "description": "Retrieves the list of resources from the inspected page.",
+ "unsupported": true,
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "A function that receives the list of resources when the request completes.",
+ "parameters": [
+ {
+ "name": "resources",
+ "type": "array",
+ "items": { "$ref": "Resource" },
+ "description": "The resources within the page."
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onResourceAdded",
+ "unsupported": true,
+ "type": "function",
+ "description": "Fired when a new resource is added to the inspected page.",
+ "parameters": [
+ {
+ "name": "resource",
+ "$ref": "Resource"
+ }
+ ]
+ },
+ {
+ "name": "onResourceContentCommitted",
+ "unsupported": true,
+ "type": "function",
+ "description": "Fired when a new revision of the resource is committed (e.g. user saves an edited version of the resource in the Developer Tools).",
+ "parameters": [
+ {
+ "name": "resource",
+ "$ref": "Resource"
+ },
+ {
+ "name": "content",
+ "type": "string",
+ "description": "New content of the resource."
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/devtools_network.json b/interfaces/firefox/schemas/devtools_network.json
new file mode 100644
index 00000000..491b4aa2
--- /dev/null
+++ b/interfaces/firefox/schemas/devtools_network.json
@@ -0,0 +1,91 @@
+[
+ {
+ "namespace": "devtools.network",
+ "allowedContexts": ["devtools", "devtools_only"],
+ "defaultContexts": ["devtools", "devtools_only"],
+ "description": "Use the chrome.devtools.network
API to retrieve the information about network requests displayed by the Developer Tools in the Network panel.",
+ "types": [
+ {
+ "id": "Request",
+ "type": "object",
+ "description": "Represents a network request for a document resource (script, image and so on). See HAR Specification for reference.",
+ "functions": [
+ {
+ "name": "getContent",
+ "type": "function",
+ "description": "Returns content of the response body.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "A function that receives the response body when the request completes.",
+ "parameters": [
+ {
+ "name": "content",
+ "type": "string",
+ "description": "Content of the response body (potentially encoded)."
+ },
+ {
+ "name": "encoding",
+ "type": "string",
+ "description": "Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported."
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "functions": [
+ {
+ "name": "getHAR",
+ "type": "function",
+ "description": "Returns HAR log that contains all known network requests.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "A function that receives the HAR log when the request completes.",
+ "parameters": [
+ {
+ "name": "harLog",
+ "type": "object",
+ "additionalProperties": {"type": "any"},
+ "description": "A HAR log. See HAR specification for details."
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onRequestFinished",
+ "type": "function",
+ "description": "Fired when a network request is finished and all request data are available.",
+ "parameters": [
+ {
+ "name": "request",
+ "$ref": "Request",
+ "description": "Description of a network request in the form of a HAR entry. See HAR specification for details."
+ }
+ ]
+ },
+ {
+ "name": "onNavigated",
+ "type": "function",
+ "description": "Fired when the inspected window navigates to a new page.",
+ "parameters": [
+ {
+ "name": "url",
+ "type": "string",
+ "description": "URL of the new page."
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/devtools_panels.json b/interfaces/firefox/schemas/devtools_panels.json
new file mode 100644
index 00000000..ae71950a
--- /dev/null
+++ b/interfaces/firefox/schemas/devtools_panels.json
@@ -0,0 +1,422 @@
+[
+ {
+ "namespace": "devtools.panels",
+ "allowedContexts": ["devtools", "devtools_only"],
+ "defaultContexts": ["devtools", "devtools_only"],
+ "description": "Use the chrome.devtools.panels
API to integrate your extension into Developer Tools window UI: create your own panels, access existing panels, and add sidebars.",
+ "nocompile": true,
+ "types": [
+ {
+ "id": "ElementsPanel",
+ "type": "object",
+ "description": "Represents the Elements panel.",
+ "events": [
+ {
+ "name": "onSelectionChanged",
+ "type": "function",
+ "description": "Fired when an object is selected in the panel."
+ }
+ ],
+ "functions": [
+ {
+ "name": "createSidebarPane",
+ "async": "callback",
+ "type": "function",
+ "description": "Creates a pane within panel's sidebar.",
+ "parameters": [
+ {
+ "name": "title",
+ "type": "string",
+ "description": "Text that is displayed in sidebar caption."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "A callback invoked when the sidebar is created.",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "result",
+ "description": "An ExtensionSidebarPane object for created sidebar pane.",
+ "$ref": "ExtensionSidebarPane"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "id": "SourcesPanel",
+ "type": "object",
+ "description": "Represents the Sources panel.",
+ "events": [
+ {
+ "name": "onSelectionChanged",
+ "unsupported": true,
+ "description": "Fired when an object is selected in the panel."
+ }
+ ],
+ "functions": [
+ {
+ "name": "createSidebarPane",
+ "unsupported": true,
+ "type": "function",
+ "description": "Creates a pane within panel's sidebar.",
+ "parameters": [
+ {
+ "name": "title",
+ "type": "string",
+ "description": "Text that is displayed in sidebar caption."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "A callback invoked when the sidebar is created.",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "result",
+ "description": "An ExtensionSidebarPane object for created sidebar pane.",
+ "$ref": "ExtensionSidebarPane"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "id": "ExtensionPanel",
+ "type": "object",
+ "description": "Represents a panel created by extension.",
+ "functions": [
+ {
+ "name": "createStatusBarButton",
+ "unsupported": true,
+ "description": "Appends a button to the status bar of the panel.",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "iconPath",
+ "type": "string",
+ "description": "Path to the icon of the button. The file should contain a 64x24-pixel image composed of two 32x24 icons. The left icon is used when the button is inactive; the right icon is displayed when the button is pressed."
+ },
+ {
+ "name": "tooltipText",
+ "type": "string",
+ "description": "Text shown as a tooltip when user hovers the mouse over the button."
+ },
+ {
+ "name": "disabled",
+ "type": "boolean",
+ "description": "Whether the button is disabled."
+ }
+ ],
+ "returns": { "$ref": "Button" }
+ }
+ ],
+ "events": [
+ {
+ "name": "onSearch",
+ "unsupported": true,
+ "description": "Fired upon a search action (start of a new search, search result navigation, or search being canceled).",
+ "parameters": [
+ {
+ "name": "action",
+ "type": "string",
+ "description": "Type of search action being performed."
+ },
+ {
+ "name": "queryString",
+ "type": "string",
+ "optional": true,
+ "description": "Query string (only for 'performSearch')."
+ }
+ ]
+ },
+ {
+ "name": "onShown",
+ "type": "function",
+ "description": "Fired when the user switches to the panel.",
+ "parameters": [
+ {
+ "name": "window",
+ "type": "object",
+ "isInstanceOf": "global",
+ "additionalProperties": { "type": "any" },
+ "description": "The JavaScript window
object of panel's page."
+ }
+ ]
+ },
+ {
+ "name": "onHidden",
+ "type": "function",
+ "description": "Fired when the user switches away from the panel."
+ }
+ ]
+ },
+ {
+ "id": "ExtensionSidebarPane",
+ "type": "object",
+ "description": "A sidebar created by the extension.",
+ "functions": [
+ {
+ "name": "setHeight",
+ "unsupported": true,
+ "type": "function",
+ "description": "Sets the height of the sidebar.",
+ "parameters": [
+ {
+ "name": "height",
+ "type": "string",
+ "description": "A CSS-like size specification, such as '100px'
or '12ex'
."
+ }
+ ]
+ },
+ {
+ "name": "setExpression",
+ "async": "callback",
+ "type": "function",
+ "description": "Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane.",
+ "parameters": [
+ {
+ "name": "expression",
+ "type": "string",
+ "description": "An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch."
+ },
+ {
+ "name": "rootTitle",
+ "type": "string",
+ "optional": true,
+ "description": "An optional title for the root of the expression tree."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "optional": true,
+ "description": "A callback invoked after the sidebar pane is updated with the expression evaluation results."
+ }
+ ]
+ },
+ {
+ "name": "setObject",
+ "async": "callback",
+ "type": "function",
+ "description": "Sets a JSON-compliant object to be displayed in the sidebar pane.",
+ "parameters": [
+ {
+ "name": "jsonObject",
+ "type": "string",
+ "description": "An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client)."
+ },
+ {
+ "name": "rootTitle",
+ "type": "string",
+ "optional": true,
+ "description": "An optional title for the root of the expression tree."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "optional": true,
+ "description": "A callback invoked after the sidebar is updated with the object."
+ }
+ ]
+ },
+ {
+ "name": "setPage",
+ "type": "function",
+ "async": true,
+ "description": "Sets an HTML page to be displayed in the sidebar pane.",
+ "parameters": [
+ {
+ "name": "path",
+ "$ref": "manifest.ExtensionURL",
+ "description": "Relative path of an extension page to display within the sidebar."
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onShown",
+ "type": "function",
+ "description": "Fired when the sidebar pane becomes visible as a result of user switching to the panel that hosts it.",
+ "parameters": [
+ {
+ "name": "window",
+ "type": "object",
+ "isInstanceOf": "global",
+ "additionalProperties": { "type": "any" },
+ "description": "The JavaScript window
object of the sidebar page, if one was set with the setPage()
method."
+ }
+ ]
+ },
+ {
+ "name": "onHidden",
+ "type": "function",
+ "description": "Fired when the sidebar pane becomes hidden as a result of the user switching away from the panel that hosts the sidebar pane."
+ }
+ ]
+ },
+ {
+ "id": "Button",
+ "type": "object",
+ "description": "A button created by the extension.",
+ "functions": [
+ {
+ "name": "update",
+ "unsupported": true,
+ "type": "function",
+ "description": "Updates the attributes of the button. If some of the arguments are omitted or null
, the corresponding attributes are not updated.",
+ "parameters": [
+ {
+ "name": "iconPath",
+ "type": "string",
+ "optional": true,
+ "description": "Path to the new icon of the button."
+ },
+ {
+ "name": "tooltipText",
+ "type": "string",
+ "optional": true,
+ "description": "Text shown as a tooltip when user hovers the mouse over the button."
+ },
+ {
+ "name": "disabled",
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the button is disabled."
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onClicked",
+ "unsupported": true,
+ "type": "function",
+ "description": "Fired when the button is clicked."
+ }
+ ]
+ }
+ ],
+ "properties": {
+ "elements": {
+ "$ref": "ElementsPanel",
+ "description": "Elements panel."
+ },
+ "sources": {
+ "$ref": "SourcesPanel",
+ "description": "Sources panel."
+ },
+ "themeName": {
+ "type": "string",
+ "description": "The name of the current devtools theme."
+ }
+ },
+ "functions": [
+ {
+ "name": "create",
+ "type": "function",
+ "description": "Creates an extension panel.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "title",
+ "type": "string",
+ "description": "Title that is displayed next to the extension icon in the Developer Tools toolbar."
+ },
+ {
+ "name": "iconPath",
+ "description": "Path of the panel's icon relative to the extension directory, or an empty string to use the default extension icon as the panel icon.",
+ "choices": [
+ {"type": "string", "enum": [""]},
+ {"$ref": "manifest.ExtensionURL"}
+ ]
+ },
+ {
+ "name": "pagePath",
+ "$ref": "manifest.ExtensionURL",
+ "description": "Path of the panel's HTML page relative to the extension directory."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "optional": true,
+ "description": "A function that is called when the panel is created.",
+ "parameters": [
+ {
+ "name": "panel",
+ "description": "An ExtensionPanel object representing the created panel.",
+ "$ref": "ExtensionPanel"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setOpenResourceHandler",
+ "unsupported": true,
+ "type": "function",
+ "description": "Specifies the function to be called when the user clicks a resource link in the Developer Tools window. To unset the handler, either call the method with no parameters or pass null as the parameter.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "optional": true,
+ "description": "A function that is called when the user clicks on a valid resource link in Developer Tools window. Note that if the user clicks an invalid URL or an XHR, this function is not called.",
+ "parameters": [
+ {
+ "name": "resource",
+ "$ref": "devtools.inspectedWindow.Resource",
+ "description": "A $(ref:devtools.inspectedWindow.Resource) object for the resource that was clicked."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "openResource",
+ "unsupported": true,
+ "type": "function",
+ "description": "Requests DevTools to open a URL in a Developer Tools panel.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "url",
+ "type": "string",
+ "description": "The URL of the resource to open."
+ },
+ {
+ "name": "lineNumber",
+ "type": "integer",
+ "description": "Specifies the line number to scroll to when the resource is loaded."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "optional": true,
+ "description": "A function that is called when the resource has been successfully loaded."
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onThemeChanged",
+ "type": "function",
+ "description": "Fired when the devtools theme changes.",
+ "parameters": [
+ {
+ "name": "themeName",
+ "type": "string",
+ "description": "The name of the current devtools theme."
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/dns.json b/interfaces/firefox/schemas/dns.json
new file mode 100644
index 00000000..a2d17edb
--- /dev/null
+++ b/interfaces/firefox/schemas/dns.json
@@ -0,0 +1,82 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "PermissionNoPrompt",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "dns"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "dns",
+ "description": "Asynchronous DNS API",
+ "permissions": ["dns"],
+ "types": [
+ {
+ "id": "DNSRecord",
+ "type": "object",
+ "description": "An object encapsulating a DNS Record.",
+ "properties": {
+ "canonicalName": {
+ "type": "string",
+ "optional": true,
+ "description": "The canonical hostname for this record. this value is empty if the record was not fetched with the 'canonical_name' flag."
+ },
+ "isTRR": {
+ "type": "string",
+ "description": "Record retreived with TRR."
+ },
+ "addresses": {
+ "type": "array",
+ "items": { "type": "string" }
+ }
+ }
+ },
+ {
+ "id": "ResolveFlags",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "allow_name_collisions",
+ "bypass_cache",
+ "canonical_name",
+ "disable_ipv4",
+ "disable_ipv6",
+ "disable_trr",
+ "offline",
+ "priority_low",
+ "priority_medium",
+ "speculate"
+ ]
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "resolve",
+ "type": "function",
+ "description": "Resolves a hostname to a DNS record.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "hostname",
+ "type": "string"
+ },
+ {
+ "name": "flags",
+ "optional": true,
+ "default": [],
+ "$ref": "ResolveFlags"
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/downloads.json b/interfaces/firefox/schemas/downloads.json
new file mode 100644
index 00000000..15d314d8
--- /dev/null
+++ b/interfaces/firefox/schemas/downloads.json
@@ -0,0 +1,822 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "downloads",
+ "downloads.open"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "downloads",
+ "permissions": ["downloads"],
+ "types": [
+ {
+ "id": "FilenameConflictAction",
+ "type": "string",
+ "enum": [
+ "uniquify",
+ "overwrite",
+ "prompt"
+ ]
+ },
+ {
+ "id": "InterruptReason",
+ "type": "string",
+ "enum": [
+ "FILE_FAILED",
+ "FILE_ACCESS_DENIED",
+ "FILE_NO_SPACE",
+ "FILE_NAME_TOO_LONG",
+ "FILE_TOO_LARGE",
+ "FILE_VIRUS_INFECTED",
+ "FILE_TRANSIENT_ERROR",
+ "FILE_BLOCKED",
+ "FILE_SECURITY_CHECK_FAILED",
+ "FILE_TOO_SHORT",
+ "NETWORK_FAILED",
+ "NETWORK_TIMEOUT",
+ "NETWORK_DISCONNECTED",
+ "NETWORK_SERVER_DOWN",
+ "NETWORK_INVALID_REQUEST",
+ "SERVER_FAILED",
+ "SERVER_NO_RANGE",
+ "SERVER_BAD_CONTENT",
+ "SERVER_UNAUTHORIZED",
+ "SERVER_CERT_PROBLEM",
+ "SERVER_FORBIDDEN",
+ "USER_CANCELED",
+ "USER_SHUTDOWN",
+ "CRASH"
+ ]
+ },
+ {
+ "id": "DangerType",
+ "type": "string",
+ "enum": [
+ "file",
+ "url",
+ "content",
+ "uncommon",
+ "host",
+ "unwanted",
+ "safe",
+ "accepted"
+ ],
+ "description": "
filename
or url
contain all of the search terms that do not begin with a dash '-' and none of the search terms that do begin with a dash.",
+ "optional": true,
+ "type": "array",
+ "items": { "type": "string" }
+ },
+ "startedBefore": {
+ "description": "Limits results to downloads that started before the given ms since the epoch.",
+ "optional": true,
+ "$ref": "DownloadTime"
+ },
+ "startedAfter": {
+ "description": "Limits results to downloads that started after the given ms since the epoch.",
+ "optional": true,
+ "$ref": "DownloadTime"
+ },
+ "endedBefore": {
+ "description": "Limits results to downloads that ended before the given ms since the epoch.",
+ "optional": true,
+ "$ref": "DownloadTime"
+ },
+ "endedAfter": {
+ "description": "Limits results to downloads that ended after the given ms since the epoch.",
+ "optional": true,
+ "$ref": "DownloadTime"
+ },
+ "totalBytesGreater": {
+ "description": "Limits results to downloads whose totalBytes is greater than the given integer.",
+ "optional": true,
+ "type": "number"
+ },
+ "totalBytesLess": {
+ "description": "Limits results to downloads whose totalBytes is less than the given integer.",
+ "optional": true,
+ "type": "number"
+ },
+ "filenameRegex": {
+ "description": "Limits results to DownloadItems whose filename
matches the given regular expression.",
+ "optional": true,
+ "type": "string"
+ },
+ "urlRegex": {
+ "description": "Limits results to DownloadItems whose url
matches the given regular expression.",
+ "optional": true,
+ "type": "string"
+ },
+ "limit": {
+ "description": "Setting this integer limits the number of results. Otherwise, all matching DownloadItems will be returned.",
+ "optional": true,
+ "type": "integer"
+ },
+ "orderBy": {
+ "description": "Setting elements of this array to DownloadItem properties in order to sort the search results. For example, setting orderBy='startTime'
sorts the DownloadItems by their start time in ascending order. To specify descending order, prefix orderBy
with a hyphen: '-startTime'.",
+ "optional": true,
+ "type": "array",
+ "items": { "type": "string" }
+ },
+ "id": {
+ "type": "integer",
+ "optional": true
+ },
+ "url": {
+ "description": "Absolute URL.",
+ "optional": true,
+ "type": "string"
+ },
+ "filename": {
+ "description": "Absolute local path.",
+ "optional": true,
+ "type": "string"
+ },
+ "cookieStoreId": {
+ "type": "string",
+ "optional": true,
+ "description": "The cookie store ID of the contextual identity."
+ },
+ "danger": {
+ "$ref": "DangerType",
+ "description": "Indication of whether this download is thought to be safe or known to be suspicious.",
+ "optional": true
+ },
+ "mime": {
+ "description": "The file's MIME type.",
+ "optional": true,
+ "type": "string"
+ },
+ "startTime": {
+ "optional": true,
+ "type": "string"
+ },
+ "endTime": {
+ "optional": true,
+ "type": "string"
+ },
+ "state": {
+ "$ref": "State",
+ "description": "Indicates whether the download is progressing, interrupted, or complete.",
+ "optional": true
+ },
+ "paused": {
+ "description": "True if the download has stopped reading data from the host, but kept the connection open.",
+ "optional": true,
+ "type": "boolean"
+ },
+ "error": {
+ "description": "Why a download was interrupted.",
+ "optional": true,
+ "$ref": "InterruptReason"
+ },
+ "bytesReceived": {
+ "description": "Number of bytes received so far from the host, without considering file compression.",
+ "optional": true,
+ "type": "number"
+ },
+ "totalBytes": {
+ "description": "Number of bytes in the whole file, without considering file compression, or -1 if unknown.",
+ "optional": true,
+ "type": "number"
+ },
+ "fileSize": {
+ "description": "Number of bytes in the whole file post-decompression, or -1 if unknown.",
+ "optional": true,
+ "type": "number"
+ },
+ "exists": {
+ "type": "boolean",
+ "optional": true
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "download",
+ "type": "function",
+ "async": "callback",
+ "description": "Download a URL. If the URL uses the HTTP[S] protocol, then the request will include all cookies currently set for its hostname. If both filename
and saveAs
are specified, then the Save As dialog will be displayed, pre-populated with the specified filename
. If the download started successfully, callback
will be called with the new DownloadItem's downloadId
. If there was an error starting the download, then callback
will be called with downloadId=undefined
and chrome.extension.lastError will contain a descriptive string. The error strings are not guaranteed to remain backwards compatible between releases. You must not parse it.",
+ "parameters": [
+ {
+ "description": "What to download and how.",
+ "name": "options",
+ "type": "object",
+ "properties": {
+ "url": {
+ "description": "The URL to download.",
+ "type": "string",
+ "format": "url"
+ },
+ "filename": {
+ "description": "A file path relative to the Downloads directory to contain the downloaded file.",
+ "optional": true,
+ "type": "string"
+ },
+ "incognito": {
+ "description": "Whether to associate the download with a private browsing session.",
+ "optional": true,
+ "default": false,
+ "type": "boolean"
+ },
+ "cookieStoreId": {
+ "type": "string",
+ "optional": true,
+ "description": "The cookie store ID of the contextual identity; requires \"cookies\" permission."
+ },
+ "conflictAction": {
+ "$ref": "FilenameConflictAction",
+ "optional": true
+ },
+ "saveAs": {
+ "description": "Use a file-chooser to allow the user to select a filename. If the option is not specified, the file chooser will be shown only if the Firefox \"Always ask you where to save files\" option is enabled (i.e. the pref browser.download.useDownloadDir
is set to false
).",
+ "optional": true,
+ "type": "boolean"
+ },
+ "method": {
+ "description": "The HTTP method to use if the URL uses the HTTP[S] protocol.",
+ "enum": [
+ "GET",
+ "POST"
+ ],
+ "optional": true,
+ "type": "string"
+ },
+ "headers": {
+ "optional": true,
+ "type": "array",
+ "description": "Extra HTTP headers to send with the request if the URL uses the HTTP[s] protocol. Each header is represented as a dictionary containing the keys name
and either value
or binaryValue
, restricted to those allowed by XMLHttpRequest.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Name of the HTTP header.",
+ "type": "string"
+ },
+ "value": {
+ "description": "Value of the HTTP header.",
+ "type": "string"
+ }
+ }
+ }
+ },
+ "body": {
+ "description": "Post body.",
+ "optional": true,
+ "type": "string"
+ },
+ "allowHttpErrors": {
+ "description": "When this flag is set to true
, then the browser will allow downloads to proceed after encountering HTTP errors such as 404 Not Found
.",
+ "optional": true,
+ "default": false,
+ "type": "boolean"
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "downloadId",
+ "type": "integer"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "search",
+ "type": "function",
+ "async": "callback",
+ "description": "Find DownloadItems. Set query
to the empty object to get all DownloadItems. To get a specific DownloadItem, set only the id
field.",
+ "parameters": [
+ {
+ "name": "query",
+ "$ref": "DownloadQuery"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "items": {
+ "$ref": "DownloadItem"
+ },
+ "name": "results",
+ "type": "array"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "pause",
+ "type": "function",
+ "async": "callback",
+ "description": "Pause the download. If the request was successful the download is in a paused state. Otherwise chrome.extension.lastError contains an error message. The request will fail if the download is not active.",
+ "parameters": [
+ {
+ "description": "The id of the download to pause.",
+ "name": "downloadId",
+ "type": "integer"
+ },
+ {
+ "name": "callback",
+ "optional": true,
+ "parameters": [],
+ "type": "function"
+ }
+ ]
+ },
+ {
+ "name": "resume",
+ "type": "function",
+ "async": "callback",
+ "description": "Resume a paused download. If the request was successful the download is in progress and unpaused. Otherwise chrome.extension.lastError contains an error message. The request will fail if the download is not active.",
+ "parameters": [
+ {
+ "description": "The id of the download to resume.",
+ "name": "downloadId",
+ "type": "integer"
+ },
+ {
+ "name": "callback",
+ "optional": true,
+ "parameters": [],
+ "type": "function"
+ }
+ ]
+ },
+ {
+ "name": "cancel",
+ "type": "function",
+ "async": "callback",
+ "description": "Cancel a download. When callback
is run, the download is cancelled, completed, interrupted or doesn't exist anymore.",
+ "parameters": [
+ {
+ "description": "The id of the download to cancel.",
+ "name": "downloadId",
+ "type": "integer"
+ },
+ {
+ "name": "callback",
+ "optional": true,
+ "parameters": [],
+ "type": "function"
+ }
+ ]
+ },
+ {
+ "name": "getFileIcon",
+ "type": "function",
+ "async": "callback",
+ "description": "Retrieve an icon for the specified download. For new downloads, file icons are available after the onCreated event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, chrome.extension.lastError will contain an error message.",
+ "parameters": [
+ {
+ "description": "The identifier for the download.",
+ "name": "downloadId",
+ "type": "integer"
+ },
+ {
+ "name": "options",
+ "optional": true,
+ "properties": {
+ "size": {
+ "description": "The size of the icon. The returned icon will be square with dimensions size * size pixels. The default size for the icon is 32x32 pixels.",
+ "optional": true,
+ "minimum": 1,
+ "maximum": 127,
+ "type": "integer"
+ }
+ },
+ "type": "object"
+ },
+ {
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "iconURL",
+ "optional": true,
+ "type": "string"
+ }
+ ],
+ "type": "function"
+ }
+ ]
+ },
+ {
+ "name": "open",
+ "type": "function",
+ "async": "callback",
+ "requireUserInput": true,
+ "description": "Open the downloaded file.",
+ "permissions": ["downloads.open"],
+ "parameters": [
+ {
+ "name": "downloadId",
+ "type": "integer"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "show",
+ "type": "function",
+ "description": "Show the downloaded file in its folder in a file manager.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "downloadId",
+ "type": "integer"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "success",
+ "type": "boolean"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "showDefaultFolder",
+ "type": "function",
+ "parameters": []
+ },
+ {
+ "name": "erase",
+ "type": "function",
+ "async": "callback",
+ "description": "Erase matching DownloadItems from history",
+ "parameters": [
+ {
+ "name": "query",
+ "$ref": "DownloadQuery"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "optional": true,
+ "parameters": [
+ {
+ "items": {
+ "type": "integer"
+ },
+ "name": "erasedIds",
+ "type": "array"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "removeFile",
+ "async": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "downloadId",
+ "type": "integer"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "optional": true,
+ "parameters": [ ]
+ }
+ ]
+ },
+ {
+ "description": "Prompt the user to either accept or cancel a dangerous download. acceptDanger()
does not automatically accept dangerous downloads.",
+ "name": "acceptDanger",
+ "unsupported": true,
+ "parameters": [
+ {
+ "name": "downloadId",
+ "type": "integer"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "optional": true,
+ "parameters": [ ]
+ }
+ ],
+ "type": "function"
+ },
+ {
+ "description": "Initiate dragging the file to another application.",
+ "name": "drag",
+ "unsupported": true,
+ "parameters": [
+ {
+ "name": "downloadId",
+ "type": "integer"
+ }
+ ],
+ "type": "function"
+ },
+ {
+ "name": "setShelfEnabled",
+ "type": "function",
+ "unsupported": true,
+ "parameters": [
+ {
+ "name": "enabled",
+ "type": "boolean"
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "description": "This event fires with the DownloadItem object when a download begins.",
+ "name": "onCreated",
+ "parameters": [
+ {
+ "$ref": "DownloadItem",
+ "name": "downloadItem"
+ }
+ ],
+ "type": "function"
+ },
+ {
+ "description": "Fires with the downloadId
when a download is erased from history.",
+ "name": "onErased",
+ "parameters": [
+ {
+ "name": "downloadId",
+ "description": "The id
of the DownloadItem that was erased.",
+ "type": "integer"
+ }
+ ],
+ "type": "function"
+ },
+ {
+ "name": "onChanged",
+ "description": "When any of a DownloadItem's properties except bytesReceived
changes, this event fires with the downloadId
and an object containing the properties that changed.",
+ "parameters": [
+ {
+ "name": "downloadDelta",
+ "type": "object",
+ "properties": {
+ "id": {
+ "description": "The id
of the DownloadItem that changed.",
+ "type": "integer"
+ },
+ "url": {
+ "description": "Describes a change in a DownloadItem's url
.",
+ "optional": true,
+ "$ref": "StringDelta"
+ },
+ "filename": {
+ "description": "Describes a change in a DownloadItem's filename
.",
+ "optional": true,
+ "$ref": "StringDelta"
+ },
+ "danger": {
+ "description": "Describes a change in a DownloadItem's danger
.",
+ "optional": true,
+ "$ref": "StringDelta"
+ },
+ "mime": {
+ "description": "Describes a change in a DownloadItem's mime
.",
+ "optional": true,
+ "$ref": "StringDelta"
+ },
+ "startTime": {
+ "description": "Describes a change in a DownloadItem's startTime
.",
+ "optional": true,
+ "$ref": "StringDelta"
+ },
+ "endTime": {
+ "description": "Describes a change in a DownloadItem's endTime
.",
+ "optional": true,
+ "$ref": "StringDelta"
+ },
+ "state": {
+ "description": "Describes a change in a DownloadItem's state
.",
+ "optional": true,
+ "$ref": "StringDelta"
+ },
+ "canResume": {
+ "optional": true,
+ "$ref": "BooleanDelta"
+ },
+ "paused": {
+ "description": "Describes a change in a DownloadItem's paused
.",
+ "optional": true,
+ "$ref": "BooleanDelta"
+ },
+ "error": {
+ "description": "Describes a change in a DownloadItem's error
.",
+ "optional": true,
+ "$ref": "StringDelta"
+ },
+ "totalBytes": {
+ "description": "Describes a change in a DownloadItem's totalBytes
.",
+ "optional": true,
+ "$ref": "DoubleDelta"
+ },
+ "fileSize": {
+ "description": "Describes a change in a DownloadItem's fileSize
.",
+ "optional": true,
+ "$ref": "DoubleDelta"
+ },
+ "exists": {
+ "optional": true,
+ "$ref": "BooleanDelta"
+ }
+ }
+ }
+ ],
+ "type": "function"
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/events.json b/interfaces/firefox/schemas/events.json
new file mode 100644
index 00000000..fccc3470
--- /dev/null
+++ b/interfaces/firefox/schemas/events.json
@@ -0,0 +1,318 @@
+[
+ {
+ "namespace": "events",
+ "description": "The chrome.events
namespace contains common types used by APIs dispatching events to notify you when something interesting happens.",
+ "types": [
+ {
+ "id": "Rule",
+ "type": "object",
+ "description": "Description of a declarative rule for handling events.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "optional": true,
+ "description": "Optional identifier that allows referencing this rule."
+ },
+ "tags": {
+ "type": "array",
+ "items": {"type": "string"},
+ "optional": true,
+ "description": "Tags can be used to annotate rules and perform operations on sets of rules."
+ },
+ "conditions": {
+ "type": "array",
+ "items": {"type": "any"},
+ "description": "List of conditions that can trigger the actions."
+ },
+ "actions": {
+ "type": "array",
+ "items": {"type": "any"},
+ "description": "List of actions that are triggered if one of the condtions is fulfilled."
+ },
+ "priority": {
+ "type": "integer",
+ "optional": true,
+ "description": "Optional priority of this rule. Defaults to 100."
+ }
+ }
+ },
+ {
+ "id": "Event",
+ "type": "object",
+ "description": "An object which allows the addition and removal of listeners for a Chrome event.",
+ "functions": [
+ {
+ "name": "addListener",
+ "type": "function",
+ "description": "Registers an event listener callback to an event.",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when an event occurs. The parameters of this function depend on the type of event."
+ }
+ ]
+ },
+ {
+ "name": "removeListener",
+ "type": "function",
+ "description": "Deregisters an event listener callback from an event.",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Listener that shall be unregistered."
+ }
+ ]
+ },
+ {
+ "name": "hasListener",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Listener whose registration status shall be tested."
+ }
+ ],
+ "returns": {
+ "type": "boolean",
+ "description": "True if callback is registered to the event."
+ }
+ },
+ {
+ "name": "hasListeners",
+ "type": "function",
+ "parameters": [],
+ "returns": {
+ "type": "boolean",
+ "description": "True if any event listeners are registered to the event."
+ }
+ },
+ {
+ "name": "addRules",
+ "unsupported": true,
+ "type": "function",
+ "description": "Registers rules to handle events.",
+ "parameters": [
+ {
+ "name": "eventName",
+ "type": "string",
+ "description": "Name of the event this function affects."
+ },
+ {
+ "name": "webViewInstanceId",
+ "type": "integer",
+ "description": "If provided, this is an integer that uniquely identfies the [80, 443, [1000, 1200]]
matches all requests on port 80, 443 and in the range 1000-1200.",
+ "optional": true,
+ "items": {
+ "choices": [
+ {"type": "integer", "description": "A specific port."},
+ {"type": "array", "minItems": 2, "maxItems": 2, "items": {"type": "integer"}, "description": "A pair of integers identiying the start and end (both inclusive) of a port range."}
+ ]
+ }
+ }
+ }
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/extension.json b/interfaces/firefox/schemas/extension.json
new file mode 100644
index 00000000..d6385e3f
--- /dev/null
+++ b/interfaces/firefox/schemas/extension.json
@@ -0,0 +1,181 @@
+[
+ {
+ "namespace": "extension",
+ "allowedContexts": ["content", "devtools"],
+ "description": "The browser.extension
API has utilities that can be used by any extension page. It includes support for exchanging messages between an extension and its content scripts or between extensions, as described in detail in $(topic:messaging)[Message Passing].",
+ "properties": {
+ "lastError": {
+ "type": "object",
+ "optional": true,
+ "max_manifest_version": 2,
+ "deprecated": "Please use $(ref:runtime.lastError).",
+ "allowedContexts": ["content", "devtools"],
+ "description": "Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be undefined.",
+ "properties": {
+ "message": { "type": "string", "description": "Description of the error that has taken place." }
+ },
+ "additionalProperties": {
+ "type": "any"
+ }
+ },
+ "inIncognitoContext": {
+ "type": "boolean",
+ "optional": true,
+ "allowedContexts": ["content", "devtools"],
+ "description": "True for content scripts running inside incognito tabs, and for extension pages running inside an incognito process. The latter only applies to extensions with 'split' incognito_behavior."
+ }
+ },
+ "types": [
+ {
+ "id": "ViewType",
+ "type": "string",
+ "enum": ["tab", "popup", "sidebar"],
+ "description": "The type of extension view."
+ }
+ ],
+ "functions": [
+ {
+ "name": "getURL",
+ "type": "function",
+ "deprecated": "Please use $(ref:runtime.getURL).",
+ "max_manifest_version": 2,
+ "allowedContexts": ["content", "devtools"],
+ "description": "Converts a relative path within an extension install directory to a fully-qualified URL.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "path",
+ "description": "A path to a resource within an extension expressed relative to its install directory."
+ }
+ ],
+ "returns": {
+ "type": "string",
+ "description": "The fully-qualified URL to the resource."
+ }
+ },
+ {
+ "name": "getViews",
+ "type": "function",
+ "description": "Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "fetchProperties",
+ "optional": true,
+ "properties": {
+ "type": {
+ "$ref": "ViewType",
+ "optional": true,
+ "description": "The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'popup', 'sidebar'."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "description": "The window to restrict the search to. If omitted, returns all views."
+ },
+ "tabId": {
+ "type": "integer",
+ "optional":true,
+ "description": "Find a view according to a tab id. If this field is omitted, returns all views."
+ }
+ }
+ }
+ ],
+ "returns": {
+ "type": "array",
+ "description": "Array of global objects",
+ "items": {
+ "type": "object",
+ "isInstanceOf": "Window",
+ "additionalProperties": { "type": "any" }
+ }
+ }
+ },
+ {
+ "name": "getBackgroundPage",
+ "type": "function",
+ "description": "Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page.",
+ "parameters": [],
+ "returns": {
+ "type": "object",
+ "optional": true,
+ "isInstanceOf": "Window",
+ "additionalProperties": { "type": "any" }
+ }
+ },
+ {
+ "name": "isAllowedIncognitoAccess",
+ "type": "function",
+ "description": "Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "isAllowedAccess",
+ "type": "boolean",
+ "description": "True if the extension has access to Incognito mode, false otherwise."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "isAllowedFileSchemeAccess",
+ "type": "function",
+ "description": "Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "isAllowedAccess",
+ "type": "boolean",
+ "description": "True if the extension can access the 'file://' scheme, false otherwise."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setUpdateUrlData",
+ "unsupported": true,
+ "type": "function",
+ "description": "Sets the value of the ap CGI parameter used in the extension's update URL. This value is ignored for extensions that are hosted in the browser vendor's store.",
+ "parameters": [
+ {"type": "string", "name": "data", "maxLength": 1024}
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onRequest",
+ "unsupported": true,
+ "deprecated": "Please use $(ref:runtime.onMessage).",
+ "type": "function",
+ "description": "Fired when a request is sent from either an extension process or a content script.",
+ "parameters": [
+ {"name": "request", "type": "any", "optional": true, "description": "The request sent by the calling script."},
+ {"name": "sender", "$ref": "runtime.MessageSender" },
+ {"name": "sendResponse", "type": "function", "description": "Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response. If you have more than one onRequest
listener in the same document, then only one may send a response." }
+ ]
+ },
+ {
+ "name": "onRequestExternal",
+ "unsupported": true,
+ "deprecated": "Please use $(ref:runtime.onMessageExternal).",
+ "type": "function",
+ "description": "Fired when a request is sent from another extension.",
+ "parameters": [
+ {"name": "request", "type": "any", "optional": true, "description": "The request sent by the calling script."},
+ {"name": "sender", "$ref": "runtime.MessageSender" },
+ {"name": "sendResponse", "type": "function", "description": "Function to call when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response." }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/extension_protocol_handlers.json b/interfaces/firefox/schemas/extension_protocol_handlers.json
new file mode 100644
index 00000000..ec972bc3
--- /dev/null
+++ b/interfaces/firefox/schemas/extension_protocol_handlers.json
@@ -0,0 +1,51 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "id": "ProtocolHandler",
+ "type": "object",
+ "description": "Represents a protocol handler definition.",
+ "properties": {
+ "name": {
+ "description": "A user-readable title string for the protocol handler. This will be displayed to the user in interface objects as needed.",
+ "type": "string"
+ },
+ "protocol": {
+ "description": "The protocol the site wishes to handle, specified as a string. For example, you can register to handle SMS text message links by registering to handle the \"sms\" scheme.",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "bitcoin", "dat", "dweb", "ftp", "geo", "gopher", "im", "ipfs", "ipns", "irc", "ircs", "magnet",
+ "mailto", "matrix", "mms", "news", "nntp", "sip", "sms", "smsto", "ssb", "ssh",
+ "tel", "urn", "webcal", "wtai", "xmpp"
+ ]
+ }, {
+ "type": "string",
+ "pattern": "^(ext|web)\\+[a-z0-9.+-]+$"
+ }]
+ },
+ "uriTemplate": {
+ "description": "The URL of the handler, as a string. This string should include \"%s\" as a placeholder which will be replaced with the escaped URL of the document to be handled. This URL might be a true URL, or it could be a phone number, email address, or so forth.",
+ "preprocess": "localize",
+ "choices": [
+ {"$ref": "ExtensionURL"},
+ {"$ref": "HttpURL"}
+ ]
+ }
+ }
+ },
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "protocol_handlers": {
+ "description": "A list of protocol handler definitions.",
+ "optional": true,
+ "type": "array",
+ "items": {"$ref": "ProtocolHandler"}
+ }
+ }
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/extension_types.json b/interfaces/firefox/schemas/extension_types.json
new file mode 100644
index 00000000..e8ac7f27
--- /dev/null
+++ b/interfaces/firefox/schemas/extension_types.json
@@ -0,0 +1,145 @@
+[
+ {
+ "namespace": "extensionTypes",
+ "description": "The browser.extensionTypes
API contains type declarations for WebExtensions.",
+ "types": [
+ {
+ "id": "ImageFormat",
+ "type": "string",
+ "enum": ["jpeg", "png"],
+ "description": "The format of an image."
+ },
+ {
+ "id": "ImageDetails",
+ "type": "object",
+ "description": "Details about the format, quality, area and scale of the capture.",
+ "properties": {
+ "format": {
+ "$ref": "ImageFormat",
+ "optional": true,
+ "description": "The format of the resulting image. Default is \"jpeg\"
."
+ },
+ "quality": {
+ "type": "integer",
+ "optional": true,
+ "minimum": 0,
+ "maximum": 100,
+ "description": "When format is \"jpeg\"
, controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease."
+ },
+ "rect": {
+ "type": "object",
+ "optional": true,
+ "description": "The area of the document to capture, in CSS pixels, relative to the page. If omitted, capture the visible viewport.",
+ "properties": {
+ "x": {"type": "number"},
+ "y": {"type": "number"},
+ "width": {"type": "number"},
+ "height": {"type": "number"}
+ }
+ },
+ "scale": {
+ "type": "number",
+ "optional": true,
+ "description": "The scale of the resulting image. Defaults to devicePixelRatio
."
+ },
+ "resetScrollPosition": {
+ "type": "boolean",
+ "optional": true,
+ "description": "If true, temporarily resets the scroll position of the document to 0. Only takes effect if rect is also specified."
+ }
+ }
+ },
+ {
+ "id": "RunAt",
+ "type": "string",
+ "enum": ["document_start", "document_end", "document_idle"],
+ "description": "The soonest that the JavaScript or CSS will be injected into the tab."
+ },
+ {
+ "id": "CSSOrigin",
+ "type": "string",
+ "enum": ["user", "author"],
+ "description": "The origin of the CSS to inject, this affects the cascading order (priority) of the stylesheet."
+ },
+ {
+ "id": "InjectDetails",
+ "type": "object",
+ "description": "Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.",
+ "properties": {
+ "code": {"type": "string", "optional": true, "description": "JavaScript or CSS code to inject.code
parameter. Incorrect use of it may open your extension to cross site scripting attacks."},
+ "file": {"type": "string", "optional": true, "description": "JavaScript or CSS file to inject."},
+ "allFrames": {"type": "boolean", "optional": true, "description": "If allFrames is true
, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's false
and is only injected into the top frame."},
+ "matchAboutBlank": {"type": "boolean", "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 false
."},
+ "frameId": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the frame to inject the script into. This may not be used in combination with allFrames
."
+ },
+ "runAt": {
+ "$ref": "RunAt",
+ "optional": true,
+ "default": "document_idle",
+ "description": "The soonest that the JavaScript or CSS will be injected into the tab. Defaults to \"document_idle\"."
+ },
+ "cssOrigin": {
+ "$ref": "CSSOrigin",
+ "optional": true,
+ "description": "The css origin of the stylesheet to inject. Defaults to \"author\"."
+ }
+ }
+ },
+ {
+ "id": "Date",
+ "choices": [
+ {
+ "type": "string",
+ "format": "date"
+ },
+ {
+ "type": "integer",
+ "minimum": 0
+ },
+ {
+ "type": "object",
+ "isInstanceOf": "Date",
+ "additionalProperties": { "type": "any" }
+ }
+ ]
+ },
+ {
+ "id": "ExtensionFileOrCode",
+ "choices": [
+ {
+ "type": "object",
+ "properties": {
+ "file": {
+ "$ref": "manifest.ExtensionURL"
+ }
+ }
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ },
+ {
+ "id": "PlainJSONValue",
+ "description": "A plain JSON value",
+ "choices": [
+ { "type": "null" },
+ { "type": "number" },
+ { "type": "string" },
+ { "type": "boolean" },
+ { "type": "array", "items": {"$ref": "PlainJSONValue"} },
+ { "type": "object", "additionalProperties": { "$ref": "PlainJSONValue" } }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/find.json b/interfaces/firefox/schemas/find.json
new file mode 100644
index 00000000..676947a5
--- /dev/null
+++ b/interfaces/firefox/schemas/find.json
@@ -0,0 +1,122 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "find"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "find",
+ "description": "Use the browser.find
API to interact with the browser's Find
interface.",
+ "permissions": ["find"],
+ "functions": [
+ {
+ "name": "find",
+ "type": "function",
+ "async": true,
+ "description": "Search for text in document and store found ranges in array, in document order.",
+ "parameters": [
+ {
+ "name": "queryphrase",
+ "type": "string",
+ "description": "The string to search for."
+ },
+ {
+ "name": "params",
+ "type": "object",
+ "description": "Search parameters.",
+ "optional": true,
+ "properties": {
+ "tabId": {
+ "type": "integer",
+ "description": "Tab to query. Defaults to the active tab.",
+ "optional": true,
+ "minimum": 0
+ },
+ "caseSensitive": {
+ "type": "boolean",
+ "description": "Find only ranges with case sensitive match.",
+ "optional": true
+ },
+ "matchDiacritics": {
+ "type": "boolean",
+ "description": "Find only ranges with diacritic sensitive match.",
+ "optional": true
+ },
+ "entireWord": {
+ "type": "boolean",
+ "description": "Find only ranges that match entire word.",
+ "optional": true
+ },
+ "includeRectData": {
+ "description": "Return rectangle data which describes visual position of search results.",
+ "type": "boolean",
+ "optional": true
+ },
+ "includeRangeData": {
+ "description": "Return range data which provides range data in a serializable form.",
+ "type": "boolean",
+ "optional": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "highlightResults",
+ "type": "function",
+ "async": true,
+ "description": "Highlight a range",
+ "parameters": [
+ {
+ "name": "params",
+ "type": "object",
+ "description": "highlightResults parameters",
+ "optional": true,
+ "properties": {
+ "rangeIndex": {
+ "type": "integer",
+ "description": "Found range to be highlighted. Default highlights all ranges.",
+ "minimum": 0,
+ "optional": true
+ },
+ "tabId": {
+ "type": "integer",
+ "description": "Tab to highlight. Defaults to the active tab.",
+ "minimum": 0,
+ "optional": true
+ },
+ "noScroll": {
+ "type": "boolean",
+ "description": "Don't scroll to highlighted item.",
+ "optional": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "removeHighlighting",
+ "type": "function",
+ "async": true,
+ "description": "Remove all highlighting from previous searches.",
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer",
+ "description": "Tab to highlight. Defaults to the active tab.",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/history.json b/interfaces/firefox/schemas/history.json
new file mode 100644
index 00000000..b823d7f7
--- /dev/null
+++ b/interfaces/firefox/schemas/history.json
@@ -0,0 +1,333 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "history"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "history",
+ "description": "Use the browser.history
API to interact with the browser's record of visited pages. You can add, remove, and query for URLs in the browser's history. To override the history page with your own version, see $(topic:override)[Override Pages].",
+ "permissions": ["history"],
+ "types": [
+ {
+ "id": "TransitionType",
+ "type": "string",
+ "enum": ["link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "auto_toplevel", "form_submit", "reload", "keyword", "keyword_generated"],
+ "description": "The $(topic:transition-types)[transition type] for this visit from its referrer."
+ },
+ {
+ "id": "HistoryItem",
+ "type": "object",
+ "description": "An object encapsulating one result of a history query.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier for the item."
+ },
+ "url": {
+ "type": "string",
+ "optional": true,
+ "description": "The URL navigated to by a user."
+ },
+ "title": {
+ "type": "string",
+ "optional": true,
+ "description": "The title of the page when it was last loaded."
+ },
+ "lastVisitTime": {
+ "type": "number",
+ "optional": true,
+ "description": "When this page was last loaded, represented in milliseconds since the epoch."
+ },
+ "visitCount": {
+ "type": "integer",
+ "optional": true,
+ "description": "The number of times the user has navigated to this page."
+ },
+ "typedCount": {
+ "type": "integer",
+ "optional": true,
+ "description": "The number of times the user has navigated to this page by typing in the address."
+ }
+ }
+ },
+ {
+ "id": "VisitItem",
+ "type": "object",
+ "description": "An object encapsulating one visit to a URL.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier for the item."
+ },
+ "visitId": {
+ "type": "string",
+ "description": "The unique identifier for this visit."
+ },
+ "visitTime": {
+ "type": "number",
+ "optional": true,
+ "description": "When this visit occurred, represented in milliseconds since the epoch."
+ },
+ "referringVisitId": {
+ "type": "string",
+ "description": "The visit ID of the referrer."
+ },
+ "transition": {
+ "$ref": "TransitionType",
+ "description": "The $(topic:transition-types)[transition type] for this visit from its referrer."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "search",
+ "type": "function",
+ "description": "Searches the history for the last visit time of each page matching the query.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "query",
+ "type": "object",
+ "properties": {
+ "text": {
+ "type": "string",
+ "description": "A free-text query to the history service. Leave empty to retrieve all pages."
+ },
+ "startTime": {
+ "$ref": "extensionTypes.Date",
+ "optional": true,
+ "description": "Limit results to those visited after this date. If not specified, this defaults to 24 hours in the past."
+ },
+ "endTime": {
+ "$ref": "extensionTypes.Date",
+ "optional": true,
+ "description": "Limit results to those visited before this date."
+ },
+ "maxResults": {
+ "type": "integer",
+ "optional": true,
+ "minimum": 1,
+ "description": "The maximum number of results to retrieve. Defaults to 100."
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "results",
+ "type": "array",
+ "items": {
+ "$ref": "HistoryItem"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getVisits",
+ "type": "function",
+ "description": "Retrieves information about visits to a URL.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "The URL for which to retrieve visit information. It must be in the format as returned from a call to history.search."
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "results",
+ "type": "array",
+ "items": {
+ "$ref": "VisitItem"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "addUrl",
+ "type": "function",
+ "description": "Adds a URL to the history with a default visitTime of the current time and a default $(topic:transition-types)[transition type] of \"link\".",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "The URL to add. Must be a valid URL that can be added to history."
+ },
+ "title": {
+ "type": "string",
+ "optional": true,
+ "description": "The title of the page."
+ },
+ "transition": {
+ "$ref": "TransitionType",
+ "optional": true,
+ "description": "The $(topic:transition-types)[transition type] for this visit from its referrer."
+ },
+ "visitTime": {
+ "$ref": "extensionTypes.Date",
+ "optional": true,
+ "description": "The date when this visit occurred."
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "deleteUrl",
+ "type": "function",
+ "description": "Removes all occurrences of the given URL from the history.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "The URL to remove."
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "deleteRange",
+ "type": "function",
+ "description": "Removes all items within the specified date range from the history. Pages will not be removed from the history unless all visits fall within the range.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "range",
+ "type": "object",
+ "properties": {
+ "startTime": {
+ "$ref": "extensionTypes.Date",
+ "description": "Items added to history after this date."
+ },
+ "endTime": {
+ "$ref": "extensionTypes.Date",
+ "description": "Items added to history before this date."
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "deleteAll",
+ "type": "function",
+ "description": "Deletes all items from the history.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": []
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onVisited",
+ "type": "function",
+ "description": "Fired when a URL is visited, providing the HistoryItem data for that URL. This event fires before the page has loaded.",
+ "parameters": [
+ {
+ "name": "result",
+ "$ref": "HistoryItem"
+ }
+ ]
+ },
+ {
+ "name": "onVisitRemoved",
+ "type": "function",
+ "description": "Fired when one or more URLs are removed from the history service. When all visits have been removed the URL is purged from history.",
+ "parameters": [
+ {
+ "name": "removed",
+ "type": "object",
+ "properties": {
+ "allHistory": {
+ "type": "boolean",
+ "description": "True if all history was removed. If true, then urls will be empty."
+ },
+ "urls": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "onTitleChanged",
+ "type": "function",
+ "description": "Fired when the title of a URL is changed in the browser history.",
+ "parameters": [
+ {
+ "name": "changed",
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "The URL for which the title has changed"
+ },
+ "title": {
+ "type": "string",
+ "description": "The new title for the URL."
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/i18n.json b/interfaces/firefox/schemas/i18n.json
new file mode 100644
index 00000000..5d01f6cd
--- /dev/null
+++ b/interfaces/firefox/schemas/i18n.json
@@ -0,0 +1,136 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "default_locale": {
+ "type": "string",
+ "optional": "true"
+ },
+ "l10n_resources": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "optional": true,
+ "privileged": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "namespace": "i18n",
+ "allowedContexts": ["content", "devtools"],
+ "defaultContexts": ["content", "devtools"],
+ "description": "Use the browser.i18n
infrastructure to implement internationalization across your whole app or extension.",
+ "types": [
+ {
+ "id": "LanguageCode",
+ "type": "string",
+ "description": "An ISO language code such as en
or fr
. For a complete list of languages supported by this method, see kLanguageInfoTable. For an unknown language, und
will be returned, which means that [percentage] of the text is unknown to CLD"
+ }
+ ],
+ "functions": [
+ {
+ "name": "getAcceptLanguages",
+ "type": "function",
+ "description": "Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use $(ref:i18n.getUILanguage).",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {"name": "languages", "type": "array", "items": {"$ref": "LanguageCode"}, "description": "Array of LanguageCode"}
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getMessage",
+ "type": "function",
+ "description": "Gets the localized string for the specified message. If the message is missing, this method returns an empty string (''). If the format of the getMessage()
call is wrong — for example, messageName is not a string or the substitutions array has more than 9 elements — this method returns undefined
.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "messageName",
+ "description": "The name of the message, as specified in the $(topic:i18n-messages)[messages.json]
file."
+ },
+ {
+ "type": "any",
+ "name": "substitutions",
+ "optional": true,
+ "description": "Substitution strings, if the message requires any."
+ }
+ ],
+ "returns": {
+ "type": "string",
+ "description": "Message localized for current locale."
+ }
+ },
+ {
+ "name": "getUILanguage",
+ "type": "function",
+ "description": "Gets the browser UI language of the browser. This is different from $(ref:i18n.getAcceptLanguages) which returns the preferred user languages.",
+ "parameters": [],
+ "returns": {
+ "type": "string",
+ "description": "The browser UI language code such as en-US or fr-FR."
+ }
+ },
+ {
+ "name": "detectLanguage",
+ "type": "function",
+ "description": "Detects the language of the provided text using CLD.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "text",
+ "description": "User input string to be translated."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "result",
+ "description": "LanguageDetectionResult object that holds detected langugae reliability and array of DetectedLanguage",
+ "properties": {
+ "isReliable": { "type": "boolean", "description": "CLD detected language reliability" },
+ "languages":
+ {
+ "type": "array",
+ "description": "array of detectedLanguage",
+ "items":
+ {
+ "type": "object",
+ "description": "DetectedLanguage object that holds detected ISO language code and its percentage in the input string",
+ "properties":
+ {
+ "language":
+ {
+ "$ref": "LanguageCode"
+ },
+ "percentage":
+ {
+ "type": "integer",
+ "description": "The percentage of the detected language"
+ }
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "events": []
+ }
+]
diff --git a/interfaces/firefox/schemas/identity.json b/interfaces/firefox/schemas/identity.json
new file mode 100644
index 00000000..3a377315
--- /dev/null
+++ b/interfaces/firefox/schemas/identity.json
@@ -0,0 +1,219 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "PermissionNoPrompt",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "identity"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "identity",
+ "description": "Use the chrome.identity API to get OAuth2 access tokens. ",
+ "permissions": ["identity"],
+ "types": [
+ {
+ "id": "AccountInfo",
+ "type": "object",
+ "description": "An object encapsulating an OAuth account id.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "A unique identifier for the account. This ID will not change for the lifetime of the account. "
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "getAccounts",
+ "type": "function",
+ "unsupported": true,
+ "description": "Retrieves a list of AccountInfo objects describing the accounts present on the profile.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "results",
+ "type": "array",
+ "items": {
+ "$ref": "AccountInfo"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getAuthToken",
+ "type": "function",
+ "unsupported": true,
+ "description": "Gets an OAuth2 access token using the client ID and scopes specified in the oauth2 section of manifest.json.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "optional": true,
+ "type": "object",
+ "properties": {
+ "interactive": {
+ "optional": true,
+ "type": "boolean"
+ },
+ "account": {
+ "optional": true,
+ "$ref": "AccountInfo"
+ },
+ "scopes": {
+ "optional": true,
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "optional": true,
+ "type": "function",
+ "parameters": [
+ {
+ "name": "results",
+ "type": "array",
+ "items": {
+ "$ref": "AccountInfo"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getProfileUserInfo",
+ "type": "function",
+ "unsupported": true,
+ "description": "Retrieves email address and obfuscated gaia id of the user signed into a profile.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "userinfo",
+ "type": "object",
+ "properties": {
+ "email": {"type": "string"},
+ "id": { "type": "string" }
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "removeCachedAuthToken",
+ "type": "function",
+ "unsupported": true,
+ "description": "Removes an OAuth2 access token from the Identity API's token cache.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "token": {"type": "string"}
+ }
+ },
+ {
+ "name": "callback",
+ "optional": true,
+ "type": "function",
+ "parameters": [
+ {
+ "name": "userinfo",
+ "type": "object",
+ "properties": {
+ "email": {"type": "string"},
+ "id": { "type": "string" }
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "launchWebAuthFlow",
+ "type": "function",
+ "description": "Starts an auth flow at the specified URL.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "url": {"$ref": "manifest.HttpURL"},
+ "interactive": {"type": "boolean", "optional": true}
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": " responseUrl",
+ "type": "string",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getRedirectURL",
+ "type": "function",
+ "description": "Generates a redirect URL to be used in |launchWebAuthFlow|.",
+ "parameters": [
+ {
+ "name": "path",
+ "type": "string",
+ "default": "",
+ "optional": true,
+ "description": "The path appended to the end of the generated URL. "
+ }
+ ],
+ "returns": {
+ "type": "string"
+ }
+ }
+ ],
+ "events": [
+ {
+ "name": "onSignInChanged",
+ "unsupported": true,
+ "type": "function",
+ "description": "Fired when signin state changes for an account on the user's profile.",
+ "parameters": [
+ {
+ "name": "account",
+ "$ref": "AccountInfo"
+ },
+ {
+ "name": "signedIn",
+ "type": "boolean"
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/idle.json b/interfaces/firefox/schemas/idle.json
new file mode 100644
index 00000000..69dd0630
--- /dev/null
+++ b/interfaces/firefox/schemas/idle.json
@@ -0,0 +1,66 @@
+[
+ {
+ "namespace": "idle",
+ "description": "Use the browser.idle
API to detect when the machine's idle state changes.",
+ "permissions": ["idle"],
+ "types": [
+ {
+ "id": "IdleState",
+ "type": "string",
+ "enum": ["active", "idle"]
+ }
+ ],
+ "functions": [
+ {
+ "name": "queryState",
+ "type": "function",
+ "description": "Returns \"idle\" if the user has not generated any input for a specified number of seconds, or \"active\" otherwise.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "detectionIntervalInSeconds",
+ "type": "integer",
+ "minimum": 15,
+ "description": "The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "newState",
+ "$ref": "IdleState"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setDetectionInterval",
+ "type": "function",
+ "description": "Sets the interval, in seconds, used to determine when the system is in an idle state for onStateChanged events. The default interval is 60 seconds.",
+ "parameters": [
+ {
+ "name": "intervalInSeconds",
+ "type": "integer",
+ "minimum": 15,
+ "description": "Threshold, in seconds, used to determine when the system is in an idle state."
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onStateChanged",
+ "type": "function",
+ "description": "Fired when the system changes to an active or idle state. The event fires with \"idle\" if the the user has not generated any input for a specified number of seconds, and \"active\" when the user generates input on an idle system.",
+ "parameters": [
+ {
+ "name": "newState",
+ "$ref": "IdleState"
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/management.json b/interfaces/firefox/schemas/management.json
new file mode 100644
index 00000000..1e2fcbb4
--- /dev/null
+++ b/interfaces/firefox/schemas/management.json
@@ -0,0 +1,364 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "management"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace":"management",
+ "description": "The browser.management
API provides ways to manage the list of extensions that are installed and running.",
+ "types": [
+ {
+ "id": "IconInfo",
+ "description": "Information about an icon belonging to an extension.",
+ "type": "object",
+ "properties": {
+ "size": {
+ "type": "integer",
+ "description": "A number representing the width and height of the icon. Likely values include (but are not limited to) 128, 48, 24, and 16."
+ },
+ "url": {
+ "type": "string",
+ "description": "The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, for example), append ?grayscale=true
to the URL."
+ }
+ }
+ },
+ {
+ "id": "ExtensionDisabledReason",
+ "description": "A reason the item is disabled.",
+ "type": "string",
+ "enum": ["unknown", "permissions_increase"]
+ },
+ {
+ "id": "ExtensionType",
+ "description": "The type of this extension, 'extension' or 'theme'.",
+ "type": "string",
+ "enum": ["extension", "theme"]
+ },
+ {
+ "id": "ExtensionInstallType",
+ "description": "How the extension was installed. One oftrue
, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's false
and is only injected into the top frame."},
+ "match_about_blank": {"type": "boolean", "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 false
."},
+ "run_at": {
+ "$ref": "extensionTypes.RunAt",
+ "optional": true,
+ "default": "document_idle",
+ "description": "The soonest that the JavaScript or CSS will be injected into the tab. Defaults to \"document_idle\"."
+ }
+ }
+ },
+ {
+ "id": "IconPath",
+ "choices": [
+ {
+ "type": "object",
+ "patternProperties": {
+ "^[1-9]\\d*$": { "$ref": "ExtensionFileUrl" }
+ },
+ "additionalProperties": false
+ },
+ { "$ref": "ExtensionFileUrl" }
+ ]
+ },
+ {
+ "id": "IconImageData",
+ "choices": [
+ {
+ "type": "object",
+ "patternProperties": {
+ "^[1-9]\\d*$": { "$ref": "ImageData" }
+ },
+ "additionalProperties": false
+ },
+ { "$ref": "ImageData" }
+ ]
+ },
+ {
+ "id": "ImageData",
+ "type": "object",
+ "isInstanceOf": "ImageData",
+ "postprocess": "convertImageDataToURL"
+ },
+ {
+ "id": "UnrecognizedProperty",
+ "type": "any",
+ "deprecated": "An unexpected property was found in the WebExtension manifest."
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/menus.json b/interfaces/firefox/schemas/menus.json
new file mode 100644
index 00000000..90b0332f
--- /dev/null
+++ b/interfaces/firefox/schemas/menus.json
@@ -0,0 +1,606 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "PermissionNoPrompt",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "menus",
+ "contextMenus"
+ ]
+ }]
+ }, {
+ "$extend": "OptionalPermissionNoPrompt",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "menus.overrideContext"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "contextMenus",
+ "permissions": ["contextMenus"],
+ "description": "Use the browser.contextMenus API to add items to the browser's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.",
+ "$import": "menus"
+ },
+ {
+ "namespace": "menus",
+ "permissions": ["menus"],
+ "description": "Use the browser.menus API to add items to the browser's menus. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.",
+ "properties": {
+ "ACTION_MENU_TOP_LEVEL_LIMIT": {
+ "value": 6,
+ "description": "The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored."
+ }
+ },
+ "types": [
+ {
+ "id": "ContextType",
+ "description": "The different contexts a menu can appear in. Specifying 'all' is equivalent to the combination of all other contexts except for 'tab' and 'tools_menu'.",
+ "choices": [
+ {
+ "type": "string",
+ "enum": ["all", "page", "frame", "selection", "link", "editable", "password", "image", "video", "audio", "launcher", "bookmark", "tab", "tools_menu"]
+ },
+ {
+ "type": "string",
+ "enum": ["browser_action", "page_action"],
+ "max_manifest_version": 2
+ },
+ {
+ "type": "string",
+ "enum": ["action"],
+ "min_manifest_version": 3
+ }
+ ]
+ },
+ {
+ "id": "ItemType",
+ "type": "string",
+ "enum": ["normal", "checkbox", "radio", "separator"],
+ "description": "The type of menu item."
+ },
+ {
+ "id": "OnClickData",
+ "type": "object",
+ "description": "Information sent when a context menu item is clicked.",
+ "properties": {
+ "menuItemId": {
+ "choices": [
+ { "type": "integer" },
+ { "type": "string" }
+ ],
+ "description": "The ID of the menu item that was clicked."
+ },
+ "parentMenuItemId": {
+ "choices": [
+ { "type": "integer" },
+ { "type": "string" }
+ ],
+ "optional": true,
+ "description": "The parent ID, if any, for the item clicked."
+ },
+ "viewType": {
+ "$ref": "extension.ViewType",
+ "optional": true,
+ "description": "The type of view where the menu is clicked. May be unset if the menu is not associated with a view."
+ },
+ "mediaType": {
+ "type": "string",
+ "optional": true,
+ "description": "One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements."
+ },
+ "linkText": {
+ "type": "string",
+ "optional": true,
+ "description": "If the element is a link, the text of that link."
+ },
+ "linkUrl": {
+ "type": "string",
+ "optional": true,
+ "description": "If the element is a link, the URL it points to."
+ },
+ "srcUrl": {
+ "type": "string",
+ "optional": true,
+ "description": "Will be present for elements with a 'src' URL."
+ },
+ "pageUrl": {
+ "type": "string",
+ "optional": true,
+ "description": "The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where there is no current page, such as in a launcher context menu."
+ },
+ "frameId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": 0,
+ "description": "The id of the frame of the element where the context menu was clicked."
+ },
+ "frameUrl": {
+ "type": "string",
+ "optional": true,
+ "description": " The URL of the frame of the element where the context menu was clicked, if it was in a frame."
+ },
+ "selectionText": {
+ "type": "string",
+ "optional": true,
+ "description": "The text for the context selection, if any."
+ },
+ "editable": {
+ "type": "boolean",
+ "description": "A flag indicating whether the element is editable (text input, textarea, etc.)."
+ },
+ "wasChecked": {
+ "type": "boolean",
+ "optional": true,
+ "description": "A flag indicating the state of a checkbox or radio item before it was clicked."
+ },
+ "checked": {
+ "type": "boolean",
+ "optional": true,
+ "description": "A flag indicating the state of a checkbox or radio item after it is clicked."
+ },
+ "bookmarkId": {
+ "type": "string",
+ "optional": true,
+ "description": "The id of the bookmark where the context menu was clicked, if it was on a bookmark."
+ },
+ "modifiers": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["Shift", "Alt", "Command", "Ctrl", "MacCtrl"]
+ },
+ "description": "An array of keyboard modifiers that were held while the menu item was clicked."
+ },
+ "button": {
+ "type": "integer",
+ "optional": true,
+ "description": "An integer value of button by which menu item was clicked."
+ },
+ "targetElementId": {
+ "type": "integer",
+ "optional": true,
+ "description": "An identifier of the clicked element, if any. Use menus.getTargetElement in the page to find the corresponding element."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "create",
+ "type": "function",
+ "description": "Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in $(ref:runtime.lastError)).",
+ "returns": {
+ "choices": [
+ { "type": "integer" },
+ { "type": "string" }
+ ],
+ "description": "The ID of the newly created item."
+ },
+ "parameters": [
+ {
+ "type": "object",
+ "name": "createProperties",
+ "properties": {
+ "type": {
+ "$ref": "ItemType",
+ "optional": true,
+ "description": "The type of menu item. Defaults to 'normal' if not specified."
+ },
+ "id": {
+ "type": "string",
+ "optional": true,
+ "description": "The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension."
+ },
+ "icons": {
+ "type": "object",
+ "optional" : true,
+ "patternProperties" : {
+ "^[1-9]\\d*$": { "type" : "string" }
+ }
+ },
+ "title": {
+ "type": "string",
+ "optional": true,
+ "description": "The text to be displayed in the item; this is required unless type
is 'separator'. When the context is 'selection', you can use %s
within the string to show the selected text. For example, if this parameter's value is \"Translate '%s' to Pig Latin\" and the user selects the word \"cool\", the context menu item for the selection is \"Translate 'cool' to Pig Latin\"."
+ },
+ "checked": {
+ "type": "boolean",
+ "optional": true,
+ "description": "The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items."
+ },
+ "contexts": {
+ "type": "array",
+ "items": {
+ "$ref": "ContextType"
+ },
+ "minItems": 1,
+ "optional": true,
+ "description": "List of contexts this menu item will appear in. Defaults to ['page'] if not specified."
+ },
+ "viewTypes": {
+ "type": "array",
+ "items": {
+ "$ref": "extension.ViewType"
+ },
+ "minItems": 1,
+ "optional": true,
+ "description": "List of view types where the menu item will be shown. Defaults to any view, including those without a viewType."
+ },
+ "visible": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the item is visible in the menu."
+ },
+ "onclick": {
+ "type": "function",
+ "max_manifest_version": 2,
+ "optional": true,
+ "description": "A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, they should register a listener for $(ref:contextMenus.onClicked).",
+ "parameters": [
+ {
+ "name": "info",
+ "$ref": "OnClickData",
+ "description": "Information about the item clicked and the context where the click happened."
+ },
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab",
+ "description": "The details of the tab where the click took place. Note: this parameter only present for extensions."
+ }
+ ]
+ },
+ "parentId": {
+ "choices": [
+ { "type": "integer" },
+ { "type": "string" }
+ ],
+ "optional": true,
+ "description": "The ID of a parent menu item; this makes the item a child of a previously added item."
+ },
+ "documentUrlPatterns": {
+ "type": "array",
+ "items": {"type": "string"},
+ "optional": true,
+ "description": "Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see $(topic:match_patterns)[Match Patterns]."
+ },
+ "targetUrlPatterns": {
+ "type": "array",
+ "items": {"type": "string"},
+ "optional": true,
+ "description": "Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags."
+ },
+ "enabled": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether this context menu item is enabled or disabled. Defaults to true."
+ },
+ "command": {
+ "choices": [
+ { "type": "string" },
+ {
+ "type": "string",
+ "enum": ["_execute_browser_action", "_execute_page_action", "_execute_sidebar_action"],
+ "max_manifest_version": 2,
+ "description": "Manifest V2 supports internal commands _execute_page_action, _execute_browser_action and _execute_sidebar_action."
+ },
+ {
+ "type": "string",
+ "enum": ["_execute_action", "_execute_page_action", "_execute_sidebar_action"],
+ "min_manifest_version": 3,
+ "description": "Manifest V3 supports internal commands _execute_page_action, _execute_action and _execute_sidebar_action."
+ }
+ ],
+ "optional": true,
+ "description": "Specifies a command to issue for the context click."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "description": "Called when the item has been created in the browser. If there were any problems creating the item, details will be available in $(ref:runtime.lastError).",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "update",
+ "type": "function",
+ "description": "Updates a previously created context menu item.",
+ "async": "callback",
+ "parameters": [
+ {
+ "choices": [
+ { "type": "integer" },
+ { "type": "string" }
+ ],
+ "name": "id",
+ "description": "The ID of the item to update."
+ },
+ {
+ "type": "object",
+ "name": "updateProperties",
+ "description": "The properties to update. Accepts the same values as the create function.",
+ "properties": {
+ "type": {
+ "$ref": "ItemType",
+ "optional": true
+ },
+ "icons": {
+ "type": "object",
+ "optional": "omit-key-if-missing",
+ "patternProperties" : {
+ "^[1-9]\\d*$": { "type" : "string" }
+ }
+ },
+ "title": {
+ "type": "string",
+ "optional": true
+ },
+ "checked": {
+ "type": "boolean",
+ "optional": true
+ },
+ "contexts": {
+ "type": "array",
+ "items": {
+ "$ref": "ContextType"
+ },
+ "minItems": 1,
+ "optional": true
+ },
+ "viewTypes": {
+ "type": "array",
+ "items": {
+ "$ref": "extension.ViewType"
+ },
+ "minItems": 1,
+ "optional": true
+ },
+ "visible": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the item is visible in the menu."
+ },
+ "onclick": {
+ "type": "function",
+ "max_manifest_version": 2,
+ "optional": "omit-key-if-missing",
+ "parameters": [
+ {
+ "name": "info",
+ "$ref": "OnClickData"
+ },
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab",
+ "description": "The details of the tab where the click took place. Note: this parameter only present for extensions."
+ }
+ ]
+ },
+ "parentId": {
+ "choices": [
+ { "type": "integer" },
+ { "type": "string" }
+ ],
+ "optional": true,
+ "description": "Note: You cannot change an item to be a child of one of its own descendants."
+ },
+ "documentUrlPatterns": {
+ "type": "array",
+ "items": {"type": "string"},
+ "optional": true
+ },
+ "targetUrlPatterns": {
+ "type": "array",
+ "items": {"type": "string"},
+ "optional": true
+ },
+ "enabled": {
+ "type": "boolean",
+ "optional": true
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [],
+ "description": "Called when the context menu has been updated."
+ }
+ ]
+ },
+ {
+ "name": "remove",
+ "type": "function",
+ "description": "Removes a context menu item.",
+ "async": "callback",
+ "parameters": [
+ {
+ "choices": [
+ { "type": "integer" },
+ { "type": "string" }
+ ],
+ "name": "menuItemId",
+ "description": "The ID of the context menu item to remove."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [],
+ "description": "Called when the context menu has been removed."
+ }
+ ]
+ },
+ {
+ "name": "removeAll",
+ "type": "function",
+ "description": "Removes all context menu items added by this extension.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [],
+ "description": "Called when removal is complete."
+ }
+ ]
+ },
+ {
+ "name": "overrideContext",
+ "permissions": ["menus.overrideContext"],
+ "type": "function",
+ "description": "Show the matching menu items from this extension instead of the default menu. This should be called during a 'contextmenu' DOM event handler, and only applies to the menu that opens after this event.",
+ "parameters": [
+ {
+ "name": "contextOptions",
+ "type": "object",
+ "properties": {
+ "showDefaults": {
+ "type": "boolean",
+ "optional": true,
+ "default": false,
+ "description": "Whether to also include default menu items in the menu."
+ },
+ "context": {
+ "type": "string",
+ "enum": ["bookmark", "tab"],
+ "optional": true,
+ "description": "ContextType to override, to allow menu items from other extensions in the menu. Currently only 'bookmark' and 'tab' are supported. showDefaults cannot be used with this option."
+ },
+ "bookmarkId": {
+ "type": "string",
+ "minLength": 1,
+ "optional": true,
+ "description": "Required when context is 'bookmark'. Requires 'bookmark' permission."
+ },
+ "tabId": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "Required when context is 'tab'. Requires 'tabs' permission."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "refresh",
+ "type": "function",
+ "description": "Updates the extension items in the shown menu, including changes that have been made since the menu was shown. Has no effect if the menu is hidden. Rebuilding a shown menu is an expensive operation, only invoke this method when necessary.",
+ "async": true,
+ "parameters": []
+ }
+ ],
+ "events": [
+ {
+ "name": "onClicked",
+ "type": "function",
+ "description": "Fired when a context menu item is clicked.",
+ "parameters": [
+ {
+ "name": "info",
+ "$ref": "OnClickData",
+ "description": "Information about the item clicked and the context where the click happened."
+ },
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab",
+ "description": "The details of the tab where the click took place. If the click did not take place in a tab, this parameter will be missing.",
+ "optional": true
+ }
+ ]
+ },
+ {
+ "name": "onShown",
+ "type": "function",
+ "description": "Fired when a menu is shown. The extension can add, modify or remove menu items and call menus.refresh() to update the menu.",
+ "parameters": [
+ {
+ "name": "info",
+ "type": "object",
+ "description": "Information about the context of the menu action and the created menu items. For more information about each property, see OnClickData. The following properties are only set if the extension has host permissions for the given context: linkUrl, linkText, srcUrl, pageUrl, frameUrl, selectionText.",
+ "properties": {
+ "menuIds": {
+ "description": "A list of IDs of the menu items that were shown.",
+ "type": "array",
+ "items": {
+ "choices": [
+ { "type": "integer" },
+ { "type": "string" }
+ ]
+ }
+ },
+ "contexts": {
+ "description": "A list of all contexts that apply to the menu.",
+ "type": "array",
+ "items": {"$ref": "ContextType"}
+ },
+ "viewType": {
+ "$ref": "extension.ViewType",
+ "optional": true
+ },
+ "editable": {
+ "type": "boolean"
+ },
+ "mediaType": {
+ "type": "string",
+ "optional": true
+ },
+ "linkUrl": {
+ "type": "string",
+ "optional": true
+ },
+ "linkText": {
+ "type": "string",
+ "optional": true
+ },
+ "srcUrl": {
+ "type": "string",
+ "optional": true
+ },
+ "pageUrl": {
+ "type": "string",
+ "optional": true
+ },
+ "frameUrl": {
+ "type": "string",
+ "optional": true
+ },
+ "selectionText": {
+ "type": "string",
+ "optional": true
+ },
+ "targetElementId": {
+ "type": "integer",
+ "optional": true
+ }
+ }
+ },
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab",
+ "description": "The details of the tab where the menu was opened."
+ }
+ ]
+ },
+ {
+ "name": "onHidden",
+ "type": "function",
+ "description": "Fired when a menu is hidden. This event is only fired if onShown has fired before.",
+ "parameters": []
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/menus_child.json b/interfaces/firefox/schemas/menus_child.json
new file mode 100644
index 00000000..884c4708
--- /dev/null
+++ b/interfaces/firefox/schemas/menus_child.json
@@ -0,0 +1,29 @@
+[
+ {
+ "namespace": "menus",
+ "permissions": ["menus"],
+ "allowedContexts": ["content", "devtools"],
+ "description": "The part of the menus API that is available in all extension contexts, including content scripts.",
+ "functions": [
+ {
+ "name": "getTargetElement",
+ "type": "function",
+ "allowedContexts": ["content", "devtools"],
+ "description": "Retrieve the element that was associated with a recent contextmenu event.",
+ "parameters": [
+ {
+ "type": "integer",
+ "description": "The identifier of the clicked element, available as info.targetElementId in the menus.onShown, onClicked or onclick event.",
+ "name": "targetElementId"
+ }
+ ],
+ "returns": {
+ "type": "object",
+ "optional": true,
+ "isInstanceOf": "Element",
+ "additionalProperties": { "type": "any" }
+ }
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/native_manifest.json b/interfaces/firefox/schemas/native_manifest.json
new file mode 100644
index 00000000..a637ba94
--- /dev/null
+++ b/interfaces/firefox/schemas/native_manifest.json
@@ -0,0 +1,64 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "id": "NativeManifest",
+ "description": "Represents a native manifest file",
+ "choices": [
+ {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "pattern": "^\\w+(\\.\\w+)*$"
+ },
+ "description": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "pkcs11", "stdio"
+ ]
+ },
+ "allowed_extensions": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "$ref": "manifest.ExtensionID"
+ }
+ }
+ }
+ },
+ {
+ "type": "object",
+ "properties": {
+ "name": {
+ "$ref": "manifest.ExtensionID"
+ },
+ "description": {
+ "type": "string"
+ },
+ "data": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "any"
+ }
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "storage"
+ ]
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/network_status.json b/interfaces/firefox/schemas/network_status.json
new file mode 100644
index 00000000..65fa5826
--- /dev/null
+++ b/interfaces/firefox/schemas/network_status.json
@@ -0,0 +1,66 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "PermissionPrivileged",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "networkStatus"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "networkStatus",
+ "description": "This API provides the ability to determine the status of and detect changes in the network connection. This API can only be used in privileged extensions.",
+ "permissions": ["networkStatus"],
+ "types": [
+ {
+ "id": "NetworkLinkInfo",
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "enum": ["unknown", "up", "down"],
+ "description": "Status of the network link, if \"unknown\" then link is usually assumed to be \"up\""
+ },
+ "type": {
+ "type": "string",
+ "enum": ["unknown", "ethernet", "usb", "wifi", "wimax", "mobile"],
+ "description": "If known, the type of network connection that is avialable."
+ },
+ "id": {
+ "type": "string",
+ "optional": true,
+ "description": "If known, the network id or name."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "getLinkInfo",
+ "type": "function",
+ "description": "Returns the $(ref:NetworkLinkInfo} of the current network connection.",
+ "async": true,
+ "parameters": []
+ }
+ ],
+ "events": [
+ {
+ "name": "onConnectionChanged",
+ "type": "function",
+ "description": "Fired when the network connection state changes.",
+ "parameters": [
+ {
+ "name": "details",
+ "$ref": "NetworkLinkInfo"
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/notifications.json b/interfaces/firefox/schemas/notifications.json
new file mode 100644
index 00000000..31420b16
--- /dev/null
+++ b/interfaces/firefox/schemas/notifications.json
@@ -0,0 +1,425 @@
+[
+ {
+ "namespace": "notifications",
+ "permissions": ["notifications"],
+ "types": [
+ {
+ "id": "TemplateType",
+ "type": "string",
+ "enum": [
+ "basic",
+ "image",
+ "list",
+ "progress"
+ ]
+ },
+ {
+ "id": "PermissionLevel",
+ "type": "string",
+ "enum": [
+ "granted",
+ "denied"
+ ]
+ },
+ {
+ "id": "NotificationItem",
+ "type": "object",
+ "properties": {
+ "title": {
+ "description": "Title of one item of a list notification.",
+ "type": "string"
+ },
+ "message": {
+ "description": "Additional details about this item.",
+ "type": "string"
+ }
+ }
+ },
+ {
+ "id": "CreateNotificationOptions",
+ "type": "object",
+ "properties": {
+ "type": {
+ "description": "Which type of notification to display.",
+ "$ref": "TemplateType"
+ },
+ "iconUrl": {
+ "optional": true,
+ "description": "A URL to the sender's avatar, app icon, or a thumbnail for image notifications.",
+ "type": "string"
+ },
+ "appIconMaskUrl": {
+ "optional": true,
+ "description": "A URL to the app icon mask.",
+ "type": "string"
+ },
+ "title": {
+ "description": "Title of the notification (e.g. sender name for email).",
+ "type": "string"
+ },
+ "message": {
+ "description": "Main notification content.",
+ "type": "string"
+ },
+ "contextMessage": {
+ "optional": true,
+ "description": "Alternate notification content with a lower-weight font.",
+ "type": "string"
+ },
+ "priority": {
+ "optional": true,
+ "description": "Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default.",
+ "type": "integer",
+ "minimum": -2,
+ "maximum": 2
+ },
+ "eventTime": {
+ "optional": true,
+ "description": "A timestamp associated with the notification, in milliseconds past the epoch.",
+ "type": "number"
+ },
+ "buttons": {
+ "unsupported": true,
+ "optional": true,
+ "description": "Text and icons for up to two notification action buttons.",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "iconUrl": {
+ "optional": true,
+ "type": "string"
+ }
+ }
+ }
+ },
+ "imageUrl": {
+ "optional": true,
+ "description": "A URL to the image thumbnail for image-type notifications.",
+ "type": "string"
+ },
+ "items": {
+ "optional": true,
+ "description": "Items for multi-item notifications.",
+ "type": "array",
+ "items": { "$ref": "NotificationItem" }
+ },
+ "progress": {
+ "optional": true,
+ "description": "Current progress ranges from 0 to 100.",
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 100
+ },
+ "isClickable": {
+ "optional": true,
+ "description": "Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification.",
+ "type": "boolean"
+ }
+ }
+ },
+ {
+ "id": "UpdateNotificationOptions",
+ "type": "object",
+ "properties": {
+ "type": {
+ "optional": true,
+ "description": "Which type of notification to display.",
+ "$ref": "TemplateType"
+ },
+ "iconUrl": {
+ "optional": true,
+ "description": "A URL to the sender's avatar, app icon, or a thumbnail for image notifications.",
+ "type": "string"
+ },
+ "appIconMaskUrl": {
+ "optional": true,
+ "description": "A URL to the app icon mask.",
+ "type": "string"
+ },
+ "title": {
+ "optional": true,
+ "description": "Title of the notification (e.g. sender name for email).",
+ "type": "string"
+ },
+ "message": {
+ "optional": true,
+ "description": "Main notification content.",
+ "type": "string"
+ },
+ "contextMessage": {
+ "optional": true,
+ "description": "Alternate notification content with a lower-weight font.",
+ "type": "string"
+ },
+ "priority": {
+ "optional": true,
+ "description": "Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default.",
+ "type": "integer",
+ "minimum": -2,
+ "maximum": 2
+ },
+ "eventTime": {
+ "optional": true,
+ "description": "A timestamp associated with the notification, in milliseconds past the epoch.",
+ "type": "number"
+ },
+ "buttons": {
+ "unsupported": true,
+ "optional": true,
+ "description": "Text and icons for up to two notification action buttons.",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "iconUrl": {
+ "optional": true,
+ "type": "string"
+ }
+ }
+ }
+ },
+ "imageUrl": {
+ "optional": true,
+ "description": "A URL to the image thumbnail for image-type notifications.",
+ "type": "string"
+ },
+ "items": {
+ "optional": true,
+ "description": "Items for multi-item notifications.",
+ "type": "array",
+ "items": { "$ref": "NotificationItem" }
+ },
+ "progress": {
+ "optional": true,
+ "description": "Current progress ranges from 0 to 100.",
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 100
+ },
+ "isClickable": {
+ "optional": true,
+ "description": "Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification.",
+ "type": "boolean"
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "create",
+ "type": "function",
+ "description": "Creates and displays a notification.",
+ "async": "callback",
+ "parameters": [
+ {
+ "optional": true,
+ "type": "string",
+ "name": "notificationId",
+ "description": "Identifier of the notification. If it is empty, this method generates an id. If it matches an existing notification, this method first clears that notification before proceeding with the create operation."
+ },
+ {
+ "$ref": "CreateNotificationOptions",
+ "name": "options",
+ "description": "Contents of the notification."
+ },
+ {
+ "optional": true,
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "notificationId",
+ "type": "string",
+ "description": "The notification id (either supplied or generated) that represents the created notification."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "update",
+ "unsupported": true,
+ "type": "function",
+ "description": "Updates an existing notification.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "notificationId",
+ "description": "The id of the notification to be updated."
+ },
+ {
+ "$ref": "UpdateNotificationOptions",
+ "name": "options",
+ "description": "Contents of the notification to update to."
+ },
+ {
+ "optional": true,
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "wasUpdated",
+ "type": "boolean",
+ "description": "Indicates whether a matching notification existed."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "clear",
+ "type": "function",
+ "description": "Clears an existing notification.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "notificationId",
+ "description": "The id of the notification to be updated."
+ },
+ {
+ "optional": true,
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "wasCleared",
+ "type": "boolean",
+ "description": "Indicates whether a matching notification existed."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getAll",
+ "type": "function",
+ "description": "Retrieves all the notifications.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "notifications",
+ "type": "object",
+ "additionalProperties": {"$ref": "CreateNotificationOptions"},
+ "description": "The set of notifications currently in the system."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getPermissionLevel",
+ "unsupported": true,
+ "type": "function",
+ "description": "Retrieves whether the user has enabled notifications from this app or extension.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "level",
+ "$ref": "PermissionLevel",
+ "description": "The current permission level."
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onClosed",
+ "type": "function",
+ "description": "Fired when the notification closed, either by the system or by user action.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "notificationId",
+ "description": "The notificationId of the closed notification."
+ },
+ {
+ "type": "boolean",
+ "name": "byUser",
+ "description": "True if the notification was closed by the user."
+ }
+ ]
+ },
+ {
+ "name": "onClicked",
+ "type": "function",
+ "description": "Fired when the user clicked in a non-button area of the notification.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "notificationId",
+ "description": "The notificationId of the clicked notification."
+ }
+ ]
+ },
+ {
+ "name": "onButtonClicked",
+ "type": "function",
+ "description": "Fired when the user pressed a button in the notification.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "notificationId",
+ "description": "The notificationId of the clicked notification."
+ },
+ {
+ "type": "number",
+ "name": "buttonIndex",
+ "description": "The index of the button clicked by the user."
+ }
+ ]
+ },
+ {
+ "name": "onPermissionLevelChanged",
+ "unsupported": true,
+ "type": "function",
+ "description": "Fired when the user changes the permission level.",
+ "parameters": [
+ {
+ "$ref": "PermissionLevel",
+ "name": "level",
+ "description": "The new permission level."
+ }
+ ]
+ },
+ {
+ "name": "onShowSettings",
+ "unsupported": true,
+ "type": "function",
+ "description": "Fired when the user clicked on a link for the app's notification settings.",
+ "parameters": [
+ ]
+ },
+ {
+ "name": "onShown",
+ "type": "function",
+ "description": "Fired when the notification is shown.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "notificationId",
+ "description": "The notificationId of the shown notification."
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/omnibox.json b/interfaces/firefox/schemas/omnibox.json
new file mode 100644
index 00000000..a05dfbce
--- /dev/null
+++ b/interfaces/firefox/schemas/omnibox.json
@@ -0,0 +1,220 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "omnibox": {
+ "type": "object",
+ "additionalProperties": { "$ref": "UnrecognizedProperty" },
+ "properties": {
+ "keyword": {
+ "type": "string",
+ "pattern": "^[^?\\s:][^\\s:]*$"
+ }
+ },
+ "optional": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "namespace": "omnibox",
+ "description": "The omnibox API allows you to register a keyword with Firefox's address bar.",
+ "permissions": ["manifest:omnibox"],
+ "types": [
+ {
+ "id": "DescriptionStyleType",
+ "type": "string",
+ "description": "The style type.",
+ "enum": ["url", "match", "dim"]
+ },
+ {
+ "id": "OnInputEnteredDisposition",
+ "type": "string",
+ "enum": ["currentTab", "newForegroundTab", "newBackgroundTab"],
+ "description": "The window disposition for the omnibox query. This is the recommended context to display results. For example, if the omnibox command is to navigate to a certain URL, a disposition of 'newForegroundTab' means the navigation should take place in a new selected tab."
+ },
+ {
+ "id": "SuggestResult",
+ "type": "object",
+ "description": "A suggest result.",
+ "properties": {
+ "content": {
+ "type": "string",
+ "minLength": 1,
+ "description": "The text that is put into the URL bar, and that is sent to the extension when the user chooses this entry."
+ },
+ "description": {
+ "type": "string",
+ "minLength": 1,
+ "description": "The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. browser.pageAction
API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages.",
+ "permissions": ["manifest:page_action"],
+ "types": [
+ {
+ "id": "ImageDataType",
+ "type": "object",
+ "isInstanceOf": "ImageData",
+ "additionalProperties": { "type": "any" },
+ "postprocess": "convertImageDataToURL",
+ "description": "Pixel data for an image. Must be an ImageData object (for example, from a canvas
element)."
+ },
+ {
+ "id": "OnClickData",
+ "type": "object",
+ "description": "Information sent when a page action is clicked.",
+ "properties": {
+ "modifiers": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["Shift", "Alt", "Command", "Ctrl", "MacCtrl"]
+ },
+ "description": "An array of keyboard modifiers that were held while the menu item was clicked."
+ },
+ "button": {
+ "type": "integer",
+ "optional": true,
+ "description": "An integer value of button by which menu item was clicked."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "show",
+ "type": "function",
+ "async": "callback",
+ "description": "Shows the page action. The page action is shown whenever the tab is selected.",
+ "parameters": [
+ {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "hide",
+ "type": "function",
+ "async": "callback",
+ "description": "Hides the page action.",
+ "parameters": [
+ {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "isShown",
+ "type": "function",
+ "description": "Checks whether the page action is shown.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "tabId": {
+ "type": "integer",
+ "description": "Specify the tab to get the shownness from."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "setTitle",
+ "type": "function",
+ "description": "Sets the title of the page action. This is displayed in a tooltip over the page action.",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
+ "title": {
+ "choices": [
+ {"type": "string"},
+ {"type": "null"}
+ ],
+ "description": "The tooltip string."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "getTitle",
+ "type": "function",
+ "description": "Gets the title of the page action.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "tabId": {
+ "type": "integer",
+ "description": "Specify the tab to get the title from."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setIcon",
+ "type": "function",
+ "description": "Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
+ "imageData": {
+ "choices": [
+ { "$ref": "ImageDataType" },
+ {
+ "type": "object",
+ "patternProperties": {
+ "^[1-9]\\d*$": {"$ref": "ImageDataType"}
+ }
+ }
+ ],
+ "optional": true,
+ "description": "Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale
, then image with size scale
* 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'"
+ },
+ "path": {
+ "choices": [
+ { "type": "string" },
+ {
+ "type": "object",
+ "patternProperties": {
+ "^[1-9]\\d*$": { "type": "string" }
+ }
+ }
+ ],
+ "optional": true,
+ "description": "Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale
, then image with size scale
* 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'"
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "setPopup",
+ "type": "function",
+ "async": true,
+ "description": "Sets the html document to be opened as a popup when the user clicks on the page action's icon.",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
+ "popup": {
+ "choices": [
+ {"type": "string"},
+ {"type": "null"}
+ ],
+ "description": "The html file to show in a popup. If set to the empty string (''), no popup is shown."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "getPopup",
+ "type": "function",
+ "description": "Gets the html document set as the popup for this page action.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "tabId": {
+ "type": "integer",
+ "description": "Specify the tab to get the popup from."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "openPopup",
+ "type": "function",
+ "requireUserInput": true,
+ "description": "Opens the extension page action in the active window.",
+ "async": true,
+ "parameters": []
+ }
+ ],
+ "events": [
+ {
+ "name": "onClicked",
+ "type": "function",
+ "description": "Fired when a page action icon is clicked. This event will not fire if the page action has a popup.",
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ },
+ {
+ "name": "info",
+ "$ref": "OnClickData",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/permissions.json b/interfaces/firefox/schemas/permissions.json
new file mode 100644
index 00000000..1c4625db
--- /dev/null
+++ b/interfaces/firefox/schemas/permissions.json
@@ -0,0 +1,151 @@
+[
+ {
+ "namespace": "permissions",
+ "types": [
+ {
+ "id": "Permissions",
+ "type": "object",
+ "properties": {
+ "permissions": {
+ "type": "array",
+ "items": { "$ref": "manifest.OptionalPermission" },
+ "optional": true,
+ "default": []
+ },
+ "origins": {
+ "type": "array",
+ "items": { "$ref": "manifest.MatchPattern" },
+ "optional": true,
+ "default": []
+ }
+ }
+ },
+ {
+ "id": "AnyPermissions",
+ "type": "object",
+ "properties": {
+ "permissions": {
+ "type": "array",
+ "items": { "$ref": "manifest.Permission" },
+ "optional": true,
+ "default": []
+ },
+ "origins": {
+ "type": "array",
+ "items": { "$ref": "manifest.MatchPattern" },
+ "optional": true,
+ "default": []
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "getAll",
+ "type": "function",
+ "async": "callback",
+ "description": "Get a list of all the extension's permissions.",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "permissions",
+ "$ref": "AnyPermissions"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "contains",
+ "type": "function",
+ "async": "callback",
+ "description": "Check if the extension has the given permissions.",
+ "parameters": [
+ {
+ "name": "permissions",
+ "$ref": "AnyPermissions"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "boolean"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "request",
+ "type": "function",
+ "allowedContexts": ["content"],
+ "async": "callback",
+ "requireUserInput": true,
+ "description": "Request the given permissions.",
+ "parameters": [
+ {
+ "name": "permissions",
+ "$ref": "Permissions"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "granted",
+ "type": "boolean"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "remove",
+ "type": "function",
+ "async": "callback",
+ "description": "Relinquish the given permissions.",
+ "parameters": [
+ {
+ "name": "permissions",
+ "$ref": "Permissions"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ ]
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onAdded",
+ "type": "function",
+ "description": "Fired when the extension acquires new permissions.",
+ "parameters": [
+ {
+ "name": "permissions",
+ "$ref": "Permissions"
+ }
+ ]
+ },
+ {
+ "name": "onRemoved",
+ "type": "function",
+ "description": "Fired when permissions are removed from the extension.",
+ "parameters": [
+ {
+ "name": "permissions",
+ "$ref": "Permissions"
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/privacy.json b/interfaces/firefox/schemas/privacy.json
new file mode 100644
index 00000000..5dcbc41f
--- /dev/null
+++ b/interfaces/firefox/schemas/privacy.json
@@ -0,0 +1,183 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "privacy"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "privacy",
+ "permissions": ["privacy"]
+ },
+ {
+ "namespace": "privacy.network",
+ "description": "Use the browser.privacy
API to control usage of the features in the browser that can affect a user's privacy.",
+ "permissions": ["privacy"],
+ "types": [
+ {
+ "id": "IPHandlingPolicy",
+ "type": "string",
+ "enum": ["default", "default_public_and_private_interfaces", "default_public_interface_only", "disable_non_proxied_udp", "proxy_only"],
+ "description": "The IP handling policy of WebRTC."
+ },
+ {
+ "id": "tlsVersionRestrictionConfig",
+ "type": "object",
+ "description": "An object which describes TLS minimum and maximum versions.",
+ "properties": {
+ "minimum": {
+ "type": "string",
+ "enum": [
+ "TLSv1",
+ "TLSv1.1",
+ "TLSv1.2",
+ "TLSv1.3",
+ "unknown"
+ ],
+ "optional": true,
+ "description": "The minimum TLS version supported."
+ },
+ "maximum": {
+ "type": "string",
+ "enum": [
+ "TLSv1",
+ "TLSv1.1",
+ "TLSv1.2",
+ "TLSv1.3",
+ "unknown"
+ ],
+ "optional": true,
+ "description": "The maximum TLS version supported."
+ }
+ }
+ },
+ {
+ "id": "HTTPSOnlyModeOption",
+ "type": "string",
+ "enum": ["always", "private_browsing", "never"],
+ "description": "The mode for https-only mode."
+ }
+ ],
+ "properties": {
+ "networkPredictionEnabled": {
+ "$ref": "types.Setting",
+ "description": "If enabled, the browser attempts to speed up your web browsing experience by pre-resolving DNS entries, prerendering sites (<link rel='prefetch' ...>
), and preemptively opening TCP and SSL connections to servers. This preference's value is a boolean, defaulting to true
."
+ },
+ "peerConnectionEnabled": {
+ "$ref": "types.Setting",
+ "description": "Allow users to enable and disable RTCPeerConnections (aka WebRTC)."
+ },
+ "webRTCIPHandlingPolicy": {
+ "$ref": "types.Setting",
+ "description": "Allow users to specify the media performance/privacy tradeoffs which impacts how WebRTC traffic will be routed and how much local address information is exposed. This preference's value is of type IPHandlingPolicy, defaulting to default
."
+ },
+ "tlsVersionRestriction": {
+ "$ref": "types.Setting",
+ "description": "This property controls the minimum and maximum TLS versions. This setting's value is an object of $(ref:tlsVersionRestrictionConfig)."
+ },
+ "httpsOnlyMode": {
+ "$ref": "types.Setting",
+ "description": "Allow users to query the mode for 'HTTPS-Only Mode'. This setting's value is of type HTTPSOnlyModeOption, defaulting to never
."
+ },
+ "globalPrivacyControl": {
+ "$ref": "types.Setting",
+ "description": "Allow users to query the status of 'Global Privacy Control'. This setting's value is of type boolean, defaulting to false
."
+ }
+ }
+ },
+ {
+ "namespace": "privacy.services",
+ "description": "Use the browser.privacy
API to control usage of the features in the browser that can affect a user's privacy.",
+ "permissions": ["privacy"],
+ "properties": {
+ "passwordSavingEnabled": {
+ "$ref": "types.Setting",
+ "description": "If enabled, the password manager will ask if you want to save passwords. This preference's value is a boolean, defaulting to true
."
+ }
+ }
+ },
+ {
+ "namespace": "privacy.websites",
+ "description": "Use the browser.privacy
API to control usage of the features in the browser that can affect a user's privacy.",
+ "permissions": ["privacy"],
+ "types": [
+ {
+ "id": "TrackingProtectionModeOption",
+ "type": "string",
+ "enum": ["always", "never", "private_browsing"],
+ "description": "The mode for tracking protection."
+ },
+ {
+ "id": "CookieConfig",
+ "type": "object",
+ "description": "The settings for cookies.",
+ "properties": {
+ "behavior": {
+ "type": "string",
+ "optional": true,
+ "enum": [
+ "allow_all",
+ "reject_all",
+ "reject_third_party",
+ "allow_visited",
+ "reject_trackers",
+ "reject_trackers_and_partition_foreign"
+ ],
+ "description": "The type of cookies to allow."
+ },
+ "nonPersistentCookies": {
+ "type": "boolean",
+ "optional": true,
+ "default": false,
+ "description": "Whether to create all cookies as nonPersistent (i.e., session) cookies.",
+ "deprecated": "This property has no effect anymore and its value is always false."
+ }
+ }
+ }
+ ],
+ "properties": {
+ "thirdPartyCookiesAllowed": {
+ "$ref": "types.Setting",
+ "description": "If disabled, the browser blocks third-party sites from setting cookies. The value of this preference is of type boolean, and the default value is true
.",
+ "unsupported": true
+ },
+ "hyperlinkAuditingEnabled": {
+ "$ref": "types.Setting",
+ "description": "If enabled, the browser sends auditing pings when requested by a website (<a ping>
). The value of this preference is of type boolean, and the default value is true
."
+ },
+ "referrersEnabled": {
+ "$ref": "types.Setting",
+ "description": "If enabled, the browser sends referer
headers with your requests. Yes, the name of this preference doesn't match the misspelled header. No, we're not going to change it. The value of this preference is of type boolean, and the default value is true
."
+ },
+ "resistFingerprinting": {
+ "$ref": "types.Setting",
+ "description": "If enabled, the browser attempts to appear similar to other users by reporting generic information to websites. This can prevent websites from uniquely identifying users. Examples of data that is spoofed include number of CPU cores, precision of JavaScript timers, the local timezone, and disabling features such as GamePad support, and the WebSpeech and Navigator APIs. The value of this preference is of type boolean, and the default value is false
."
+ },
+ "firstPartyIsolate": {
+ "$ref": "types.Setting",
+ "description": "If enabled, the browser will associate all data (including cookies, HSTS data, cached images, and more) for any third party domains with the domain in the address bar. This prevents third party trackers from using directly stored information to identify you across different websites, but may break websites where you login with a third party account (such as a Facebook or Google login.) The value of this preference is of type boolean, and the default value is false
."
+ },
+ "protectedContentEnabled": {
+ "$ref": "types.Setting",
+ "description": "Available on Windows and ChromeOS only: If enabled, the browser provides a unique ID to plugins in order to run protected content. The value of this preference is of type boolean, and the default value is true
.",
+ "unsupported": true
+ },
+ "trackingProtectionMode": {
+ "$ref": "types.Setting",
+ "description": "Allow users to specify the mode for tracking protection. This setting's value is of type TrackingProtectionModeOption, defaulting to private_browsing_only
."
+ },
+ "cookieConfig": {
+ "$ref": "types.Setting",
+ "description": "Allow users to specify the default settings for allowing cookies, as well as whether all cookies should be created as non-persistent cookies. This setting's value is of type CookieConfig."
+ }
+ }
+ }
+]
diff --git a/interfaces/firefox/schemas/proxy.json b/interfaces/firefox/schemas/proxy.json
new file mode 100644
index 00000000..bb7f4235
--- /dev/null
+++ b/interfaces/firefox/schemas/proxy.json
@@ -0,0 +1,166 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "proxy"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "proxy",
+ "description": "Provides access to global proxy settings for Firefox and proxy event listeners to handle dynamic proxy implementations.",
+ "permissions": ["proxy"],
+ "types": [
+ {
+ "id": "ProxyConfig",
+ "type": "object",
+ "description": "An object which describes proxy settings.",
+ "properties": {
+ "proxyType": {
+ "type": "string",
+ "optional": true,
+ "enum": [
+ "none",
+ "autoDetect",
+ "system",
+ "manual",
+ "autoConfig"
+ ],
+ "description": "The type of proxy to use."
+ },
+ "http": {
+ "type": "string",
+ "optional": true,
+ "description": "The address of the http proxy, can include a port."
+ },
+ "httpProxyAll":{
+ "type": "boolean",
+ "optional": true,
+ "description": "Use the http proxy server for all protocols."
+ },
+ "ftp": {
+ "type": "string",
+ "optional": true,
+ "deprecated": true,
+ "description": "The address of the ftp proxy, can include a port. Deprecated since Firefox 88."
+ },
+ "ssl": {
+ "type": "string",
+ "optional": true,
+ "description": "The address of the ssl proxy, can include a port."
+ },
+ "socks": {
+ "type": "string",
+ "optional": true,
+ "description": "The address of the socks proxy, can include a port."
+ },
+ "socksVersion": {
+ "type": "integer",
+ "optional": true,
+ "description": "The version of the socks proxy.",
+ "minimum": 4,
+ "maximum": 5
+ },
+ "passthrough": {
+ "type": "string",
+ "optional": true,
+ "description": "A list of hosts which should not be proxied."
+ },
+ "autoConfigUrl": {
+ "type": "string",
+ "optional": true,
+ "description": "A URL to use to configure the proxy."
+ },
+ "autoLogin": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Do not prompt for authentication if password is saved."
+ },
+ "proxyDNS": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Proxy DNS when using SOCKS v5."
+ },
+ "respectBeConservative": {
+ "type": "boolean",
+ "optional": true,
+ "default" : true,
+ "description": " If true (the default value), do not use newer TLS protocol features that might have interoperability problems on the Internet. This is intended only for use with critical infrastructure like the updates, and is only available to privileged addons."
+ }
+ }
+ }
+ ],
+ "properties": {
+ "settings": {
+ "$ref": "types.Setting",
+ "description": "Configures proxy settings. This setting's value is an object of type ProxyConfig."
+ }
+ },
+ "events": [
+ {
+ "name": "onRequest",
+ "type": "function",
+ "description": "Fired when proxy data is needed for a request.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
+ "url": {"type": "string"},
+ "method": {"type": "string", "description": "Standard HTTP method."},
+ "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type
is main_frame
or sub_frame
), frameId
indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
+ "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
+ "incognito": {"type": "boolean", "optional": true, "description": "True for private browsing requests."},
+ "cookieStoreId": {"type": "string", "optional": true, "description": "The cookie store ID of the contextual identity."},
+ "originUrl": {"type": "string", "optional": true, "description": "URL of the resource that triggered this request."},
+ "documentUrl": {"type": "string", "optional": true, "description": "URL of the page into which the requested resource will be loaded."},
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
+ "type": {"$ref": "webRequest.ResourceType", "description": "How the requested resource will be used."},
+ "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
+ "fromCache": {"type": "boolean", "description": "Indicates if this response was fetched from disk cache."},
+ "requestHeaders": {"$ref": "webRequest.HttpHeaders", "optional": true, "description": "The HTTP request headers that are going to be sent out with this request."},
+ "urlClassification": {"$ref": "webRequest.UrlClassification", "description": "Url classification if the request has been classified."},
+ "thirdParty": {"type": "boolean", "description": "Indicates if this request and its content window hierarchy is third party."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "$ref": "webRequest.RequestFilter",
+ "name": "filter",
+ "description": "A set of filters that restricts the events that will be sent to this listener."
+ },
+ {
+ "type": "array",
+ "optional": true,
+ "name": "extraInfoSpec",
+ "description": "Array of extra information that should be passed to the listener function.",
+ "items": {
+ "type": "string",
+ "enum": ["requestHeaders"]
+ }
+ }
+ ]
+ },
+ {
+ "name": "onError",
+ "type": "function",
+ "description": "Notifies about errors caused by the invalid use of the proxy API.",
+ "parameters": [
+ {
+ "name": "error",
+ "type": "object"
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/runtime.json b/interfaces/firefox/schemas/runtime.json
new file mode 100644
index 00000000..0a3b39f9
--- /dev/null
+++ b/interfaces/firefox/schemas/runtime.json
@@ -0,0 +1,610 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "nativeMessaging"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "runtime",
+ "allowedContexts": ["content", "devtools"],
+ "description": "Use the browser.runtime
API to retrieve the background page, return details about the manifest, and listen for and respond to events in the app or extension lifecycle. You can also use this API to convert the relative path of URLs to fully-qualified URLs.",
+ "types": [
+ {
+ "id": "Port",
+ "type": "object",
+ "allowedContexts": ["content", "devtools"],
+ "description": "An object which allows two way communication with other pages.",
+ "properties": {
+ "name": {"type": "string"},
+ "disconnect": { "type": "function" },
+ "onDisconnect": { "$ref": "events.Event" },
+ "onMessage": { "$ref": "events.Event" },
+ "postMessage": {"type": "function"},
+ "sender": {
+ "$ref": "MessageSender",
+ "optional": true,
+ "description": "This property will only be present on ports passed to onConnect/onConnectExternal listeners."
+ }
+ },
+ "additionalProperties": { "type": "any"}
+ },
+ {
+ "id": "MessageSender",
+ "type": "object",
+ "allowedContexts": ["content", "devtools"],
+ "description": "An object containing information about the script context that sent a message or request.",
+ "properties": {
+ "tab": {"$ref": "tabs.Tab", "optional": true, "description": "The $(ref:tabs.Tab) which opened the connection, if any. This property will only be present when the connection was opened from a tab (including content scripts), and only if the receiver is an extension, not an app."},
+ "frameId": {"type": "integer", "optional": true, "description": "The $(topic:frame_ids)[frame] that opened the connection. 0 for top-level frames, positive for child frames. This will only be set when tab
is set."},
+ "id": {"type": "string", "optional": true, "description": "The ID of the extension or app that opened the connection, if any."},
+ "url": {"type": "string", "optional": true, "description": "The URL of the page or frame that opened the connection. If the sender is in an iframe, it will be iframe's URL not the URL of the page which hosts it."},
+ "tlsChannelId": {"unsupported": true, "type": "string", "optional": true, "description": "The TLS channel ID of the page or frame that opened the connection, if requested by the extension or app, and if available."}
+ }
+ },
+ {
+ "id": "PlatformOs",
+ "type": "string",
+ "allowedContexts": ["content", "devtools"],
+ "description": "The operating system the browser is running on.",
+ "enum": ["mac", "win", "android", "cros", "linux", "openbsd"]
+ },
+ {
+ "id": "PlatformArch",
+ "type": "string",
+ "enum": ["aarch64", "arm", "ppc64", "s390x", "sparc64", "x86-32", "x86-64", "noarch"],
+ "allowedContexts": ["content", "devtools"],
+ "description": "The machine's processor architecture."
+ },
+ {
+ "id": "PlatformInfo",
+ "type": "object",
+ "allowedContexts": ["content", "devtools"],
+ "description": "An object containing information about the current platform.",
+ "properties": {
+ "os": {
+ "$ref": "PlatformOs",
+ "description": "The operating system the browser is running on."
+ },
+ "arch": {
+ "$ref": "PlatformArch",
+ "description": "The machine's processor architecture."
+ },
+ "nacl_arch" : {
+ "unsupported": true,
+ "description": "The native client architecture. This may be different from arch on some platforms.",
+ "$ref": "PlatformNaclArch"
+ }
+ }
+ },
+ {
+ "id": "BrowserInfo",
+ "type": "object",
+ "description": "An object containing information about the current browser.",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the browser, for example 'Firefox'."
+ },
+ "vendor": {
+ "type": "string",
+ "description": "The name of the browser vendor, for example 'Mozilla'."
+ },
+ "version": {
+ "type": "string",
+ "description": "The browser's version, for example '42.0.0' or '0.8.1pre'."
+ },
+ "buildID": {
+ "type": "string",
+ "description": "The browser's build ID/date, for example '20160101'."
+ }
+ }
+ },
+ {
+ "id": "RequestUpdateCheckStatus",
+ "type": "string",
+ "enum": ["throttled", "no_update", "update_available"],
+ "allowedContexts": ["content", "devtools"],
+ "description": "Result of the update check."
+ },
+ {
+ "id": "OnInstalledReason",
+ "type": "string",
+ "enum": ["install", "update", "browser_update"],
+ "allowedContexts": ["content", "devtools"],
+ "description": "The reason that this event is being dispatched."
+ },
+ {
+ "id": "OnRestartRequiredReason",
+ "type": "string",
+ "allowedContexts": ["content", "devtools"],
+ "description": "The reason that the event is being dispatched. 'app_update' is used when the restart is needed because the application is updated to a newer version. 'os_update' is used when the restart is needed because the browser/OS is updated to a newer version. 'periodic' is used when the system runs for more than the permitted uptime set in the enterprise policy.",
+ "enum": ["app_update", "os_update", "periodic"]
+ }
+ ],
+ "properties": {
+ "lastError": {
+ "type": "object",
+ "optional": true,
+ "allowedContexts": ["content", "devtools"],
+ "description": "This will be defined during an API method callback if there was an error",
+ "properties": {
+ "message": {
+ "optional": true,
+ "type": "string",
+ "description": "Details about the error which occurred."
+ }
+ },
+ "additionalProperties": {
+ "type": "any"
+ }
+ },
+ "id": {
+ "type": "string",
+ "allowedContexts": ["content", "devtools"],
+ "description": "The ID of the extension/app."
+ }
+ },
+ "functions": [
+ {
+ "name": "getBackgroundPage",
+ "type": "function",
+ "description": "Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "backgroundPage",
+ "optional": true,
+ "type": "object",
+ "isInstanceOf": "Window",
+ "additionalProperties": { "type": "any" },
+ "description": "The JavaScript 'window' object for the background page."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "openOptionsPage",
+ "type": "function",
+ "description": "Open your Extension's options page, if possible.
The precise behavior may depend on your manifest's $(topic:optionsV2)[options_ui]
or $(topic:options)[options_page]
key, or what the browser happens to support at the time.
If your Extension does not declare an options page, or the browser failed to create one for some other reason, the callback will set $(ref:lastError).
",
+ "async": "callback",
+ "parameters": [{
+ "type": "function",
+ "name": "callback",
+ "parameters": [],
+ "optional": true
+ }]
+ },
+ {
+ "name": "getManifest",
+ "allowedContexts": ["content", "devtools"],
+ "description": "Returns details about the app or extension from the manifest. The object returned is a serialization of the full $(topic:manifest)[manifest file].",
+ "type": "function",
+ "parameters": [],
+ "returns": {
+ "type": "object",
+ "properties": {},
+ "additionalProperties": { "type": "any" },
+ "description": "The manifest details."
+ }
+ },
+ {
+ "name": "getURL",
+ "type": "function",
+ "allowedContexts": ["content", "devtools"],
+ "description": "Converts a relative path within an app/extension install directory to a fully-qualified URL.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "path",
+ "description": "A path to a resource within an app/extension expressed relative to its install directory."
+ }
+ ],
+ "returns": {
+ "type": "string",
+ "description": "The fully-qualified URL to the resource."
+ }
+ },
+ {
+ "name": "getFrameId",
+ "type": "function",
+ "allowedContexts": ["content", "devtools"],
+ "description": "Get the frameId of any window global or frame element.",
+ "parameters": [
+ {
+ "type": "any",
+ "name": "target",
+ "description": "A WindowProxy or a Browsing Context container element (IFrame, Frame, Embed, Object) for the target frame."
+ }
+ ],
+ "allowCrossOriginArguments": true,
+ "returns": {
+ "type": "number",
+ "description": "The frameId of the target frame, or -1 if it doesn't exist."
+ }
+ },
+ {
+ "name": "setUninstallURL",
+ "type": "function",
+ "description": "Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "url",
+ "optional": true,
+ "maxLength": 255,
+ "description": "URL to be opened after the extension is uninstalled. This URL must have an http: or https: scheme. Set an empty string to not open a new tab upon uninstallation."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "description": "Called when the uninstall URL is set. If the given URL is invalid, $(ref:runtime.lastError) will be set.",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "reload",
+ "description": "Reloads the app or extension.",
+ "type": "function",
+ "parameters": []
+ },
+ {
+ "name": "requestUpdateCheck",
+ "unsupported": true,
+ "type": "function",
+ "description": "Requests an update check for this app/extension.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "status",
+ "$ref": "RequestUpdateCheckStatus",
+ "description": "Result of the update check."
+ },
+ {
+ "name": "details",
+ "type": "object",
+ "optional": true,
+ "properties": {
+ "version": {
+ "type": "string",
+ "description": "The version of the available update."
+ }
+ },
+ "description": "If an update is available, this contains more information about the available update."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "restart",
+ "unsupported": true,
+ "description": "Restart the device when the app runs in kiosk mode. Otherwise, it's no-op.",
+ "type": "function",
+ "parameters": []
+ },
+ {
+ "name": "connect",
+ "type": "function",
+ "allowedContexts": ["content", "devtools"],
+ "description": "Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and $(topic:manifest/externally_connectable)[web messaging]. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via $(ref:tabs.connect).",
+ "parameters": [
+ {"type": "string", "name": "extensionId", "optional": true, "description": "The ID of the extension or app to connect to. If omitted, a connection will be attempted with your own extension. Required if sending messages from a web page for $(topic:manifest/externally_connectable)[web messaging]."},
+ {
+ "type": "object",
+ "name": "connectInfo",
+ "properties": {
+ "name": { "type": "string", "optional": true, "description": "Will be passed into onConnect for processes that are listening for the connection event." },
+ "includeTlsChannelId": { "type": "boolean", "optional": true, "description": "Whether the TLS channel ID will be passed into onConnectExternal for processes that are listening for the connection event." }
+ },
+ "optional": true
+ }
+ ],
+ "returns": {
+ "$ref": "Port",
+ "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. "
+ }
+ },
+ {
+ "name": "connectNative",
+ "type": "function",
+ "description": "Connects to a native application in the host machine.",
+ "allowedContexts": ["content"],
+ "permissions": ["nativeMessaging"],
+ "parameters": [
+ {
+ "type": "string",
+ "pattern": "^\\w+(\\.\\w+)*$",
+ "name": "application",
+ "description": "The name of the registered application to connect to."
+ }
+ ],
+ "returns": {
+ "$ref": "Port",
+ "description": "Port through which messages can be sent and received with the application"
+ }
+ },
+ {
+ "name": "sendMessage",
+ "type": "function",
+ "allowAmbiguousOptionalArguments": true,
+ "allowedContexts": ["content", "devtools"],
+ "description": "Sends a single message to event listeners within your extension/app or a different extension/app. Similar to $(ref:runtime.connect) but only sends a single message, with an optional response. If sending to your extension, the $(ref:runtime.onMessage) event will be fired in each page, or $(ref:runtime.onMessageExternal), if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use $(ref:tabs.sendMessage).",
+ "async": "responseCallback",
+ "parameters": [
+ {"type": "string", "name": "extensionId", "optional": true, "description": "The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for $(topic:manifest/externally_connectable)[web messaging]."},
+ { "type": "any", "name": "message" },
+ {
+ "type": "object",
+ "name": "options",
+ "properties": {
+ "includeTlsChannelId": { "type": "boolean", "optional": true, "unsupported": true, "description": "Whether the TLS channel ID will be passed into onMessageExternal for processes that are listening for the connection event." }
+ },
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "responseCallback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "response",
+ "type": "any",
+ "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "sendNativeMessage",
+ "type": "function",
+ "description": "Send a single message to a native application.",
+ "allowedContexts": ["content"],
+ "permissions": ["nativeMessaging"],
+ "async": "responseCallback",
+ "parameters": [
+ {
+ "name": "application",
+ "description": "The name of the native messaging host.",
+ "type": "string",
+ "pattern": "^\\w+(\\.\\w+)*$"
+ },
+ {
+ "name": "message",
+ "description": "The message that will be passed to the native messaging host.",
+ "type": "any"
+ },
+ {
+ "type": "function",
+ "name": "responseCallback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "response",
+ "type": "any",
+ "description": "The response message sent by the native messaging host. If an error occurs while connecting to the native messaging host, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getBrowserInfo",
+ "type": "function",
+ "description": "Returns information about the current browser.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "description": "Called with results",
+ "parameters": [
+ {
+ "name": "browserInfo",
+ "$ref": "BrowserInfo"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getPlatformInfo",
+ "type": "function",
+ "description": "Returns information about the current platform.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "description": "Called with results",
+ "parameters": [
+ {
+ "name": "platformInfo",
+ "$ref": "PlatformInfo"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getPackageDirectoryEntry",
+ "unsupported": true,
+ "type": "function",
+ "description": "Returns a DirectoryEntry for the package directory.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "directoryEntry",
+ "type": "object",
+ "additionalProperties": { "type": "any" },
+ "isInstanceOf": "DirectoryEntry"
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onStartup",
+ "type": "function",
+ "description": "Fired when a profile that has this extension installed first starts up. This event is not fired for incognito profiles."
+ },
+ {
+ "name": "onInstalled",
+ "type": "function",
+ "description": "Fired when the extension is first installed, when the extension is updated to a new version, and when the browser is updated to a new version.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "reason": {
+ "$ref": "OnInstalledReason",
+ "description": "The reason that this event is being dispatched."
+ },
+ "previousVersion": {
+ "type": "string",
+ "optional": true,
+ "description": "Indicates the previous version of the extension, which has just been updated. This is present only if 'reason' is 'update'."
+ },
+ "temporary": {
+ "type": "boolean",
+ "description": "Indicates whether the addon is installed as a temporary extension."
+ },
+ "id": {
+ "type": "string",
+ "optional": true,
+ "unsupported": true,
+ "description": "Indicates the ID of the imported shared module extension which updated. This is present only if 'reason' is 'shared_module_update'."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "onSuspend",
+ "type": "function",
+ "description": "Sent to the event page just before it is unloaded. This gives the extension opportunity to do some clean up. Note that since the page is unloading, any asynchronous operations started while handling this event are not guaranteed to complete. If more activity for the event page occurs before it gets unloaded the onSuspendCanceled event will be sent and the page won't be unloaded. "
+ },
+ {
+ "name": "onSuspendCanceled",
+ "type": "function",
+ "description": "Sent after onSuspend to indicate that the app won't be unloaded after all."
+ },
+ {
+ "name": "onUpdateAvailable",
+ "type": "function",
+ "description": "Fired when an update is available, but isn't installed immediately because the app is currently running. If you do nothing, the update will be installed the next time the background page gets unloaded, if you want it to be installed sooner you can explicitly call $(ref:runtime.reload). If your extension is using a persistent background page, the background page of course never gets unloaded, so unless you call $(ref:runtime.reload) manually in response to this event the update will not get installed until the next time the browser itself restarts. If no handlers are listening for this event, and your extension has a persistent background page, it behaves as if $(ref:runtime.reload) is called in response to this event.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "version": {
+ "type": "string",
+ "description": "The version number of the available update."
+ }
+ },
+ "additionalProperties": { "type": "any" },
+ "description": "The manifest details of the available update."
+ }
+ ]
+ },
+ {
+ "name": "onBrowserUpdateAvailable",
+ "unsupported": true,
+ "type": "function",
+ "description": "Fired when an update for the browser is available, but isn't installed immediately because a browser restart is required.",
+ "deprecated": "Please use $(ref:runtime.onRestartRequired).",
+ "parameters": []
+ },
+ {
+ "name": "onConnect",
+ "type": "function",
+ "allowedContexts": ["content", "devtools"],
+ "description": "Fired when a connection is made from either an extension process or a content script.",
+ "parameters": [
+ {"$ref": "Port", "name": "port"}
+ ]
+ },
+ {
+ "name": "onConnectExternal",
+ "type": "function",
+ "description": "Fired when a connection is made from another extension.",
+ "parameters": [
+ {"$ref": "Port", "name": "port"}
+ ]
+ },
+ {
+ "name": "onMessage",
+ "type": "function",
+ "allowedContexts": ["content", "devtools"],
+ "description": "Fired when a message is sent from either an extension process or a content script.",
+ "parameters": [
+ {"name": "message", "type": "any", "optional": true, "description": "The message sent by the calling script."},
+ {"name": "sender", "$ref": "MessageSender" },
+ {"name": "sendResponse", "type": "function", "description": "Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object. If you have more than one onMessage
listener in the same document, then only one may send a response. This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until sendResponse
is called)." }
+ ],
+ "returns": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Return true from the event listener if you wish to call sendResponse
after the event listener returns."
+ }
+ },
+ {
+ "name": "onMessageExternal",
+ "type": "function",
+ "description": "Fired when a message is sent from another extension/app. Cannot be used in a content script.",
+ "parameters": [
+ {"name": "message", "type": "any", "optional": true, "description": "The message sent by the calling script."},
+ {"name": "sender", "$ref": "MessageSender" },
+ {"name": "sendResponse", "type": "function", "description": "Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object. If you have more than one onMessage
listener in the same document, then only one may send a response. This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until sendResponse
is called)." }
+ ],
+ "returns": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Return true from the event listener if you wish to call sendResponse
after the event listener returns."
+ }
+ },
+ {
+ "name": "onRestartRequired",
+ "unsupported": true,
+ "type": "function",
+ "description": "Fired when an app or the device that it runs on needs to be restarted. The app should close all its windows at its earliest convenient time to let the restart to happen. If the app does nothing, a restart will be enforced after a 24-hour grace period has passed. Currently, this event is only fired for Chrome OS kiosk apps.",
+ "parameters": [
+ {
+ "$ref": "OnRestartRequiredReason",
+ "name": "reason",
+ "description": "The reason that the event is being dispatched."
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/scripting.json b/interfaces/firefox/schemas/scripting.json
new file mode 100644
index 00000000..6181a2f1
--- /dev/null
+++ b/interfaces/firefox/schemas/scripting.json
@@ -0,0 +1,359 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermissionNoPrompt",
+ "choices": [{
+ "type": "string",
+ "enum": ["scripting"]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "scripting",
+ "description": "Use the scripting API to execute script in different contexts.",
+ "permissions": ["scripting"],
+ "types": [
+ {
+ "id": "ScriptInjection",
+ "type": "object",
+ "description": "Details of a script injection",
+ "properties": {
+ "args": {
+ "type": "array",
+ "optional": true,
+ "description": "The arguments to curry into a provided function. This is only valid if the func
parameter is specified. These arguments must be JSON-serializable.",
+ "items": { "type": "any" }
+ },
+ "files": {
+ "type": "array",
+ "optional": true,
+ "description": "The path of the JS files to inject, relative to the extension's root directory. Exactly one of files
and func
must be specified.",
+ "minItems": 1,
+ "items": { "type": "string" }
+ },
+ "func": {
+ "type": "function",
+ "optional": true,
+ "description": "A JavaScript function to inject. This function will be serialized, and then deserialized for injection. This means that any bound parameters and execution context will be lost. Exactly one of files
and func
must be specified."
+ },
+ "target": {
+ "$ref": "InjectionTarget",
+ "description": "Details specifying the target into which to inject the script."
+ },
+ "world": {
+ "$ref": "ExecutionWorld",
+ "optional": true
+ },
+ "injectImmediately": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the injection should be triggered in the target as soon as possible (but not necessarily prior to page load)."
+ }
+ }
+ },
+ {
+ "id": "InjectionResult",
+ "type": "object",
+ "description": "Result of a script injection.",
+ "properties": {
+ "frameId": {
+ "type": "integer",
+ "description": "The frame ID associated with the injection."
+ },
+ "result": {
+ "type": "any",
+ "optional": true,
+ "description": "The result of the script execution."
+ },
+ "error": {
+ "type": "any",
+ "optional": true,
+ "description": "The error property is set when the script execution failed. The value is typically an (Error) object with a message property, but could be any value (including primitives and undefined) if the script threw or rejected with such a value."
+ }
+ }
+ },
+ {
+ "id": "InjectionTarget",
+ "type": "object",
+ "properties": {
+ "frameIds": {
+ "type": "array",
+ "optional": true,
+ "description": "The IDs of specific frames to inject into.",
+ "items": { "type": "number" }
+ },
+ "allFrames": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the script should inject into all frames within the tab. Defaults to false. This must not be true if frameIds
is specified."
+ },
+ "tabId": {
+ "type": "number",
+ "description": "The ID of the tab into which to inject."
+ }
+ }
+ },
+ {
+ "id": "CSSInjection",
+ "type": "object",
+ "properties": {
+ "css": {
+ "type": "string",
+ "optional": true,
+ "description": "A string containing the CSS to inject. Exactly one of files
and css
must be specified."
+ },
+ "files": {
+ "type": "array",
+ "optional": true,
+ "description": "The path of the CSS files to inject, relative to the extension's root directory. Exactly one of files
and css
must be specified.",
+ "minItems": 1,
+ "items": { "type": "string" }
+ },
+ "origin": {
+ "type": "string",
+ "optional": true,
+ "enum": ["USER", "AUTHOR"],
+ "default": "AUTHOR",
+ "description": "The style origin for the injection. Defaults to 'AUTHOR'
."
+ },
+ "target": {
+ "$ref": "InjectionTarget",
+ "description": "Details specifying the target into which to inject the CSS."
+ }
+ }
+ },
+ {
+ "id": "ContentScriptFilter",
+ "type": "object",
+ "properties": {
+ "ids": {
+ "type": "array",
+ "optional": true,
+ "description": "The IDs of specific scripts to retrieve with getRegisteredContentScripts()
or to unregister with unregisterContentScripts()
.",
+ "items": { "type": "string" }
+ }
+ }
+ },
+ {
+ "id": "ExecutionWorld",
+ "type": "string",
+ "enum": ["ISOLATED"],
+ "description": "The JavaScript world for a script to execute within. We currently only support the 'ISOLATED'
world."
+ },
+ {
+ "id": "RegisteredContentScript",
+ "type": "object",
+ "properties": {
+ "allFrames": {
+ "type": "boolean",
+ "optional": true,
+ "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."
+ },
+ "excludeMatches": {
+ "type": "array",
+ "optional": true,
+ "description": "Excludes pages that this content script would otherwise be injected into.",
+ "items": { "type": "string" }
+ },
+ "id": {
+ "type": "string",
+ "description": "The id of the content script, specified in the API call."
+ },
+ "js": {
+ "type": "array",
+ "optional": true,
+ "description": "The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array.",
+ "items": { "$ref": "manifest.ExtensionURL" }
+ },
+ "matches": {
+ "type": "array",
+ "optional": true,
+ "description": "Specifies which pages this content script will be injected into. Must be specified for registerContentScripts()
.",
+ "items": { "type": "string" }
+ },
+ "runAt": {
+ "$ref": "extensionTypes.RunAt",
+ "optional": true,
+ "description": "Specifies when JavaScript files are injected into the web page. The preferred and default value is document_idle
."
+ },
+ "persistAcrossSessions": {
+ "type": "boolean",
+ "optional": true,
+ "default": true,
+ "description": "Specifies if this content script will persist into future sessions. Defaults to true."
+ },
+ "css": {
+ "type": "array",
+ "optional": true,
+ "description": "The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array.",
+ "items": { "$ref": "manifest.ExtensionURL" }
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "executeScript",
+ "type": "function",
+ "description": "Injects a script into a target context. The script will be run at document_idle
.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "injection",
+ "$ref": "ScriptInjection",
+ "description": "The details of the script which to inject."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Invoked upon completion of the injection. The resulting array contains the result of execution for each frame where the injection succeeded.",
+ "parameters": [
+ {
+ "name": "results",
+ "type": "array",
+ "items": { "$ref": "InjectionResult" }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "insertCSS",
+ "type": "function",
+ "description": "Inserts a CSS stylesheet into a target context. If multiple frames are specified, unsuccessful injections are ignored.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "injection",
+ "$ref": "CSSInjection",
+ "description": "The details of the styles to insert."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Invoked upon completion of the injection.",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "removeCSS",
+ "type": "function",
+ "description": "Removes a CSS stylesheet that was previously inserted by this extension from a target context.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "injection",
+ "$ref": "CSSInjection",
+ "description": "The details of the styles to remove. Note that the css
, files
, and origin
properties must exactly match the stylesheet inserted through insertCSS
. Attempting to remove a non-existent stylesheet is a no-op."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Invoked upon completion of the injection.",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "registerContentScripts",
+ "type": "function",
+ "description": "Registers one or more content scripts for this extension.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "scripts",
+ "type": "array",
+ "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.",
+ "items": { "$ref": "RegisteredContentScript" }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Invoked upon completion of the registration.",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "getRegisteredContentScripts",
+ "type": "function",
+ "description": "Returns all dynamically registered content scripts for this extension that match the given filter.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "filter",
+ "$ref": "ContentScriptFilter",
+ "optional": true,
+ "description": "An object to filter the extension's dynamically registered scripts."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "The resulting array contains the registered content scripts.",
+ "parameters": [
+ {
+ "name": "scripts",
+ "type": "array",
+ "items": { "$ref": "RegisteredContentScript" }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "unregisterContentScripts",
+ "type": "function",
+ "description": "Unregisters one or more content scripts for this extension.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "filter",
+ "$ref": "ContentScriptFilter",
+ "optional": true,
+ "description": "If specified, only unregisters dynamic content scripts which match the filter. Otherwise, all of the extension's dynamic content scripts are unregistered."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Invoked upon completion of the unregistration.",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "updateContentScripts",
+ "type": "function",
+ "description": "Updates one or more content scripts for this extension.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "scripts",
+ "type": "array",
+ "description": "Contains a list of scripts to be updated. If there are errors during script parsing/file validation, or if the IDs specified do not already exist, then no scripts are updated.",
+ "items": {
+ "type": "object",
+ "$import": "RegisteredContentScript",
+ "properties": {
+ "persistAcrossSessions": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Specifies if this content script will persist into future sessions."
+ }
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Invoked when scripts have been updated.",
+ "parameters": []
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/sessions.json b/interfaces/firefox/schemas/sessions.json
new file mode 100644
index 00000000..62e307b4
--- /dev/null
+++ b/interfaces/firefox/schemas/sessions.json
@@ -0,0 +1,296 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "sessions"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "sessions",
+ "description": "Use the chrome.sessions
API to query and restore tabs and windows from a browsing session.",
+ "permissions": ["sessions"],
+ "types": [
+ {
+ "id": "Filter",
+ "type": "object",
+ "properties": {
+ "maxResults": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 25,
+ "optional": true,
+ "description": "The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries ($(ref:sessions.MAX_SESSION_RESULTS))."
+ }
+ }
+ },
+ {
+ "id": "Session",
+ "type": "object",
+ "properties": {
+ "lastModified": {"type": "integer", "description": "The time when the window or tab was closed or modified, represented in milliseconds since the epoch."},
+ "tab": {"$ref": "tabs.Tab", "optional": true, "description": "The $(ref:tabs.Tab), if this entry describes a tab. Either this or $(ref:sessions.Session.window) will be set."},
+ "window": {"$ref": "windows.Window", "optional": true, "description": "The $(ref:windows.Window), if this entry describes a window. Either this or $(ref:sessions.Session.tab) will be set."}
+ }
+ },
+ {
+ "id": "Device",
+ "type": "object",
+ "properties": {
+ "info": {"type": "string"},
+ "deviceName": {"type": "string", "description": "The name of the foreign device."},
+ "sessions": {"type": "array", "items": {"$ref": "Session"}, "description": "A list of open window sessions for the foreign device, sorted from most recently to least recently modified session."}
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "forgetClosedTab",
+ "type": "function",
+ "description": "Forget a recently closed tab.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "windowId",
+ "type": "integer",
+ "description": "The windowId of the window to which the recently closed tab to be forgotten belongs."
+ },
+ {
+ "name": "sessionId",
+ "type": "string",
+ "description": "The sessionId (closedId) of the recently closed tab to be forgotten."
+ }
+ ]
+ },
+ {
+ "name": "forgetClosedWindow",
+ "type": "function",
+ "description": "Forget a recently closed window.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "sessionId",
+ "type": "string",
+ "description": "The sessionId (closedId) of the recently closed window to be forgotten."
+ }
+ ]
+ },
+ {
+ "name": "getRecentlyClosed",
+ "type": "function",
+ "description": "Gets the list of recently closed tabs and/or windows.",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "Filter",
+ "name": "filter",
+ "optional": true,
+ "default": {}
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "sessions", "type": "array", "items": { "$ref": "Session" }, "description": "The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index 0
). The entries may contain either tabs or windows."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getDevices",
+ "unsupported": true,
+ "type": "function",
+ "description": "Retrieves all devices with synced sessions.",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "Filter",
+ "name": "filter",
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "devices", "type": "array", "items": { "$ref": "Device" }, "description": "The list of $(ref:sessions.Device) objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. $(ref:tabs.Tab) objects are sorted by recency in the $(ref:windows.Window) of the $(ref:sessions.Session) objects."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "restore",
+ "type": "function",
+ "description": "Reopens a $(ref:windows.Window) or $(ref:tabs.Tab), with an optional callback to run when the entry has been restored.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "sessionId",
+ "optional": true,
+ "description": "The $(ref:windows.Window.sessionId), or $(ref:tabs.Tab.sessionId) to restore. If this parameter is not specified, the most recently closed session is restored."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "Session",
+ "name": "restoredSession",
+ "description": "A $(ref:sessions.Session) containing the restored $(ref:windows.Window) or $(ref:tabs.Tab) object."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setTabValue",
+ "type": "function",
+ "description": "Set a key/value pair on a given tab.",
+ "async": true,
+ "parameters": [
+ {
+ "type": "integer",
+ "minimum": 0,
+ "name": "tabId",
+ "description": "The id of the tab that the key/value pair is being set on."
+ },
+ {
+ "type": "string",
+ "name": "key",
+ "description": "The key which corresponds to the value being set."
+ },
+ {
+ "type": "any",
+ "name": "value",
+ "description": "The value being set."
+ }
+ ]
+ },
+ {
+ "name": "getTabValue",
+ "type": "function",
+ "description": "Retrieve a value that was set for a given key on a given tab.",
+ "async": true,
+ "parameters": [
+ {
+ "type": "integer",
+ "minimum": 0,
+ "name": "tabId",
+ "description": "The id of the tab whose value is being retrieved from."
+ },
+ {
+ "type": "string",
+ "name": "key",
+ "description": "The key which corresponds to the value."
+ }
+ ]
+ },
+ {
+ "name": "removeTabValue",
+ "type": "function",
+ "description": "Remove a key/value pair that was set on a given tab.",
+ "async": true,
+ "parameters": [
+ {
+ "type": "integer",
+ "minimum": 0,
+ "name": "tabId",
+ "description": "The id of the tab whose key/value pair is being removed."
+ },
+ {
+ "type": "string",
+ "name": "key",
+ "description": "The key which corresponds to the value."
+ }
+ ]
+ },
+ {
+ "name": "setWindowValue",
+ "type": "function",
+ "description": "Set a key/value pair on a given window.",
+ "async": true,
+ "parameters": [
+ {
+ "type": "integer",
+ "minimum": -2,
+ "name": "windowId",
+ "description": "The id of the window that the key/value pair is being set on."
+ },
+ {
+ "type": "string",
+ "name": "key",
+ "description": "The key which corresponds to the value being set."
+ },
+ {
+ "type": "any",
+ "name": "value",
+ "description": "The value being set."
+ }
+ ]
+ },
+ {
+ "name": "getWindowValue",
+ "type": "function",
+ "description": "Retrieve a value that was set for a given key on a given window.",
+ "async": true,
+ "parameters": [
+ {
+ "type": "integer",
+ "minimum": -2,
+ "name": "windowId",
+ "description": "The id of the window whose value is being retrieved from."
+ },
+ {
+ "type": "string",
+ "name": "key",
+ "description": "The key which corresponds to the value."
+ }
+ ]
+ },
+ {
+ "name": "removeWindowValue",
+ "type": "function",
+ "description": "Remove a key/value pair that was set on a given window.",
+ "async": true,
+ "parameters": [
+ {
+ "type": "integer",
+ "minimum": -2,
+ "name": "windowId",
+ "description": "The id of the window whose key/value pair is being removed."
+ },
+ {
+ "type": "string",
+ "name": "key",
+ "description": "The key which corresponds to the value."
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onChanged",
+ "description": "Fired when recently closed tabs and/or windows are changed. This event does not monitor synced sessions changes.",
+ "type": "function"
+ }
+ ],
+ "properties": {
+ "MAX_SESSION_RESULTS": {
+ "value": 25,
+ "description": "The maximum number of $(ref:sessions.Session) that will be included in a requested list."
+ }
+ }
+ }
+]
diff --git a/interfaces/firefox/schemas/sidebar_action.json b/interfaces/firefox/schemas/sidebar_action.json
new file mode 100644
index 00000000..4ded2277
--- /dev/null
+++ b/interfaces/firefox/schemas/sidebar_action.json
@@ -0,0 +1,270 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "sidebar_action": {
+ "type": "object",
+ "additionalProperties": { "$ref": "UnrecognizedProperty" },
+ "properties": {
+ "default_title": {
+ "type": "string",
+ "optional": true,
+ "preprocess": "localize"
+ },
+ "default_icon": {
+ "$ref": "IconPath",
+ "optional": true
+ },
+ "browser_style": {
+ "type": "boolean",
+ "optional": true,
+ "default": true
+ },
+ "default_panel": {
+ "type": "string",
+ "format": "strictRelativeUrl",
+ "preprocess": "localize"
+ },
+ "open_at_install": {
+ "type": "boolean",
+ "optional": true,
+ "default": true,
+ "description": "Whether or not the sidebar is opened at install. Default is true
."
+ }
+ },
+ "optional": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "namespace": "sidebarAction",
+ "description": "Use sidebar actions to add a sidebar to Firefox.",
+ "permissions": ["manifest:sidebar_action"],
+ "types": [
+ {
+ "id": "ImageDataType",
+ "type": "object",
+ "isInstanceOf": "ImageData",
+ "additionalProperties": { "type": "any" },
+ "postprocess": "convertImageDataToURL",
+ "description": "Pixel data for an image. Must be an ImageData object (for example, from a canvas
element)."
+ }
+ ],
+ "functions": [
+ {
+ "name": "setTitle",
+ "type": "function",
+ "description": "Sets the title of the sidebar action. This shows up in the tooltip.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "title": {
+ "choices": [
+ {"type": "string"},
+ {"type": "null"}
+ ],
+ "description": "The string the sidebar action should display when moused over."
+ },
+ "tabId": {
+ "type": "integer",
+ "optional": true,
+ "description": "Sets the sidebar title for the tab specified by tabId. Automatically resets when the tab is closed."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "description": "Sets the sidebar title for the window specified by windowId."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "getTitle",
+ "type": "function",
+ "description": "Gets the title of the sidebar action.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "tabId": {
+ "type": "integer",
+ "optional": true,
+ "description": "Specify the tab to get the title from. If no tab nor window is specified, the global title is returned."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "description": "Specify the window to get the title from. If no tab nor window is specified, the global title is returned."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "setIcon",
+ "type": "function",
+ "description": "Sets the icon for the sidebar action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "imageData": {
+ "choices": [
+ { "$ref": "ImageDataType" },
+ {
+ "type": "object",
+ "patternProperties": {
+ "^[1-9]\\d*$": { "$ref": "ImageDataType" }
+ },
+ "additionalProperties": false
+ }
+ ],
+ "optional": true,
+ "description": "Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale
, then image with size scale
* 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'"
+ },
+ "path": {
+ "choices": [
+ { "type": "string" },
+ {
+ "type": "object",
+ "additionalProperties": {"type": "string"}
+ }
+ ],
+ "optional": true,
+ "description": "Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale
, then image with size scale
* 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'"
+ },
+ "tabId": {
+ "type": "integer",
+ "optional": true,
+ "description": "Sets the sidebar icon for the tab specified by tabId. Automatically resets when the tab is closed."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "description": "Sets the sidebar icon for the window specified by windowId."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "setPanel",
+ "type": "function",
+ "description": "Sets the url to the html document to be opened in the sidebar when the user clicks on the sidebar action's icon.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "tabId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": 0,
+ "description": "Sets the sidebar url for the tab specified by tabId. Automatically resets when the tab is closed."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "description": "Sets the sidebar url for the window specified by windowId."
+ },
+ "panel": {
+ "choices": [
+ {"type": "string"},
+ {"type": "null"}
+ ],
+ "description": "The url to the html file to show in a sidebar. If set to the empty string (''), no sidebar is shown."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "getPanel",
+ "type": "function",
+ "description": "Gets the url to the html document set as the panel for this sidebar action.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "tabId": {
+ "type": "integer",
+ "optional": true,
+ "description": "Specify the tab to get the panel from. If no tab nor window is specified, the global panel is returned."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "description": "Specify the window to get the panel from. If no tab nor window is specified, the global panel is returned."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "open",
+ "type": "function",
+ "requireUserInput": true,
+ "description": "Opens the extension sidebar in the active window.",
+ "async": true,
+ "parameters": []
+ },
+ {
+ "name": "close",
+ "type": "function",
+ "requireUserInput": true,
+ "description": "Closes the extension sidebar in the active window if the sidebar belongs to the extension.",
+ "async": true,
+ "parameters": []
+ },
+ {
+ "name": "toggle",
+ "type": "function",
+ "requireUserInput": true,
+ "description": "Toggles the extension sidebar in the active window.",
+ "async": true,
+ "parameters": []
+ },
+ {
+ "name": "isOpen",
+ "type": "function",
+ "description": "Checks whether the sidebar action is open.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "properties": {
+ "windowId": {
+ "type": "integer",
+ "minimum": -2,
+ "optional": true,
+ "description": "Specify the window to get the openness from."
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/storage.json b/interfaces/firefox/schemas/storage.json
new file mode 100644
index 00000000..121dd202
--- /dev/null
+++ b/interfaces/firefox/schemas/storage.json
@@ -0,0 +1,400 @@
+[
+ {
+ "namespace": "storage",
+ "allowedContexts": ["content", "devtools"],
+ "defaultContexts": ["content", "devtools"],
+ "description": "Use the browser.storage
API to store, retrieve, and track changes to user data.",
+ "permissions": ["storage"],
+ "types": [
+ {
+ "id": "StorageChange",
+ "type": "object",
+ "properties": {
+ "oldValue": {
+ "type": "any",
+ "description": "The old value of the item, if there was an old value.",
+ "optional": true
+ },
+ "newValue": {
+ "type": "any",
+ "description": "The new value of the item, if there is a new value.",
+ "optional": true
+ }
+ }
+ },
+ {
+ "id": "StorageArea",
+ "type": "object",
+ "functions": [
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Gets one or more items from storage.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "keys",
+ "choices": [
+ { "type": "string" },
+ { "type": "array", "items": { "type": "string" } },
+ {
+ "type": "object",
+ "description": "Storage items to return in the callback, where the values are replaced with those from storage if they exist.",
+ "additionalProperties": { "type": "any" }
+ }
+ ],
+ "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 null
to get the entire contents of storage.",
+ "optional": true
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Callback with storage items, or on failure (in which case $(ref:runtime.lastError) will be set).",
+ "parameters": [
+ {
+ "name": "items",
+ "type": "object",
+ "additionalProperties": { "type": "any" },
+ "description": "Object with items in their key-value mappings."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getBytesInUse",
+ "unsupported": true,
+ "type": "function",
+ "description": "Gets the amount of space (in bytes) being used by one or more items.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "keys",
+ "choices": [
+ { "type": "string" },
+ { "type": "array", "items": { "type": "string" } }
+ ],
+ "description": "A single key or list of keys to get the total usage for. An empty list will return 0. Pass in null
to get the total usage of all of storage.",
+ "optional": true
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Callback with the amount of space being used by storage, or on failure (in which case $(ref:runtime.lastError) will be set).",
+ "parameters": [
+ {
+ "name": "bytesInUse",
+ "type": "integer",
+ "description": "Amount of space being used in storage, in bytes."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "set",
+ "type": "function",
+ "description": "Sets multiple items.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "items",
+ "type": "object",
+ "additionalProperties": { "type": "any" },
+ "description": "An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected.
Primitive values such as numbers will serialize as expected. Values with a typeof
\"object\"
and \"function\"
will typically serialize to {}
, with the exception of Array
(serializes as expected), Date
, and Regex
(serialize using their String
representation).
"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Callback on success, or on failure (in which case $(ref:runtime.lastError) will be set).",
+ "parameters": [],
+ "optional": true
+ }
+ ]
+ },
+ {
+ "name": "remove",
+ "type": "function",
+ "description": "Removes one or more items from storage.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "keys",
+ "choices": [
+ {"type": "string"},
+ {"type": "array", "items": {"type": "string"}}
+ ],
+ "description": "A single key or a list of keys for items to remove."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Callback on success, or on failure (in which case $(ref:runtime.lastError) will be set).",
+ "parameters": [],
+ "optional": true
+ }
+ ]
+ },
+ {
+ "name": "clear",
+ "type": "function",
+ "description": "Removes all items from storage.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Callback on success, or on failure (in which case $(ref:runtime.lastError) will be set).",
+ "parameters": [],
+ "optional": true
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onChanged",
+ "type": "function",
+ "description": "Fired when one or more items change.",
+ "parameters": [
+ {
+ "name": "changes",
+ "type": "object",
+ "additionalProperties": { "$ref": "StorageChange" },
+ "description": "Object mapping each key that changed to its corresponding $(ref:storage.StorageChange) for that item."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "id": "StorageAreaSync",
+ "type": "object",
+ "functions": [
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Gets one or more items from storage.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "keys",
+ "choices": [
+ { "type": "string" },
+ { "type": "array", "items": { "type": "string" } },
+ {
+ "type": "object",
+ "description": "Storage items to return in the callback, where the values are replaced with those from storage if they exist.",
+ "additionalProperties": { "type": "any" }
+ }
+ ],
+ "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 null
to get the entire contents of storage.",
+ "optional": true
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Callback with storage items, or on failure (in which case $(ref:runtime.lastError) will be set).",
+ "parameters": [
+ {
+ "name": "items",
+ "type": "object",
+ "additionalProperties": { "type": "any" },
+ "description": "Object with items in their key-value mappings."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getBytesInUse",
+ "type": "function",
+ "description": "Gets the amount of space (in bytes) being used by one or more items.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "keys",
+ "choices": [
+ { "type": "string" },
+ { "type": "array", "items": { "type": "string" } }
+ ],
+ "description": "A single key or list of keys to get the total usage for. An empty list will return 0. Pass in null
to get the total usage of all of storage.",
+ "optional": true
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Callback with the amount of space being used by storage, or on failure (in which case $(ref:runtime.lastError) will be set).",
+ "parameters": [
+ {
+ "name": "bytesInUse",
+ "type": "integer",
+ "description": "Amount of space being used in storage, in bytes."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "set",
+ "type": "function",
+ "description": "Sets multiple items.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "items",
+ "type": "object",
+ "additionalProperties": { "type": "any" },
+ "description": "An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected.
Primitive values such as numbers will serialize as expected. Values with a typeof
\"object\"
and \"function\"
will typically serialize to {}
, with the exception of Array
(serializes as expected), Date
, and Regex
(serialize using their String
representation).
"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Callback on success, or on failure (in which case $(ref:runtime.lastError) will be set).",
+ "parameters": [],
+ "optional": true
+ }
+ ]
+ },
+ {
+ "name": "remove",
+ "type": "function",
+ "description": "Removes one or more items from storage.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "keys",
+ "choices": [
+ {"type": "string"},
+ {"type": "array", "items": {"type": "string"}}
+ ],
+ "description": "A single key or a list of keys for items to remove."
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Callback on success, or on failure (in which case $(ref:runtime.lastError) will be set).",
+ "parameters": [],
+ "optional": true
+ }
+ ]
+ },
+ {
+ "name": "clear",
+ "type": "function",
+ "description": "Removes all items from storage.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Callback on success, or on failure (in which case $(ref:runtime.lastError) will be set).",
+ "parameters": [],
+ "optional": true
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onChanged",
+ "type": "function",
+ "description": "Fired when one or more items change.",
+ "parameters": [
+ {
+ "name": "changes",
+ "type": "object",
+ "additionalProperties": { "$ref": "StorageChange" },
+ "description": "Object mapping each key that changed to its corresponding $(ref:storage.StorageChange) for that item."
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onChanged",
+ "type": "function",
+ "description": "Fired when one or more items change.",
+ "parameters": [
+ {
+ "name": "changes",
+ "type": "object",
+ "additionalProperties": { "$ref": "StorageChange" },
+ "description": "Object mapping each key that changed to its corresponding $(ref:storage.StorageChange) for that item."
+ },
+ {
+ "name": "areaName",
+ "type": "string",
+ "description": "The name of the storage area (\"sync\"
, \"local\"
or \"managed\"
) the changes are for."
+ }
+ ]
+ }
+ ],
+ "properties": {
+ "sync": {
+ "$ref": "StorageAreaSync",
+ "description": "Items in the sync
storage area are synced by the browser.",
+ "properties": {
+ "QUOTA_BYTES": {
+ "value": 102400,
+ "description": "The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set $(ref:runtime.lastError)."
+ },
+ "QUOTA_BYTES_PER_ITEM": {
+ "value": 8192,
+ "description": "The maximum size (in bytes) of each individual item in sync storage, as measured by the JSON stringification of its value plus its key length. Updates containing items larger than this limit will fail immediately and set $(ref:runtime.lastError)."
+ },
+ "MAX_ITEMS": {
+ "value": 512,
+ "description": "The maximum number of items that can be stored in sync storage. Updates that would cause this limit to be exceeded will fail immediately and set $(ref:runtime.lastError)."
+ },
+ "MAX_WRITE_OPERATIONS_PER_HOUR": {
+ "value": 1800,
+ "description": "The maximum number of set
, remove
, or clear
operations that can be performed each hour. This is 1 every 2 seconds, a lower ceiling than the short term higher writes-per-minute limit.
Updates that would cause this limit to be exceeded fail immediately and set $(ref:runtime.lastError).
"
+ },
+ "MAX_WRITE_OPERATIONS_PER_MINUTE": {
+ "value": 120,
+ "description": "The maximum number of set
, remove
, or clear
operations that can be performed each minute. This is 2 per second, providing higher throughput than writes-per-hour over a shorter period of time.
Updates that would cause this limit to be exceeded fail immediately and set $(ref:runtime.lastError).
"
+ },
+ "MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE": {
+ "value": 1000000,
+ "deprecated": "The storage.sync API no longer has a sustained write operation quota.",
+ "description": ""
+ }
+ }
+ },
+ "local": {
+ "$ref": "StorageArea",
+ "description": "Items in the local
storage area are local to each machine.",
+ "properties": {
+ "QUOTA_BYTES": {
+ "value": 5242880,
+ "description": "The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage
permission. Updates that would cause this limit to be exceeded fail immediately and set $(ref:runtime.lastError)."
+ }
+ }
+ },
+ "managed": {
+ "$ref": "StorageArea",
+ "description": "Items in the managed
storage area are set by administrators or native applications, and are read-only for the extension; trying to modify this namespace results in an error.",
+ "properties": {
+ "QUOTA_BYTES": {
+ "value": 5242880,
+ "description": "The maximum size (in bytes) of the managed storage JSON manifest file. Files larger than this limit will fail to load."
+ }
+ }
+ },
+ "session": {
+ "allowedContexts": ["devtools"],
+ "$ref": "StorageArea",
+ "description": "Items in the session
storage area are kept in memory, and only until the browser is shut down or restarted.",
+ "properties": {
+ "QUOTA_BYTES": {
+ "value": 10485760,
+ "description": "The maximum size (in bytes) of the StructuredClone serialized session storage."
+ }
+ }
+ }
+ }
+ }
+]
diff --git a/interfaces/firefox/schemas/tabs.json b/interfaces/firefox/schemas/tabs.json
new file mode 100644
index 00000000..f4c1fc26
--- /dev/null
+++ b/interfaces/firefox/schemas/tabs.json
@@ -0,0 +1,1703 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermissionNoPrompt",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "activeTab"
+ ]
+ }]
+ },
+ {
+ "$extend": "OptionalPermission",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "tabs",
+ "tabHide"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "tabs",
+ "description": "Use the browser.tabs
API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser.",
+ "types": [
+ { "id": "MutedInfoReason",
+ "type": "string",
+ "description": "An event that caused a muted state change.",
+ "enum": [
+ {"name": "user", "description": "A user input action has set/overridden the muted state."},
+ {"name": "capture", "description": "Tab capture started, forcing a muted state change."},
+ {"name": "extension", "description": "An extension, identified by the extensionId field, set the muted state."}
+ ]
+ },
+ {
+ "id": "MutedInfo",
+ "type": "object",
+ "description": "Tab muted state and the reason for the last state change.",
+ "properties": {
+ "muted": {
+ "type": "boolean",
+ "description": "Whether the tab is prevented from playing sound (but hasn't necessarily recently produced sound). Equivalent to whether the muted audio indicator is showing."
+ },
+ "reason": {
+ "$ref": "MutedInfoReason",
+ "optional": true,
+ "description": "The reason the tab was muted or unmuted. Not set if the tab's mute state has never been changed."
+ },
+ "extensionId": {
+ "type": "string",
+ "optional": true,
+ "description": "The ID of the extension that changed the muted state. Not set if an extension was not the reason the muted state last changed."
+ }
+ }
+ },
+ {
+ "id": "SharingState",
+ "type": "object",
+ "description": "Tab sharing state for screen, microphone and camera.",
+ "properties": {
+ "screen": {
+ "type": "string",
+ "optional": true,
+ "description": "If the tab is sharing the screen the value will be one of \"Screen\", \"Window\", or \"Application\", or undefined if not screen sharing."
+ },
+ "camera": {
+ "type": "boolean",
+ "description": "True if the tab is using the camera."
+ },
+ "microphone": {
+ "type": "boolean",
+ "description": "True if the tab is using the microphone."
+ }
+ }
+ },
+ {
+ "id": "Tab",
+ "type": "object",
+ "properties": {
+ "id": {"type": "integer", "minimum": -1, "optional": true, "description": "The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a Tab may not be assigned an ID, for example when querying foreign tabs using the $(ref:sessions) API, in which case a session ID may be present. Tab ID can also be set to $(ref:tabs.TAB_ID_NONE) for apps and devtools windows."},
+ "index": {"type": "integer", "minimum": -1, "description": "The zero-based index of the tab within its window."},
+ "windowId": {"type": "integer", "optional": true, "minimum": 0, "description": "The ID of the window the tab is contained within."},
+ "openerTabId": {"type": "integer", "minimum": 0, "optional": true, "description": "The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists."},
+ "highlighted": {"type": "boolean", "description": "Whether the tab is highlighted. Works as an alias of active"},
+ "active": {"type": "boolean", "description": "Whether the tab is active in its window. (Does not necessarily mean the window is focused.)"},
+ "pinned": {"type": "boolean", "description": "Whether the tab is pinned."},
+ "lastAccessed": {"type": "integer", "optional": true, "description": "The last time the tab was accessed as the number of milliseconds since epoch."},
+ "audible": {"type": "boolean", "optional": true, "description": "Whether the tab has produced sound over the past couple of seconds (but it might not be heard if also muted). Equivalent to whether the speaker audio indicator is showing."},
+ "mutedInfo": {"$ref": "MutedInfo", "optional": true, "description": "Current tab muted state and the reason for the last state change."},
+ "url": {"type": "string", "optional": true, "permissions": ["tabs"], "description": "The URL the tab is displaying. This property is only present if the extension's manifest includes the \"tabs\"
permission."},
+ "title": {"type": "string", "optional": true, "permissions": ["tabs"], "description": "The title of the tab. This property is only present if the extension's manifest includes the \"tabs\"
permission."},
+ "favIconUrl": {"type": "string", "optional": true, "permissions": ["tabs"], "description": "The URL of the tab's favicon. This property is only present if the extension's manifest includes the \"tabs\"
permission. It may also be an empty string if the tab is loading."},
+ "status": {"type": "string", "optional": true, "description": "Either loading or complete."},
+ "discarded": {"type": "boolean", "optional": true, "description": "True while the tab is not loaded with content."},
+ "incognito": {"type": "boolean", "description": "Whether the tab is in an incognito window."},
+ "width": {"type": "integer", "optional": true, "description": "The width of the tab in pixels."},
+ "height": {"type": "integer", "optional": true, "description": "The height of the tab in pixels."},
+ "hidden": {"type": "boolean", "optional": true, "description": "True if the tab is hidden."},
+ "sessionId": {"type": "string", "optional": true, "description": "The session ID used to uniquely identify a Tab obtained from the $(ref:sessions) API."},
+ "cookieStoreId": {"type": "string", "optional": true, "description": "The CookieStoreId used for the tab."},
+ "isArticle": {"type": "boolean", "optional": true, "description": "Whether the document in the tab can be rendered in reader mode."},
+ "isInReaderMode": {"type": "boolean", "optional": true, "description": "Whether the document in the tab is being rendered in reader mode."},
+ "sharingState": {"$ref": "SharingState", "optional": true, "description": "Current tab sharing state for screen, microphone and camera."},
+ "attention": {"type": "boolean", "optional": true, "description": "Whether the tab is drawing attention."},
+ "successorTabId": {"type": "integer", "optional": true, "minimum": -1, "description": "The ID of this tab's successor, if any; $(ref:tabs.TAB_ID_NONE) otherwise."}
+ }
+ },
+ {
+ "id": "ZoomSettingsMode",
+ "type": "string",
+ "description": "Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to automatic
.",
+ "enum": [
+ {
+ "name": "automatic",
+ "description": "Zoom changes are handled automatically by the browser."
+ },
+ {
+ "name": "manual",
+ "description": "Overrides the automatic handling of zoom changes. The onZoomChange
event will still be dispatched, and it is the responsibility of the extension to listen for this event and manually scale the page. This mode does not support per-origin
zooming, and will thus ignore the scope
zoom setting and assume per-tab
."
+ },
+ {
+ "name": "disabled",
+ "description": "Disables all zooming in the tab. The tab will revert to the default zoom level, and all attempted zoom changes will be ignored."
+ }
+ ]
+ },
+ {
+ "id": "ZoomSettingsScope",
+ "type": "string",
+ "description": "Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to per-origin
when in automatic
mode, and per-tab
otherwise.",
+ "enum": [
+ {
+ "name": "per-origin",
+ "description": "Zoom changes will persist in the zoomed page's origin, i.e. all other tabs navigated to that same origin will be zoomed as well. Moreover, per-origin
zoom changes are saved with the origin, meaning that when navigating to other pages in the same origin, they will all be zoomed to the same zoom factor. The per-origin
scope is only available in the automatic
mode."
+ },
+ {
+ "name": "per-tab",
+ "description": "Zoom changes only take effect in this tab, and zoom changes in other tabs will not affect the zooming of this tab. Also, per-tab
zoom changes are reset on navigation; navigating a tab will always load pages with their per-origin
zoom factors."
+ }
+ ]
+ },
+ {
+ "id": "ZoomSettings",
+ "type": "object",
+ "description": "Defines how zoom changes in a tab are handled and at what scope.",
+ "properties": {
+ "mode": {
+ "$ref": "ZoomSettingsMode",
+ "description": "Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to automatic
.",
+ "optional": true
+ },
+ "scope": {
+ "$ref": "ZoomSettingsScope",
+ "description": "Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to per-origin
when in automatic
mode, and per-tab
otherwise.",
+ "optional": true
+ },
+ "defaultZoomFactor": {
+ "type": "number",
+ "optional": true,
+ "description": "Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings."
+ }
+ }
+ },
+ {
+ "id": "PageSettings",
+ "type": "object",
+ "description": "Defines the page settings to be used when saving a page as a pdf file.",
+ "properties": {
+ "toFileName": {
+ "type": "string",
+ "optional": true,
+ "description": "The name of the file. May include optional .pdf extension."
+ },
+ "paperSizeUnit": {
+ "type": "integer",
+ "optional": true,
+ "description": "The page size unit: 0 = inches, 1 = millimeters. Default: 0."
+ },
+ "paperWidth": {
+ "type": "number",
+ "optional": true,
+ "description": "The paper width in paper size units. Default: 8.5."
+ },
+ "paperHeight": {
+ "type": "number",
+ "optional": true,
+ "description": "The paper height in paper size units. Default: 11.0."
+ },
+ "orientation": {
+ "type": "integer",
+ "optional": true,
+ "description": "The page content orientation: 0 = portrait, 1 = landscape. Default: 0."
+ },
+ "scaling": {
+ "type": "number",
+ "optional": true,
+ "description": "The page content scaling factor: 1.0 = 100% = normal size. Default: 1.0."
+ },
+ "shrinkToFit": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the page content should shrink to fit the page width (overrides scaling). Default: true."
+ },
+ "showBackgroundColors": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the page background colors should be shown. Default: false."
+ },
+ "showBackgroundImages": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the page background images should be shown. Default: false."
+ },
+ "edgeLeft": {
+ "type": "number",
+ "optional": true,
+ "description": "The spacing between the left header/footer and the left edge of the paper (inches). Default: 0."
+ },
+ "edgeRight": {
+ "type": "number",
+ "optional": true,
+ "description": "The spacing between the right header/footer and the right edge of the paper (inches). Default: 0."
+ },
+ "edgeTop": {
+ "type": "number",
+ "optional": true,
+ "description": "The spacing between the top of the headers and the top edge of the paper (inches). Default: 0"
+ },
+ "edgeBottom": {
+ "type": "number",
+ "optional": true,
+ "description": "The spacing between the bottom of the footers and the bottom edge of the paper (inches). Default: 0."
+ },
+ "marginLeft": {
+ "type": "number",
+ "optional": true,
+ "description": "The margin between the page content and the left edge of the paper (inches). Default: 0.5."
+ },
+ "marginRight": {
+ "type": "number",
+ "optional": true,
+ "description": "The margin between the page content and the right edge of the paper (inches). Default: 0.5."
+ },
+ "marginTop": {
+ "type": "number",
+ "optional": true,
+ "description": "The margin between the page content and the top edge of the paper (inches). Default: 0.5."
+ },
+ "marginBottom": {
+ "type": "number",
+ "optional": true,
+ "description": "The margin between the page content and the bottom edge of the paper (inches). Default: 0.5."
+ },
+ "headerLeft": {
+ "type": "string",
+ "optional": true,
+ "description": "The text for the page's left header. Default: '&T'."
+ },
+ "headerCenter": {
+ "type": "string",
+ "optional": true,
+ "description": "The text for the page's center header. Default: ''."
+ },
+ "headerRight": {
+ "type": "string",
+ "optional": true,
+ "description": "The text for the page's right header. Default: '&U'."
+ },
+ "footerLeft": {
+ "type": "string",
+ "optional": true,
+ "description": "The text for the page's left footer. Default: '&PT'."
+ },
+ "footerCenter": {
+ "type": "string",
+ "optional": true,
+ "description": "The text for the page's center footer. Default: ''."
+ },
+ "footerRight": {
+ "type": "string",
+ "optional": true,
+ "description": "The text for the page's right footer. Default: '&D'."
+ }
+ }
+ },
+ {
+ "id": "TabStatus",
+ "type": "string",
+ "enum": ["loading", "complete"],
+ "description": "Whether the tabs have completed loading."
+ },
+ {
+ "id": "WindowType",
+ "type": "string",
+ "enum": ["normal", "popup", "panel", "app", "devtools"],
+ "description": "The type of window."
+ },
+ {
+ "id": "UpdatePropertyName",
+ "type": "string",
+ "enum": [
+ "attention",
+ "audible",
+ "discarded",
+ "favIconUrl",
+ "hidden",
+ "isArticle",
+ "mutedInfo",
+ "pinned",
+ "sharingState",
+ "status",
+ "title",
+ "url"
+ ],
+ "description": "Event names supported in onUpdated."
+ },
+ {
+ "id": "UpdateFilter",
+ "type": "object",
+ "description": "An object describing filters to apply to tabs.onUpdated events.",
+ "properties": {
+ "urls": {
+ "type": "array",
+ "description": "A list of URLs or URL patterns. Events that cannot match any of the URLs will be filtered out. Filtering with urls requires the \"tabs\"
or \"activeTab\"
permission.",
+ "optional": true,
+ "items": { "type": "string" },
+ "minItems": 1
+ },
+ "properties": {
+ "type": "array",
+ "optional": true,
+ "description": "A list of property names. Events that do not match any of the names will be filtered out.",
+ "items": { "$ref": "UpdatePropertyName" },
+ "minItems": 1
+ },
+ "tabId": { "type": "integer", "optional": true },
+ "windowId": { "type": "integer", "optional": true }
+ }
+ }
+ ],
+ "properties": {
+ "TAB_ID_NONE": {
+ "value": -1,
+ "description": "An ID which represents the absence of a browser tab."
+ }
+ },
+ "functions": [
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Retrieves details about the specified tab.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {"name": "tab", "$ref": "Tab"}
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getCurrent",
+ "type": "function",
+ "description": "Gets the tab that this script call is being made from. May be undefined if called from a non-tab context (for example: a background page or popup view).",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "Tab",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "connect",
+ "type": "function",
+ "description": "Connects to the content script(s) in the specified tab. The $(ref:runtime.onConnect) event is fired in each content script running in the specified tab for the current extension. For more details, see $(topic:messaging)[Content Script Messaging].",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0
+ },
+ {
+ "type": "object",
+ "name": "connectInfo",
+ "properties": {
+ "name": { "type": "string", "optional": true, "description": "Will be passed into onConnect for content scripts that are listening for the connection event." },
+ "frameId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": 0,
+ "description": "Open a port to a specific $(topic:frame_ids)[frame] identified by frameId
instead of all frames in the tab."
+ }
+ },
+ "optional": true
+ }
+ ],
+ "returns": {
+ "$ref": "runtime.Port",
+ "description": "A port that can be used to communicate with the content scripts running in the specified tab. The port's $(ref:runtime.Port) event is fired if the tab closes or does not exist. "
+ }
+ },
+ {
+ "name": "sendMessage",
+ "type": "function",
+ "description": "Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The $(ref:runtime.onMessage) event is fired in each content script running in the specified tab for the current extension.",
+ "async": "responseCallback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0
+ },
+ {
+ "type": "any",
+ "name": "message"
+ },
+ {
+ "type": "object",
+ "name": "options",
+ "properties": {
+ "frameId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": 0,
+ "description": "Send a message to a specific $(topic:frame_ids)[frame] identified by frameId
instead of all frames in the tab."
+ }
+ },
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "responseCallback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "response",
+ "type": "any",
+ "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "create",
+ "type": "function",
+ "description": "Creates a new tab.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "createProperties",
+ "properties": {
+ "windowId": {
+ "type": "integer",
+ "minimum": -2,
+ "optional": true,
+ "description": "The window to create the new tab in. Defaults to the $(topic:current-window)[current window]."
+ },
+ "index": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The position the tab should take in the window. The provided value will be clamped to between zero and the number of tabs in the window."
+ },
+ "url": {
+ "type": "string",
+ "optional": true,
+ "description": "The URL to navigate the tab to initially. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page."
+ },
+ "active": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see $(ref:windows.update)). Defaults to true."
+ },
+ "pinned": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tab should be pinned. Defaults to false"
+ },
+ "openerTabId": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as the newly created tab."
+ },
+ "cookieStoreId": {
+ "type": "string",
+ "optional": true,
+ "description": "The CookieStoreId for the tab that opened this tab."
+ },
+ "openInReaderMode": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the document in the tab should be opened in reader mode."
+ },
+ "discarded": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tab is marked as 'discarded' when created."
+ },
+ "title": {
+ "type": "string",
+ "optional": true,
+ "description": "The title used for display if the tab is created in discarded mode."
+ },
+ "muted": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tab should be muted when created."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "Tab",
+ "optional": true,
+ "description": "Details about the created tab. Will contain the ID of the new tab."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "duplicate",
+ "type": "function",
+ "description": "Duplicates a tab.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "description": "The ID of the tab which is to be duplicated."
+ },
+ {
+ "type": "object",
+ "name": "duplicateProperties",
+ "optional": true,
+ "properties": {
+ "index": {
+ "type": "integer",
+ "optional": true,
+ "description": "The position the new tab should take in the window. The provided value will be clamped to between zero and the number of tabs in the window."
+ },
+ "active": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see $(ref:windows.update)). Defaults to true."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "tab",
+ "optional": true,
+ "description": "Details about the duplicated tab. The $(ref:tabs.Tab) object doesn't contain url
, title
and favIconUrl
if the \"tabs\"
permission has not been requested.",
+ "$ref": "Tab"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "query",
+ "type": "function",
+ "description": "Gets all tabs that have the specified properties, or all tabs if no properties are specified.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "queryInfo",
+ "properties": {
+ "active": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tabs are active in their windows."
+ },
+ "attention": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tabs are drawing attention."
+ },
+ "pinned": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tabs are pinned."
+ },
+ "audible": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tabs are audible."
+ },
+ "muted": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tabs are muted."
+ },
+ "highlighted": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tabs are highlighted. Works as an alias of active."
+ },
+ "currentWindow": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tabs are in the $(topic:current-window)[current window]."
+ },
+ "lastFocusedWindow": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tabs are in the last focused window."
+ },
+ "status": {
+ "$ref": "TabStatus",
+ "optional": true,
+ "description": "Whether the tabs have completed loading."
+ },
+ "discarded": {
+ "type": "boolean",
+ "optional": true,
+ "description": "True while the tabs are not loaded with content."
+ },
+ "hidden": {
+ "type": "boolean",
+ "optional": true,
+ "description": "True while the tabs are hidden."
+ },
+ "title": {
+ "type": "string",
+ "optional": true,
+ "description": "Match page titles against a pattern."
+ },
+ "url": {
+ "choices": [
+ {"type": "string"},
+ {"type": "array", "items": {"type": "string"}}
+ ],
+ "optional": true,
+ "description": "Match tabs against one or more $(topic:match_patterns)[URL patterns]. Note that fragment identifiers are not matched."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "description": "The ID of the parent window, or $(ref:windows.WINDOW_ID_CURRENT) for the $(topic:current-window)[current window]."
+ },
+ "windowType": {
+ "$ref": "WindowType",
+ "optional": true,
+ "description": "The type of window the tabs are in."
+ },
+ "index": {
+ "type": "integer",
+ "optional": true,
+ "minimum": 0,
+ "description": "The position of the tabs within their windows."
+ },
+ "cookieStoreId": {
+ "choices": [
+ {
+ "type": "array",
+ "items": { "type": "string" }
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "optional": true,
+ "description": "The CookieStoreId used for the tab."
+ },
+ "openerTabId": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab."
+ },
+ "screen": {
+ "choices": [
+ {"type": "string", "enum": ["Screen", "Window", "Application"]},
+ {"type": "boolean"}
+ ],
+ "optional": true,
+ "description": "True for any screen sharing, or a string to specify type of screen sharing."
+ },
+ "camera": {
+ "type": "boolean",
+ "optional": true,
+ "description": "True if the tab is using the camera."
+ },
+ "microphone": {
+ "type": "boolean",
+ "optional": true,
+ "description": "True if the tab is using the microphone."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "array",
+ "items": {
+ "$ref": "Tab"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "highlight",
+ "type": "function",
+ "description": "Highlights the given tabs.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "highlightInfo",
+ "properties": {
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "description": "The window that contains the tabs.",
+ "minimum": -2
+ },
+ "populate": {
+ "type": "boolean",
+ "optional": true,
+ "default": true,
+ "description": "If true, the $(ref:windows.Window) returned will have a tabs property that contains a list of the $(ref:tabs.Tab) objects. The Tab
objects only contain the url
, title
and favIconUrl
properties if the extension's manifest file includes the \"tabs\"
permission. If false, the $(ref:windows.Window) won't have the tabs property."
+ },
+ "tabs": {
+ "description": "One or more tab indices to highlight.",
+ "choices": [
+ {"type": "array", "items": {"type": "integer", "minimum": 0}},
+ {"type": "integer"}
+ ]
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "window",
+ "$ref": "windows.Window",
+ "description": "Contains details about the window whose tabs were highlighted."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "update",
+ "type": "function",
+ "description": "Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "Defaults to the selected tab of the $(topic:current-window)[current window]."
+ },
+ {
+ "type": "object",
+ "name": "updateProperties",
+ "properties": {
+ "url": {
+ "type": "string",
+ "optional": true,
+ "description": "A URL to navigate the tab to."
+ },
+ "active": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tab should be active. Does not affect whether the window is focused (see $(ref:windows.update))."
+ },
+ "highlighted": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Adds or removes the tab from the current selection."
+ },
+ "pinned": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tab should be pinned."
+ },
+ "muted": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tab should be muted."
+ },
+ "openerTabId": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab."
+ },
+ "loadReplace": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the load should replace the current history entry for the tab."
+ },
+ "successorTabId": {
+ "type": "integer",
+ "minimum": -1,
+ "optional": true,
+ "description": "The ID of this tab's successor. If specified, the successor tab must be in the same window as this tab."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "Tab",
+ "optional": true,
+ "description": "Details about the updated tab. The $(ref:tabs.Tab) object doesn't contain url
, title
and favIconUrl
if the \"tabs\"
permission has not been requested."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "move",
+ "type": "function",
+ "description": "Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === \"normal\") windows.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "tabIds",
+ "description": "The tab or list of tabs to move.",
+ "choices": [
+ {"type": "integer", "minimum": 0},
+ {"type": "array", "items": {"type": "integer", "minimum": 0}}
+ ]
+ },
+ {
+ "type": "object",
+ "name": "moveProperties",
+ "properties": {
+ "windowId": {
+ "type": "integer",
+ "minimum": -2,
+ "optional": true,
+ "description": "Defaults to the window the tab is currently in."
+ },
+ "index": {
+ "type": "integer",
+ "minimum": -1,
+ "description": "The position to move the window to. -1 will place the tab at the end of the window."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "tabs",
+ "description": "Details about the moved tabs.",
+ "choices": [
+ {"$ref": "Tab"},
+ {"type": "array", "items": {"$ref": "Tab"}}
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "reload",
+ "type": "function",
+ "description": "Reload a tab.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab to reload; defaults to the selected tab of the current window."
+ },
+ {
+ "type": "object",
+ "name": "reloadProperties",
+ "optional": true,
+ "properties": {
+ "bypassCache": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether using any local cache. Default is false."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "warmup",
+ "type": "function",
+ "description": "Warm up a tab",
+ "async": true,
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": false,
+ "description": "The ID of the tab to warm up."
+ }
+ ]
+ },
+ {
+ "name": "remove",
+ "type": "function",
+ "description": "Closes one or more tabs.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "tabIds",
+ "description": "The tab or list of tabs to close.",
+ "choices": [
+ {"type": "integer", "minimum": 0},
+ {"type": "array", "items": {"type": "integer", "minimum": 0}}
+ ]
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "discard",
+ "type": "function",
+ "description": "discards one or more tabs.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "tabIds",
+ "description": "The tab or list of tabs to discard.",
+ "choices": [
+ {"type": "integer", "minimum": 0},
+ {"type": "array", "items": {"type": "integer", "minimum": 0}}
+ ]
+ }
+ ]
+ },
+ {
+ "name": "detectLanguage",
+ "type": "function",
+ "description": "Detects the primary language of the content in a tab.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "Defaults to the active tab of the $(topic:current-window)[current window]."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "language",
+ "description": "An ISO language code such as en
or fr
. For a complete list of languages supported by this method, see kLanguageInfoTable. The 2nd to 4th columns will be checked and the first non-NULL value will be returned except for Simplified Chinese for which zh-CN will be returned. For an unknown language, und
will be returned."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "toggleReaderMode",
+ "type": "function",
+ "description": "Toggles reader mode for the document in the tab.",
+ "async": true,
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "Defaults to the active tab of the $(topic:current-window)[current window]."
+ }
+ ]
+ },
+ {
+ "name": "captureTab",
+ "type": "function",
+ "description": "Captures an area of a specified tab. You must have $(topic:declare_permissions)[<all_urls>] permission to use this method.",
+ "permissions": [""],
+ "async": true,
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "The tab to capture. Defaults to the active tab of the current window."
+ },
+ {
+ "$ref": "extensionTypes.ImageDetails",
+ "name": "options",
+ "optional": true
+ }
+ ]
+ },
+ {
+ "name": "captureVisibleTab",
+ "type": "function",
+ "description": "Captures an area of the currently active tab in the specified window. You must have $(topic:declare_permissions)[<all_urls>] permission to use this method.",
+ "permissions": [""],
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "minimum": -2,
+ "optional": true,
+ "description": "The target window. Defaults to the $(topic:current-window)[current window]."
+ },
+ {
+ "$ref": "extensionTypes.ImageDetails",
+ "name": "options",
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "dataUrl",
+ "description": "A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "executeScript",
+ "type": "function",
+ "max_manifest_version": 2,
+ "description": "Injects JavaScript code into a page. For details, see the $(topic:content_scripts)[programmatic injection] section of the content scripts doc.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab in which to run the script; defaults to the active tab of the current window."
+ },
+ {
+ "$ref": "extensionTypes.InjectDetails",
+ "name": "details",
+ "description": "Details of the script to run."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "description": "Called after all the JavaScript has been executed.",
+ "parameters": [
+ {
+ "name": "result",
+ "optional": true,
+ "type": "array",
+ "items": {"type": "any"},
+ "description": "The result of the script in every injected frame."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "insertCSS",
+ "type": "function",
+ "max_manifest_version": 2,
+ "description": "Injects CSS into a page. For details, see the $(topic:content_scripts)[programmatic injection] section of the content scripts doc.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab in which to insert the CSS; defaults to the active tab of the current window."
+ },
+ {
+ "$ref": "extensionTypes.InjectDetails",
+ "name": "details",
+ "description": "Details of the CSS text to insert."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "description": "Called when all the CSS has been inserted.",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "removeCSS",
+ "type": "function",
+ "max_manifest_version": 2,
+ "description": "Removes injected CSS from a page. For details, see the $(topic:content_scripts)[programmatic injection] section of the content scripts doc.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab from which to remove the injected CSS; defaults to the active tab of the current window."
+ },
+ {
+ "$ref": "extensionTypes.InjectDetails",
+ "name": "details",
+ "description": "Details of the CSS text to remove."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "description": "Called when all the CSS has been removed.",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "setZoom",
+ "type": "function",
+ "description": "Zooms a specified tab.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab to zoom; defaults to the active tab of the current window."
+ },
+ {
+ "type": "number",
+ "name": "zoomFactor",
+ "description": "The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "description": "Called after the zoom factor has been changed.",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "getZoom",
+ "type": "function",
+ "description": "Gets the current zoom factor of a specified tab.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab to get the current zoom factor from; defaults to the active tab of the current window."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "description": "Called with the tab's current zoom factor after it has been fetched.",
+ "parameters": [
+ {
+ "type": "number",
+ "name": "zoomFactor",
+ "description": "The tab's current zoom factor."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setZoomSettings",
+ "type": "function",
+ "description": "Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "optional": true,
+ "minimum": 0,
+ "description": "The ID of the tab to change the zoom settings for; defaults to the active tab of the current window."
+ },
+ {
+ "$ref": "ZoomSettings",
+ "name": "zoomSettings",
+ "description": "Defines how zoom changes are handled and at what scope."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "description": "Called after the zoom settings have been changed.",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "getZoomSettings",
+ "type": "function",
+ "description": "Gets the current zoom settings of a specified tab.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "optional": true,
+ "minimum": 0,
+ "description": "The ID of the tab to get the current zoom settings from; defaults to the active tab of the current window."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "description": "Called with the tab's current zoom settings.",
+ "parameters": [
+ {
+ "$ref": "ZoomSettings",
+ "name": "zoomSettings",
+ "description": "The tab's current zoom settings."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "print",
+ "type": "function",
+ "description": "Prints page in active tab.",
+ "parameters": []
+ },
+ {
+ "name": "printPreview",
+ "type": "function",
+ "description": "Shows print preview for page in active tab.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "description": "Called after print preview entered.",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "saveAsPDF",
+ "type": "function",
+ "description": "Saves page in active tab as a PDF file.",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "PageSettings",
+ "name": "pageSettings",
+ "description": "The page settings used to save the PDF file."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "description": "Called after save as dialog closed.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "status",
+ "description": "Save status: saved, replaced, canceled, not_saved, not_replaced."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "show",
+ "type": "function",
+ "description": "Shows one or more tabs.",
+ "permissions": ["tabHide"],
+ "async": true,
+ "parameters": [
+ {
+ "name": "tabIds",
+ "description": "The TAB ID or list of TAB IDs to show.",
+ "choices": [
+ {"type": "integer", "minimum": 0},
+ {"type": "array", "items": {"type": "integer", "minimum": 0}}
+ ]
+ }
+ ]
+ },
+ {
+ "name": "hide",
+ "type": "function",
+ "description": "Hides one or more tabs. The \"tabHide\"
permission is required to hide tabs. Not all tabs are hidable. Returns an array of hidden tabs.",
+ "permissions": ["tabHide"],
+ "async": true,
+ "parameters": [
+ {
+ "name": "tabIds",
+ "description": "The TAB ID or list of TAB IDs to hide.",
+ "choices": [
+ {"type": "integer", "minimum": 0},
+ {"type": "array", "items": {"type": "integer", "minimum": 0}}
+ ]
+ }
+ ]
+ },
+ {
+ "name": "moveInSuccession",
+ "type": "function",
+ "async": true,
+ "description": "Removes an array of tabs from their lines of succession and prepends or appends them in a chain to another tab.",
+ "parameters": [
+ {
+ "name": "tabIds",
+ "type": "array",
+ "items": { "type": "integer", "minimum": 0 },
+ "minItems": 1,
+ "description": "An array of tab IDs to move in the line of succession. For each tab in the array, the tab's current predecessors will have their successor set to the tab's current successor, and each tab will then be set to be the successor of the previous tab in the array. Any tabs not in the same window as the tab indicated by the second argument (or the first tab in the array, if no second argument) will be skipped."
+ },
+ {
+ "name": "tabId",
+ "type": "integer",
+ "optional": true,
+ "default": -1,
+ "minimum": -1,
+ "description": "The ID of a tab to set as the successor of the last tab in the array, or $(ref:tabs.TAB_ID_NONE) to leave the last tab without a successor. If options.append is true, then this tab is made the predecessor of the first tab in the array instead."
+ },
+ {
+ "name": "options",
+ "type": "object",
+ "optional": true,
+ "properties": {
+ "append": {
+ "type": "boolean",
+ "optional": true,
+ "default": false,
+ "description": "Whether to move the tabs before (false) or after (true) tabId in the succession. Defaults to false."
+ },
+ "insert": {
+ "type": "boolean",
+ "optional": true,
+ "default": false,
+ "description": "Whether to link up the current predecessors or successor (depending on options.append) of tabId to the other side of the chain after it is prepended or appended. If true, one of the following happens: if options.append is false, the first tab in the array is set as the successor of any current predecessors of tabId; if options.append is true, the current successor of tabId is set as the successor of the last tab in the array. Defaults to false."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "goForward",
+ "type": "function",
+ "description": "Navigate to next page in tab's history, if available",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab to navigate forward."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "goBack",
+ "type": "function",
+ "description": "Navigate to previous page in tab's history, if available.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab to navigate backward."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onCreated",
+ "type": "function",
+ "description": "Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.",
+ "parameters": [
+ {
+ "$ref": "Tab",
+ "name": "tab",
+ "description": "Details of the tab that was created."
+ }
+ ]
+ },
+ {
+ "name": "onUpdated",
+ "type": "function",
+ "description": "Fired when a tab is updated.",
+ "parameters": [
+ {"type": "integer", "name": "tabId", "minimum": 0},
+ {
+ "type": "object",
+ "name": "changeInfo",
+ "description": "Lists the changes to the state of the tab that was updated.",
+ "properties": {
+ "attention": {
+ "type": "boolean",
+ "optional": true,
+ "description": "The tab's new attention state."
+ },
+ "audible": {
+ "type": "boolean",
+ "optional": true,
+ "description": "The tab's new audible state."
+ },
+ "discarded": {
+ "type": "boolean",
+ "optional": true,
+ "description": "True while the tab is not loaded with content."
+ },
+ "favIconUrl": {
+ "type": "string",
+ "optional": true,
+ "permissions": ["tabs"],
+ "description": "The tab's new favicon URL. This property is only present if the extension's manifest includes the \"tabs\"
permission."
+ },
+ "hidden": {
+ "type": "boolean",
+ "optional": true,
+ "description": "The tab's new hidden state."
+ },
+ "isArticle": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the document in the tab can be rendered in reader mode."
+ },
+ "mutedInfo": {
+ "$ref": "MutedInfo",
+ "optional": true,
+ "description": "The tab's new muted state and the reason for the change."
+ },
+ "pinned": {
+ "type": "boolean",
+ "optional": true,
+ "description": "The tab's new pinned state."
+ },
+ "sharingState": {
+ "$ref": "SharingState",
+ "optional": true,
+ "description": "The tab's new sharing state for screen, microphone and camera."
+ },
+ "status": {
+ "type": "string",
+ "optional": true,
+ "description": "The status of the tab. Can be either loading or complete."
+ },
+ "title": {
+ "type": "string",
+ "optional": true,
+ "permissions": ["tabs"],
+ "description": "The title of the tab if it has changed. This property is only present if the extension's manifest includes the \"tabs\"
permission."
+ },
+ "url": {
+ "type": "string",
+ "optional": true,
+ "permissions": ["tabs"],
+ "description": "The tab's URL if it has changed. This property is only present if the extension's manifest includes the \"tabs\"
permission."
+ }
+ }
+ },
+ {
+ "$ref": "Tab",
+ "name": "tab",
+ "description": "Gives the state of the tab that was updated."
+ }
+ ],
+ "extraParameters": [
+ {
+ "$ref": "UpdateFilter",
+ "name": "filter",
+ "optional": true,
+ "description": "A set of filters that restricts the events that will be sent to this listener."
+ }
+ ]
+ },
+ {
+ "name": "onMoved",
+ "type": "function",
+ "description": "Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. Move events are not fired for the other tabs that must move in response. This event is not fired when a tab is moved between windows. For that, see $(ref:tabs.onDetached).",
+ "parameters": [
+ {"type": "integer", "name": "tabId", "minimum": 0},
+ {
+ "type": "object",
+ "name": "moveInfo",
+ "properties": {
+ "windowId": {"type": "integer", "minimum": 0},
+ "fromIndex": {"type": "integer", "minimum": 0},
+ "toIndex": {"type": "integer", "minimum": 0}
+ }
+ }
+ ]
+ },
+ {
+ "name": "onActivated",
+ "type": "function",
+ "description": "Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "activeInfo",
+ "properties": {
+ "tabId": {
+ "type": "integer",
+ "minimum": 0,
+ "description": "The ID of the tab that has become active."
+ },
+ "previousTabId": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab that was previously active, if that tab is still open."
+ },
+ "windowId": {
+ "type": "integer",
+ "minimum": 0,
+ "description": "The ID of the window the active tab changed inside of."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "onHighlighted",
+ "type": "function",
+ "description": "Fired when the highlighted or selected tabs in a window changes.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "highlightInfo",
+ "properties": {
+ "windowId": {
+ "type": "integer",
+ "minimum": 0,
+ "description": "The window whose tabs changed."
+ },
+ "tabIds": {
+ "type": "array",
+ "items": {"type": "integer", "minimum": 0},
+ "description": "All highlighted tabs in the window."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "onDetached",
+ "type": "function",
+ "description": "Fired when a tab is detached from a window, for example because it is being moved between windows.",
+ "parameters": [
+ {"type": "integer", "name": "tabId", "minimum": 0},
+ {
+ "type": "object",
+ "name": "detachInfo",
+ "properties": {
+ "oldWindowId": {"type": "integer", "minimum": 0},
+ "oldPosition": {"type": "integer", "minimum": 0}
+ }
+ }
+ ]
+ },
+ {
+ "name": "onAttached",
+ "type": "function",
+ "description": "Fired when a tab is attached to a window, for example because it was moved between windows.",
+ "parameters": [
+ {"type": "integer", "name": "tabId", "minimum": 0},
+ {
+ "type": "object",
+ "name": "attachInfo",
+ "properties": {
+ "newWindowId": {"type": "integer", "minimum": 0},
+ "newPosition": {"type": "integer", "minimum": 0}
+ }
+ }
+ ]
+ },
+ {
+ "name": "onRemoved",
+ "type": "function",
+ "description": "Fired when a tab is closed.",
+ "parameters": [
+ {"type": "integer", "name": "tabId", "minimum": 0},
+ {
+ "type": "object",
+ "name": "removeInfo",
+ "properties": {
+ "windowId": {"type": "integer", "minimum": 0, "description": "The window whose tab is closed." },
+ "isWindowClosing": {"type": "boolean", "description": "True when the tab is being closed because its window is being closed." }
+ }
+ }
+ ]
+ },
+ {
+ "name": "onReplaced",
+ "type": "function",
+ "description": "Fired when a tab is replaced with another tab due to prerendering or instant.",
+ "parameters": [
+ {"type": "integer", "name": "addedTabId", "minimum": 0},
+ {"type": "integer", "name": "removedTabId", "minimum": 0}
+ ]
+ },
+ {
+ "name": "onZoomChange",
+ "type": "function",
+ "description": "Fired when a tab is zoomed.",
+ "parameters": [{
+ "type": "object",
+ "name": "ZoomChangeInfo",
+ "properties": {
+ "tabId": {"type": "integer", "minimum": 0},
+ "oldZoomFactor": {"type": "number"},
+ "newZoomFactor": {"type": "number"},
+ "zoomSettings": {"$ref": "ZoomSettings"}
+ }
+ }]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/test.json b/interfaces/firefox/schemas/test.json
new file mode 100644
index 00000000..7fe24c45
--- /dev/null
+++ b/interfaces/firefox/schemas/test.json
@@ -0,0 +1,217 @@
+[
+ {
+ "namespace": "test",
+ "allowedContexts": ["content", "devtools"],
+ "defaultContexts": ["content", "devtools"],
+ "description": "none",
+ "functions": [
+ {
+ "name": "withHandlingUserInput",
+ "type": "function",
+ "description": "Calls the callback function wrapped with user input set. This is only used for internal unit testing.",
+ "parameters": [
+ {"type": "function", "name": "callback"}
+ ]
+ },
+ {
+ "name": "notifyFail",
+ "type": "function",
+ "description": "Notifies the browser process that test code running in the extension failed. This is only used for internal unit testing.",
+ "parameters": [
+ {"type": "string", "name": "message"}
+ ]
+ },
+ {
+ "name": "notifyPass",
+ "type": "function",
+ "description": "Notifies the browser process that test code running in the extension passed. This is only used for internal unit testing.",
+ "parameters": [
+ {"type": "string", "name": "message", "optional": true}
+ ]
+ },
+ {
+ "name": "log",
+ "type": "function",
+ "description": "Logs a message during internal unit testing.",
+ "parameters": [
+ {"type": "string", "name": "message"}
+ ]
+ },
+ {
+ "name": "sendMessage",
+ "type": "function",
+ "description": "Sends a string message to the browser process, generating a Notification that C++ test code can wait for.",
+ "allowAmbiguousOptionalArguments": true,
+ "parameters": [
+ {"type": "any", "name": "arg1", "optional": true},
+ {"type": "any", "name": "arg2", "optional": true}
+ ]
+ },
+ {
+ "name": "fail",
+ "type": "function",
+ "parameters": [
+ {"type": "any", "name": "message", "optional": true}
+ ]
+ },
+ {
+ "name": "succeed",
+ "type": "function",
+ "parameters": [
+ {"type": "any", "name": "message", "optional": true}
+ ]
+ },
+ {
+ "name": "assertTrue",
+ "type": "function",
+ "allowAmbiguousOptionalArguments": true,
+ "parameters": [
+ {"name": "test", "type": "any", "optional": true},
+ {"type": "string", "name": "message", "optional": true}
+ ]
+ },
+ {
+ "name": "assertFalse",
+ "type": "function",
+ "allowAmbiguousOptionalArguments": true,
+ "parameters": [
+ {"name": "test", "type": "any", "optional": true},
+ {"type": "string", "name": "message", "optional": true}
+ ]
+ },
+ {
+ "name": "assertBool",
+ "type": "function",
+ "unsupported": true,
+ "parameters": [
+ {
+ "name": "test",
+ "choices": [
+ {"type": "string"},
+ {"type": "boolean"}
+ ]
+ },
+ {"type": "boolean", "name": "expected"},
+ {"type": "string", "name": "message", "optional": true}
+ ]
+ },
+ {
+ "name": "assertDeepEq",
+ "type": "function",
+ "allowAmbiguousOptionalArguments": true,
+ "parameters": [
+ {"type": "any", "name": "expected"},
+ {"type": "any", "name": "actual"},
+ {"type": "string", "name": "message", "optional": true}
+ ]
+ },
+ {
+ "name": "assertEq",
+ "type": "function",
+ "allowAmbiguousOptionalArguments": true,
+ "parameters": [
+ {"type": "any", "name": "expected", "optional": true},
+ {"type": "any", "name": "actual", "optional": true},
+ {"type": "string", "name": "message", "optional": true}
+ ]
+ },
+ {
+ "name": "assertNoLastError",
+ "type": "function",
+ "unsupported": true,
+ "parameters": []
+ },
+ {
+ "name": "assertLastError",
+ "type": "function",
+ "unsupported": true,
+ "parameters": [
+ {"type": "string", "name": "expectedError"}
+ ]
+ },
+ {
+ "name": "assertRejects",
+ "type": "function",
+ "async": true,
+ "parameters": [
+ {
+ "name": "promise",
+ "$ref": "Promise"
+ },
+ {
+ "name": "expectedError",
+ "$ref": "ExpectedError"
+ },
+ {
+ "name": "message",
+ "type": "string",
+ "optional": true
+ }
+ ]
+ },
+ {
+ "name": "assertThrows",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "func",
+ "type": "function"
+ },
+ {
+ "name": "expectedError",
+ "$ref": "ExpectedError"
+ },
+ {
+ "name": "message",
+ "type": "string",
+ "optional": true
+ }
+ ]
+ }
+ ],
+ "types": [
+ {
+ "id": "ExpectedError",
+ "choices": [
+ {"type": "string"},
+ {"type": "object", "isInstanceOf": "RegExp", "additionalProperties": true},
+ {"type": "function"}
+ ]
+ },
+ {
+ "id": "Promise",
+ "choices": [
+ {
+ "type": "object",
+ "properties": {
+ "then": {"type": "function"}
+ },
+ "additionalProperties": true
+ },
+ {
+ "type": "object",
+ "isInstanceOf": "Promise",
+ "additionalProperties": true
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onMessage",
+ "type": "function",
+ "description": "Used to test sending messages to extensions.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "message"
+ },
+ {
+ "type": "any",
+ "name": "argument"
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/theme.json b/interfaces/firefox/schemas/theme.json
new file mode 100644
index 00000000..8ffdf70d
--- /dev/null
+++ b/interfaces/firefox/schemas/theme.json
@@ -0,0 +1,447 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "PermissionNoPrompt",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "theme"
+ ]
+ }]
+ },
+ {
+ "id": "ThemeColor",
+ "choices": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "minItems": 3,
+ "maxItems": 3,
+ "items": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 255
+ }
+ },
+ {
+ "type": "array",
+ "minItems": 4,
+ "maxItems": 4,
+ "items": {
+ "type": "number"
+ }
+ }
+ ]
+ },
+ {
+ "id": "ThemeExperiment",
+ "type": "object",
+ "properties": {
+ "stylesheet": {
+ "optional": true,
+ "$ref": "ExtensionURL"
+ },
+ "images": {
+ "type": "object",
+ "optional": true,
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "colors": {
+ "type": "object",
+ "optional": true,
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "properties": {
+ "type": "object",
+ "optional": true,
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": "ThemeType",
+ "type": "object",
+ "properties": {
+ "images": {
+ "type": "object",
+ "optional": true,
+ "properties": {
+ "additional_backgrounds": {
+ "type": "array",
+ "items": { "$ref": "ImageDataOrExtensionURL" },
+ "maxItems": 15,
+ "optional": true
+ },
+ "headerURL": {
+ "$ref": "ImageDataOrExtensionURL",
+ "optional": true,
+ "deprecated": "Unsupported images property, use 'theme.images.theme_frame', this alias is ignored in Firefox >= 70."
+ },
+ "theme_frame": {
+ "$ref": "ImageDataOrExtensionURL",
+ "optional": true
+ }
+ },
+ "additionalProperties": { "$ref": "ImageDataOrExtensionURL" }
+ },
+ "colors": {
+ "type": "object",
+ "optional": true,
+ "properties": {
+ "tab_selected": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "accentcolor": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "deprecated": "Unsupported colors property, use 'theme.colors.frame', this alias is ignored in Firefox >= 70."
+ },
+ "frame": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "frame_inactive": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "textcolor": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "deprecated": "Unsupported color property, use 'theme.colors.tab_background_text', this alias is ignored in Firefox >= 70."
+ },
+ "tab_background_text": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "tab_background_separator": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "tab_loading": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "tab_text": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "tab_line": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "toolbar": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "toolbar_text": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "This color property is an alias of 'bookmark_text'."
+ },
+ "bookmark_text": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "toolbar_field": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "toolbar_field_text": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "toolbar_field_border": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "toolbar_field_separator": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "deprecated": "This color property is ignored in Firefox >= 89."
+ },
+ "toolbar_top_separator": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "toolbar_bottom_separator": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "toolbar_vertical_separator": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "icons": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "icons_attention": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "button_background_hover": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "button_background_active": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "popup": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "popup_text": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "popup_border": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "toolbar_field_focus": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "toolbar_field_text_focus": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "toolbar_field_border_focus": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "popup_highlight": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "popup_highlight_text": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "ntp_background": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "ntp_card_background": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "ntp_text": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "sidebar": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "sidebar_border": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "sidebar_text": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "sidebar_highlight": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "sidebar_highlight_text": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "toolbar_field_highlight": {
+ "$ref": "ThemeColor",
+ "optional": true
+ },
+ "toolbar_field_highlight_text": {
+ "$ref": "ThemeColor",
+ "optional": true
+ }
+ },
+ "additionalProperties": { "$ref": "ThemeColor" }
+ },
+ "properties": {
+ "type": "object",
+ "optional": true,
+ "properties": {
+ "additional_backgrounds_alignment": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "bottom", "center", "left", "right", "top",
+ "center bottom", "center center", "center top",
+ "left bottom", "left center", "left top",
+ "right bottom", "right center", "right top"
+ ]
+ },
+ "maxItems": 15,
+ "optional": true
+ },
+ "additional_backgrounds_tiling": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["no-repeat", "repeat", "repeat-x", "repeat-y"]
+ },
+ "maxItems": 15,
+ "optional": true
+ },
+ "color_scheme": {
+ "optional": true,
+ "type": "string",
+ "enum": ["auto", "light", "dark", "system"]
+ },
+ "content_color_scheme": {
+ "optional": true,
+ "type": "string",
+ "enum": ["auto", "light", "dark", "system"]
+ }
+ },
+ "additionalProperties": { "type": "string" }
+ }
+ },
+ "additionalProperties": { "$ref": "UnrecognizedProperty" }
+ },
+ {
+ "id": "ThemeManifest",
+ "type": "object",
+ "description": "Contents of manifest.json for a static theme",
+ "$import": "manifest.ManifestBase",
+ "properties": {
+ "theme": {
+ "$ref": "ThemeType"
+ },
+ "dark_theme": {
+ "$ref": "ThemeType",
+ "optional": true
+ },
+ "default_locale": {
+ "type": "string",
+ "optional": true
+ },
+ "theme_experiment": {
+ "$ref": "ThemeExperiment",
+ "optional": true
+ },
+ "icons": {
+ "type": "object",
+ "optional": true,
+ "patternProperties": {
+ "^[1-9]\\d*$": { "type": "string" }
+ }
+ }
+ }
+ },
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "theme_experiment": {
+ "$ref": "ThemeExperiment",
+ "optional": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "namespace": "theme",
+ "description": "The theme API allows customizing of visual elements of the browser.",
+ "types": [
+ {
+ "id": "ThemeUpdateInfo",
+ "type": "object",
+ "description": "Info provided in the onUpdated listener.",
+ "properties": {
+ "theme": {
+ "type": "object",
+ "description": "The new theme after update"
+ },
+ "windowId": {
+ "type": "integer",
+ "description": "The id of the window the theme has been applied to",
+ "optional": true
+ }
+ }
+ }
+ ],
+ "events": [
+ {
+ "name": "onUpdated",
+ "type": "function",
+ "description": "Fired when a new theme has been applied",
+ "parameters": [
+ {
+ "$ref": "ThemeUpdateInfo",
+ "name": "updateInfo",
+ "description": "Details of the theme update"
+ }
+ ]
+ }
+ ],
+ "functions": [
+ {
+ "name": "getCurrent",
+ "type": "function",
+ "async": true,
+ "description": "Returns the current theme for the specified window or the last focused window.",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "optional": true,
+ "description": "The window for which we want the theme."
+ }
+ ]
+ },
+ {
+ "name": "update",
+ "type": "function",
+ "async": true,
+ "description": "Make complete updates to the theme. Resolves when the update has completed.",
+ "permissions": ["theme"],
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "optional": true,
+ "description": "The id of the window to update. No id updates all windows."
+ },
+ {
+ "name": "details",
+ "$ref": "manifest.ThemeType",
+ "description": "The properties of the theme to update."
+ }
+ ]
+ },
+ {
+ "name": "reset",
+ "type": "function",
+ "async": true,
+ "description": "Removes the updates made to the theme.",
+ "permissions": ["theme"],
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "optional": true,
+ "description": "The id of the window to reset. No id resets all windows."
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/top_sites.json b/interfaces/firefox/schemas/top_sites.json
new file mode 100644
index 00000000..a6b976cf
--- /dev/null
+++ b/interfaces/firefox/schemas/top_sites.json
@@ -0,0 +1,136 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "topSites"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "topSites",
+ "description": "Use the chrome.topSites API to access the top sites that are displayed on the new tab page. ",
+ "permissions": ["topSites"],
+ "types": [
+ {
+ "id": "MostVisitedURL",
+ "type": "object",
+ "description": "An object encapsulating a most visited URL, such as the URLs on the new tab page.",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "The most visited URL."
+ },
+ "title": {
+ "type": "string",
+ "optional": true,
+ "description": "The title of the page."
+ },
+ "favicon": {
+ "type": "string",
+ "optional": true,
+ "description": "Data URL for the favicon, if available."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "url",
+ "search"
+ ],
+ "optional": true,
+ "default": "url",
+ "description": "The entry type, either url
for a normal page link, or search
for a search shortcut."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Gets a list of top sites.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "options",
+ "properties": {
+ "providers": {
+ "type": "array",
+ "items": { "type": "string" },
+ "deprecated": "Please use the other options to tune the results received from topSites.",
+ "default": [],
+ "optional": true
+ },
+ "limit": {
+ "type": "integer",
+ "default": 12,
+ "maximum": 100,
+ "minimum": 1,
+ "optional": true,
+ "description": "The number of top sites to return, defaults to the value used by Firefox"
+ },
+ "onePerDomain": {
+ "type": "boolean",
+ "default": true,
+ "optional": true,
+ "description": "Limit the result to a single top site link per domain"
+ },
+ "includeBlocked": {
+ "type": "boolean",
+ "default": false,
+ "optional": true,
+ "description": "Include sites that the user has blocked from appearing on the Firefox new tab."
+ },
+ "includeFavicon": {
+ "type": "boolean",
+ "default": false,
+ "optional": true,
+ "description": "Include sites favicon if available."
+ },
+ "includePinned": {
+ "type": "boolean",
+ "default": false,
+ "optional": true,
+ "description": "Include sites that the user has pinned on the Firefox new tab."
+ },
+ "includeSearchShortcuts": {
+ "type": "boolean",
+ "default": false,
+ "optional": true,
+ "description": "Include search shortcuts appearing on the Firefox new tab."
+ },
+ "newtab": {
+ "type": "boolean",
+ "default": false,
+ "optional": true,
+ "description": "Return the sites that exactly appear on the user's new-tab page. When true, all other options are ignored except limit and includeFavicon. If the user disabled newtab Top Sites, the newtab parameter will be ignored."
+ }
+ },
+ "default": {},
+ "optional": true
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "results",
+ "type": "array",
+ "items": {
+ "$ref": "MostVisitedURL"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/types.json b/interfaces/firefox/schemas/types.json
new file mode 100644
index 00000000..d7247f9a
--- /dev/null
+++ b/interfaces/firefox/schemas/types.json
@@ -0,0 +1,158 @@
+[
+ {
+ "namespace": "types",
+ "description": "Contains types used by other schemas.",
+ "types": [
+ {
+ "id": "SettingScope",
+ "type": "string",
+ "enum": ["regular", "regular_only", "incognito_persistent", "incognito_session_only"],
+ "description": "The scope of the Setting. One of- regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),
- regular_only: setting for the regular profile only (not inherited by the incognito profile),
- incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences),
- incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences).
Only regular is supported by Firefox at this time."
+ },
+ {
+ "id": "LevelOfControl",
+ "type": "string",
+ "enum": ["not_controllable", "controlled_by_other_extensions", "controllable_by_this_extension", "controlled_by_this_extension"],
+ "description": "One of- not_controllable: cannot be controlled by any extension
- controlled_by_other_extensions: controlled by extensions with higher precedence
- controllable_by_this_extension: can be controlled by this extension
- controlled_by_this_extension: controlled by this extension
"
+ },
+ {
+ "id": "Setting",
+ "type": "object",
+ "functions": [
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Gets the value of a setting.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "description": "Which setting to consider.",
+ "properties": {
+ "incognito": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether to return the value that applies to the incognito session (default false)."
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "description": "Details of the currently effective value.",
+ "properties": {
+ "value": {
+ "description": "The value of the setting.",
+ "type": "any"
+ },
+ "levelOfControl": {
+ "$ref": "types.LevelOfControl",
+ "description": "The level of control of the setting."
+ },
+ "incognitoSpecific": {
+ "description": "Whether the effective value is specific to the incognito session.
This property will only be present if the incognito property in the details parameter of get()
was true.",
+ "type": "boolean",
+ "optional": true
+ }
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "set",
+ "type": "function",
+ "description": "Sets the value of a setting.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "description": "Which setting to change.",
+ "properties": {
+ "value": {
+ "description": "The value of the setting.
Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type.",
+ "type": "any"
+ },
+ "scope": {
+ "$ref": "types.SettingScope",
+ "optional": true,
+ "description": "Where to set the setting (default: regular)."
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called at the completion of the set operation.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "clear",
+ "type": "function",
+ "description": "Clears the setting, restoring any default value.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "description": "Which setting to clear.",
+ "properties": {
+ "scope": {
+ "$ref": "types.SettingScope",
+ "optional": true,
+ "description": "Where to clear the setting (default: regular)."
+ }
+ }
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called at the completion of the clear operation.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onChange",
+ "type": "function",
+ "description": "Fired after the setting changes.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "value": {
+ "description": "The value of the setting after the change.",
+ "type": "any"
+ },
+ "levelOfControl": {
+ "$ref": "types.LevelOfControl",
+ "description": "The level of control of the setting."
+ },
+ "incognitoSpecific": {
+ "description": "Whether the value that has changed is specific to the incognito session.
This property will only be present if the user has enabled the extension in incognito mode.",
+ "type": "boolean",
+ "optional": true
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/url_overrides.json b/interfaces/firefox/schemas/url_overrides.json
new file mode 100644
index 00000000..c4bc0ab4
--- /dev/null
+++ b/interfaces/firefox/schemas/url_overrides.json
@@ -0,0 +1,35 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "chrome_url_overrides": {
+ "type": "object",
+ "optional": true,
+ "properties": {
+ "newtab": {
+ "$ref": "ExtensionURL",
+ "optional": true,
+ "preprocess": "localize"
+ },
+ "bookmarks": {
+ "unsupported": true,
+ "$ref": "ExtensionURL",
+ "optional": true,
+ "preprocess": "localize"
+ },
+ "history": {
+ "unsupported": true,
+ "$ref": "ExtensionURL",
+ "optional": true,
+ "preprocess": "localize"
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/interfaces/firefox/schemas/web_navigation.json b/interfaces/firefox/schemas/web_navigation.json
new file mode 100644
index 00000000..4d968882
--- /dev/null
+++ b/interfaces/firefox/schemas/web_navigation.json
@@ -0,0 +1,394 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "webNavigation"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "webNavigation",
+ "description": "Use the browser.webNavigation
API to receive notifications about the status of navigation requests in-flight.",
+ "permissions": ["webNavigation"],
+ "types": [
+ {
+ "id": "TransitionType",
+ "type": "string",
+ "enum": ["link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", "keyword_generated"],
+ "description": "Cause of the navigation. The same transition types as defined in the history API are used. These are the same transition types as defined in the $(topic:transition_types)[history API] except with \"start_page\"
in place of \"auto_toplevel\"
(for backwards compatibility)."
+ },
+ {
+ "id": "TransitionQualifier",
+ "type": "string",
+ "enum": ["client_redirect", "server_redirect", "forward_back", "from_address_bar"]
+ },
+ {
+ "id": "EventUrlFilters",
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "array",
+ "minItems": 1,
+ "items": { "$ref": "events.UrlFilter" }
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "getFrame",
+ "type": "function",
+ "description": "Retrieves information about the given frame. A frame refers to an <iframe> or a <frame> of a web page and is identified by a tab ID and a frame ID.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "description": "Information about the frame to retrieve information about.",
+ "properties": {
+ "tabId": { "type": "integer", "minimum": 0, "description": "The ID of the tab in which the frame is." },
+ "processId": {"optional": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
+ "frameId": { "type": "integer", "minimum": 0, "description": "The ID of the frame in the given tab." }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "optional": true,
+ "description": "Information about the requested frame, null if the specified frame ID and/or tab ID are invalid.",
+ "properties": {
+ "errorOccurred": {
+ "optional": true,
+ "type": "boolean",
+ "description": "True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired."
+ },
+ "url": {
+ "type": "string",
+ "description": "The URL currently associated with this frame, if the frame identified by the frameId existed at one point in the given tab. The fact that an URL is associated with a given frameId does not imply that the corresponding frame still exists."
+ },
+ "tabId": {
+ "type": "integer",
+ "description": "The ID of the tab in which the frame is."
+ },
+ "frameId": {
+ "type": "integer",
+ "description": "The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe."
+ },
+ "parentFrameId": {
+ "type": "integer",
+ "description": "ID of frame that wraps the frame. Set to -1 of no parent frame exists."
+ }
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getAllFrames",
+ "type": "function",
+ "description": "Retrieves information about all frames of a given tab.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "description": "Information about the tab to retrieve all frames from.",
+ "properties": {
+ "tabId": { "type": "integer", "minimum": 0, "description": "The ID of the tab." }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "array",
+ "description": "A list of frames in the given tab, null if the specified tab ID is invalid.",
+ "optional": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "errorOccurred": {
+ "optional": true,
+ "type": "boolean",
+ "description": "True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired."
+ },
+ "processId": {
+ "unsupported": true,
+ "type": "integer",
+ "description": "The ID of the process runs the renderer for this tab."
+ },
+ "tabId": {
+ "type": "integer",
+ "description": "The ID of the tab in which the frame is."
+ },
+ "frameId": {
+ "type": "integer",
+ "description": "The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe."
+ },
+ "parentFrameId": {
+ "type": "integer",
+ "description": "ID of frame that wraps the frame. Set to -1 of no parent frame exists."
+ },
+ "url": {
+ "type": "string",
+ "description": "The URL currently associated with this frame."
+ }
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onBeforeNavigate",
+ "type": "function",
+ "description": "Fired when a navigation is about to occur.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation is about to occur."},
+ "url": {"type": "string"},
+ "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
+ "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique for a given tab and process."},
+ "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame. Set to -1 of no parent frame exists."},
+ "timeStamp": {"type": "number", "description": "The time when the browser was about to start the navigation, in milliseconds since the epoch."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "name": "filters",
+ "optional": true,
+ "$ref": "EventUrlFilters",
+ "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
+ }
+ ]
+ },
+ {
+ "name": "onCommitted",
+ "type": "function",
+ "description": "Fired when a navigation is committed. The document (and the resources it refers to, such as images and subframes) might still be downloading, but at least part of the document has been received from the server and the browser has decided to switch to the new document.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
+ "url": {"type": "string"},
+ "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
+ "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
+ "transitionType": {"unsupported": true, "$ref": "TransitionType", "description": "Cause of the navigation."},
+ "transitionQualifiers": {"unsupported": true, "type": "array", "description": "A list of transition qualifiers.", "items": {"$ref": "TransitionQualifier"}},
+ "timeStamp": {"type": "number", "description": "The time when the navigation was committed, in milliseconds since the epoch."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "name": "filters",
+ "optional": true,
+ "$ref": "EventUrlFilters",
+ "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
+ }
+ ]
+ },
+ {
+ "name": "onDOMContentLoaded",
+ "type": "function",
+ "description": "Fired when the page's DOM is fully constructed, but the referenced resources may not finish loading.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
+ "url": {"type": "string"},
+ "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
+ "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
+ "timeStamp": {"type": "number", "description": "The time when the page's DOM was fully constructed, in milliseconds since the epoch."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "name": "filters",
+ "optional": true,
+ "$ref": "EventUrlFilters",
+ "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
+ }
+ ]
+ },
+ {
+ "name": "onCompleted",
+ "type": "function",
+ "description": "Fired when a document, including the resources it refers to, is completely loaded and initialized.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
+ "url": {"type": "string"},
+ "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
+ "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
+ "timeStamp": {"type": "number", "description": "The time when the document finished loading, in milliseconds since the epoch."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "name": "filters",
+ "optional": true,
+ "$ref": "EventUrlFilters",
+ "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
+ }
+ ]
+ },
+ {
+ "name": "onErrorOccurred",
+ "type": "function",
+ "description": "Fired when an error occurs and the navigation is aborted. This can happen if either a network error occurred, or the user aborted the navigation.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
+ "url": {"type": "string"},
+ "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
+ "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
+ "error": {"unsupported": true, "type": "string", "description": "The error description."},
+ "timeStamp": {"type": "number", "description": "The time when the error occurred, in milliseconds since the epoch."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "name": "filters",
+ "optional": true,
+ "$ref": "EventUrlFilters",
+ "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
+ }
+ ]
+ },
+ {
+ "name": "onCreatedNavigationTarget",
+ "type": "function",
+ "description": "Fired when a new window, or a new tab in an existing window, is created to host a navigation.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "sourceTabId": {"type": "integer", "description": "The ID of the tab in which the navigation is triggered."},
+ "sourceProcessId": {"type": "integer", "description": "The ID of the process runs the renderer for the source tab."},
+ "sourceFrameId": {"type": "integer", "description": "The ID of the frame with sourceTabId in which the navigation is triggered. 0 indicates the main frame."},
+ "url": {"type": "string", "description": "The URL to be opened in the new window."},
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the url is opened"},
+ "timeStamp": {"type": "number", "description": "The time when the browser was about to create a new view, in milliseconds since the epoch."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "name": "filters",
+ "optional": true,
+ "$ref": "EventUrlFilters",
+ "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
+ }
+ ]
+ },
+ {
+ "name": "onReferenceFragmentUpdated",
+ "type": "function",
+ "description": "Fired when the reference fragment of a frame was updated. All future events for that frame will use the updated URL.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
+ "url": {"type": "string"},
+ "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
+ "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
+ "transitionType": {"unsupported": true, "$ref": "TransitionType", "description": "Cause of the navigation."},
+ "transitionQualifiers": {"unsupported": true, "type": "array", "description": "A list of transition qualifiers.", "items": {"$ref": "TransitionQualifier"}},
+ "timeStamp": {"type": "number", "description": "The time when the navigation was committed, in milliseconds since the epoch."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "name": "filters",
+ "optional": true,
+ "$ref": "EventUrlFilters",
+ "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
+ }
+ ]
+ },
+ {
+ "name": "onTabReplaced",
+ "type": "function",
+ "description": "Fired when the contents of the tab is replaced by a different (usually previously pre-rendered) tab.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "replacedTabId": {"type": "integer", "description": "The ID of the tab that was replaced."},
+ "tabId": {"type": "integer", "description": "The ID of the tab that replaced the old tab."},
+ "timeStamp": {"type": "number", "description": "The time when the replacement happened, in milliseconds since the epoch."}
+ }
+ }
+ ]
+ },
+ {
+ "name": "onHistoryStateUpdated",
+ "type": "function",
+ "description": "Fired when the frame's history was updated to a new URL. All future events for that frame will use the updated URL.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
+ "url": {"type": "string"},
+ "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
+ "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
+ "transitionType": {"unsupported": true, "$ref": "TransitionType", "description": "Cause of the navigation."},
+ "transitionQualifiers": {"unsupported": true, "type": "array", "description": "A list of transition qualifiers.", "items": {"$ref": "TransitionQualifier"}},
+ "timeStamp": {"type": "number", "description": "The time when the navigation was committed, in milliseconds since the epoch."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "name": "filters",
+ "optional": true,
+ "$ref": "EventUrlFilters",
+ "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/web_request.json b/interfaces/firefox/schemas/web_request.json
new file mode 100644
index 00000000..066b1511
--- /dev/null
+++ b/interfaces/firefox/schemas/web_request.json
@@ -0,0 +1,938 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermissionNoPrompt",
+ "choices": [{
+ "type": "string",
+ "enum": [
+ "webRequest",
+ "webRequestBlocking",
+ "webRequestFilterResponse",
+ "webRequestFilterResponse.serviceWorkerScript"
+ ]
+ }]
+ }
+ ]
+ },
+ {
+ "namespace": "webRequest",
+ "description": "Use the browser.webRequest
API to observe and analyze traffic and to intercept, block, or modify requests in-flight.",
+ "permissions": ["webRequest"],
+ "properties": {
+ "MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES": {
+ "value": 20,
+ "description": "The maximum number of times that handlerBehaviorChanged
can be called per 10 minute sustained interval. handlerBehaviorChanged
is an expensive function call that shouldn't be called often."
+ }
+ },
+ "types": [
+ {
+ "id": "ResourceType",
+ "type": "string",
+ "enum": [
+ "main_frame",
+ "sub_frame",
+ "stylesheet",
+ "script",
+ "image",
+ "object",
+ "object_subrequest",
+ "xmlhttprequest",
+ "xslt",
+ "ping",
+ "beacon",
+ "xml_dtd",
+ "font",
+ "media",
+ "websocket",
+ "csp_report",
+ "imageset",
+ "web_manifest",
+ "speculative",
+ "other"
+ ]
+ },
+ {
+ "id": "OnBeforeRequestOptions",
+ "type": "string",
+ "enum": ["blocking", "requestBody"],
+ "postprocess": "webRequestBlockingPermissionRequired"
+ },
+ {
+ "id": "OnBeforeSendHeadersOptions",
+ "type": "string",
+ "enum": ["requestHeaders", "blocking"],
+ "postprocess": "webRequestBlockingPermissionRequired"
+ },
+ {
+ "id": "OnSendHeadersOptions",
+ "type": "string",
+ "enum": ["requestHeaders"]
+ },
+ {
+ "id": "OnHeadersReceivedOptions",
+ "type": "string",
+ "enum": ["blocking", "responseHeaders"],
+ "postprocess": "webRequestBlockingPermissionRequired"
+ },
+ {
+ "id": "OnAuthRequiredOptions",
+ "type": "string",
+ "enum": ["responseHeaders", "blocking", "asyncBlocking"],
+ "postprocess": "webRequestBlockingPermissionRequired"
+ },
+ {
+ "id": "OnResponseStartedOptions",
+ "type": "string",
+ "enum": ["responseHeaders"]
+ },
+ {
+ "id": "OnBeforeRedirectOptions",
+ "type": "string",
+ "enum": ["responseHeaders"]
+ },
+ {
+ "id": "OnCompletedOptions",
+ "type": "string",
+ "enum": ["responseHeaders"]
+ },
+ {
+ "id": "RequestFilter",
+ "type": "object",
+ "description": "An object describing filters to apply to webRequest events.",
+ "properties": {
+ "urls": {
+ "type": "array",
+ "description": "A list of URLs or URL patterns. Requests that cannot match any of the URLs will be filtered out.",
+ "items": { "type": "string" },
+ "minItems": 1
+ },
+ "types": {
+ "type": "array",
+ "optional": true,
+ "description": "A list of request types. Requests that cannot match any of the types will be filtered out.",
+ "items": { "$ref": "ResourceType", "onError": "warn" },
+ "minItems": 1
+ },
+ "tabId": { "type": "integer", "optional": true },
+ "windowId": { "type": "integer", "optional": true },
+ "incognito": { "type": "boolean", "optional": true, "description": "If provided, requests that do not match the incognito state will be filtered out."}
+ }
+ },
+ {
+ "id": "HttpHeaders",
+ "type": "array",
+ "description": "An array of HTTP headers. Each header is represented as a dictionary containing the keys name
and either value
or binaryValue
.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {"type": "string", "description": "Name of the HTTP header."},
+ "value": {"type": "string", "optional": true, "description": "Value of the HTTP header if it can be represented by UTF-8."},
+ "binaryValue": {
+ "type": "array",
+ "optional": true,
+ "description": "Value of the HTTP header if it cannot be represented by UTF-8, stored as individual byte values (0..255).",
+ "items": {"type": "integer"}
+ }
+ }
+ }
+ },
+ {
+ "id": "BlockingResponse",
+ "type": "object",
+ "description": "Returns value for event handlers that have the 'blocking' extraInfoSpec applied. Allows the event handler to modify network requests.",
+ "properties": {
+ "cancel": {
+ "type": "boolean",
+ "optional": true,
+ "description": "If true, the request is cancelled. Used in onBeforeRequest, this prevents the request from being sent."
+ },
+ "redirectUrl": {
+ "type": "string",
+ "optional": true,
+ "description": "Only used as a response to the onBeforeRequest and onHeadersReceived events. If set, the original request is prevented from being sent/completed and is instead redirected to the given URL. Redirections to non-HTTP schemes such as data: are allowed. Redirects initiated by a redirect action use the original request method for the redirect, with one exception: If the redirect is initiated at the onHeadersReceived stage, then the redirect will be issued using the GET method."
+ },
+ "upgradeToSecure": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Only used as a response to the onBeforeRequest event. If set, the original request is prevented from being sent/completed and is instead upgraded to a secure request. If any extension returns redirectUrl
during onBeforeRequest, upgradeToSecure
will have no affect."
+ },
+ "requestHeaders": {
+ "$ref": "HttpHeaders",
+ "optional": true,
+ "description": "Only used as a response to the onBeforeSendHeaders event. If set, the request is made with these request headers instead."
+ },
+ "responseHeaders": {
+ "$ref": "HttpHeaders",
+ "optional": true,
+ "description": "Only used as a response to the onHeadersReceived event. If set, the server is assumed to have responded with these response headers instead. Only return responseHeaders
if you really want to modify the headers in order to limit the number of conflicts (only one extension may modify responseHeaders
for each request)."
+ },
+ "authCredentials": {
+ "type": "object",
+ "description": "Only used as a response to the onAuthRequired event. If set, the request is made using the supplied credentials.",
+ "optional": true,
+ "properties": {
+ "username": {"type": "string"},
+ "password": {"type": "string"}
+ }
+ }
+ }
+ },
+ {
+ "id": "CertificateInfo",
+ "type": "object",
+ "description": "Contains the certificate properties of the request if it is a secure request.",
+ "properties": {
+ "subject": {
+ "type": "string"
+ },
+ "issuer": {
+ "type": "string"
+ },
+ "validity": {
+ "type": "object",
+ "description": "Contains start and end timestamps.",
+ "properties": {
+ "start": { "type": "integer" },
+ "end": { "type": "integer" }
+ }
+ },
+ "fingerprint": {
+ "type": "object",
+ "properties": {
+ "sha1": { "type": "string" },
+ "sha256": { "type": "string" }
+ }
+ },
+ "serialNumber": {
+ "type": "string"
+ },
+ "isBuiltInRoot": {
+ "type": "boolean"
+ },
+ "subjectPublicKeyInfoDigest": {
+ "type": "object",
+ "properties": {
+ "sha256": { "type": "string" }
+ }
+ },
+ "rawDER": {
+ "optional": true,
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ {
+ "id": "CertificateTransparencyStatus",
+ "type": "string",
+ "enum": ["not_applicable", "policy_compliant", "policy_not_enough_scts", "policy_not_diverse_scts"]
+ },
+ {
+ "id": "TransportWeaknessReasons",
+ "type": "string",
+ "enum": ["cipher"]
+ },
+ {
+ "id": "SecurityInfo",
+ "type": "object",
+ "description": "Contains the security properties of the request (ie. SSL/TLS information).",
+ "properties": {
+ "state": {
+ "type": "string",
+ "enum": [
+ "insecure",
+ "weak",
+ "broken",
+ "secure"
+ ]
+ },
+ "errorMessage": {
+ "type": "string",
+ "description": "Error message if state is \"broken\"",
+ "optional": true
+ },
+ "protocolVersion": {
+ "type": "string",
+ "description": "Protocol version if state is \"secure\"",
+ "enum": [
+ "TLSv1",
+ "TLSv1.1",
+ "TLSv1.2",
+ "TLSv1.3",
+ "unknown"
+ ],
+ "optional": true
+ },
+ "cipherSuite": {
+ "type": "string",
+ "description": "The cipher suite used in this request if state is \"secure\".",
+ "optional": true
+ },
+ "keaGroupName": {
+ "type": "string",
+ "description": "The key exchange algorithm used in this request if state is \"secure\".",
+ "optional": true
+ },
+ "secretKeyLength": {
+ "type": "number",
+ "description": "The length (in bits) of the secret key.",
+ "optional": true
+ },
+ "signatureSchemeName": {
+ "type": "string",
+ "description": "The signature scheme used in this request if state is \"secure\".",
+ "optional": true
+ },
+ "certificates": {
+ "description": "Certificate data if state is \"secure\". Will only contain one entry unless certificateChain
is passed as an option.",
+ "type": "array",
+ "items": { "$ref": "CertificateInfo" }
+ },
+ "overridableErrorCategory": {
+ "description": "The type of certificate error that was overridden for this connection, if any.",
+ "type": "string",
+ "enum": [
+ "trust_error",
+ "domain_mismatch",
+ "expired_or_not_yet_valid"
+ ],
+ "optional": true
+ },
+ "isDomainMismatch": {
+ "description": "The domain name does not match the certificate domain.",
+ "type": "boolean",
+ "optional": true,
+ "deprecated": "Please use $(ref:SecurityInfo.overridableErrorCategory)."
+ },
+ "isNotValidAtThisTime": {
+ "description": "The certificate is either expired or is not yet valid. See CertificateInfo.validity
for start and end dates.",
+ "type": "boolean",
+ "optional": true,
+ "deprecated": "Please use $(ref:SecurityInfo.overridableErrorCategory)."
+ },
+ "isUntrusted": {
+ "type": "boolean",
+ "optional": true,
+ "deprecated": "Please use $(ref:SecurityInfo.overridableErrorCategory)."
+ },
+ "isExtendedValidation": {
+ "type": "boolean",
+ "optional": true
+ },
+ "certificateTransparencyStatus": {
+ "description": "Certificate transparency compliance per RFC 6962. See https://www.certificate-transparency.org/what-is-ct
for more information.",
+ "$ref": "CertificateTransparencyStatus",
+ "optional": true
+ },
+ "hsts": {
+ "type": "boolean",
+ "description": "True if host uses Strict Transport Security and state is \"secure\".",
+ "optional": true
+ },
+ "hpkp": {
+ "type": "string",
+ "description": "True if host uses Public Key Pinning and state is \"secure\".",
+ "optional": true
+ },
+ "weaknessReasons": {
+ "type": "array",
+ "items": { "$ref": "TransportWeaknessReasons" },
+ "description": "list of reasons that cause the request to be considered weak, if state is \"weak\"",
+ "optional": true
+ },
+ "usedEch" : {
+ "type": "boolean",
+ "description": "True if the TLS connection used Encrypted Client Hello.",
+ "optional": true
+ },
+ "usedDelegatedCredentials" : {
+ "type": "boolean",
+ "description": "True if the TLS connection used Delegated Credentials.",
+ "optional": true
+ },
+ "usedOcsp" : {
+ "type": "boolean",
+ "description": "True if the TLS connection made OCSP requests.",
+ "optional": true
+ },
+ "usedPrivateDns" : {
+ "type": "boolean",
+ "description": "True if the TLS connection used a privacy-preserving DNS transport like DNS-over-HTTPS.",
+ "optional": true
+ }
+ }
+ },
+ {
+ "id": "UploadData",
+ "type": "object",
+ "properties": {
+ "bytes": {
+ "type": "any",
+ "optional": true,
+ "description": "An ArrayBuffer with a copy of the data."
+ },
+ "file": {
+ "type": "string",
+ "optional": true,
+ "description": "A string with the file's path and name."
+ }
+ },
+ "description": "Contains data uploaded in a URL request."
+ },
+ {
+ "id": "UrlClassificationFlags",
+ "type": "string",
+ "enum": ["fingerprinting", "fingerprinting_content", "cryptomining", "cryptomining_content",
+ "emailtracking", "emailtracking_content", "tracking", "tracking_ad",
+ "tracking_analytics", "tracking_social", "tracking_content",
+ "any_basic_tracking", "any_strict_tracking", "any_social_tracking"],
+ "description": "Tracking flags that match our internal tracking classification"
+ },
+ {
+ "id": "UrlClassificationParty",
+ "type": "array",
+ "items": {"$ref": "UrlClassificationFlags"},
+ "description": "If the request has been classified this is an array of $(ref:UrlClassificationFlags)."
+ },
+ {
+ "id": "UrlClassification",
+ "type": "object",
+ "properties": {
+ "firstParty": {"$ref": "UrlClassificationParty", "description": "Classification flags if the request has been classified and it is first party."},
+ "thirdParty": {"$ref": "UrlClassificationParty", "description": "Classification flags if the request has been classified and it or its window hierarchy is third party."}
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "handlerBehaviorChanged",
+ "type": "function",
+ "description": "Needs to be called when the behavior of the webRequest handlers has changed to prevent incorrect handling due to caching. This function call is expensive. Don't call it often.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "filterResponseData",
+ "permissions": ["webRequestBlocking"],
+ "type": "function",
+ "description": "...",
+ "parameters": [
+ {
+ "name": "requestId",
+ "type": "string"
+ }
+ ],
+ "returns": {
+ "type": "object",
+ "additionalProperties": {"type": "any"},
+ "isInstanceOf": "StreamFilter"
+ }
+ },
+ {
+ "name": "getSecurityInfo",
+ "type": "function",
+ "async": true,
+ "description": "Retrieves the security information for the request. Returns a promise that will resolve to a SecurityInfo object.",
+ "parameters": [
+ {
+ "name": "requestId",
+ "type": "string"
+ },
+ {
+ "name": "options",
+ "optional": true,
+ "type": "object",
+ "properties": {
+ "certificateChain": {
+ "type": "boolean",
+ "description": "Include the entire certificate chain.",
+ "optional": true
+ },
+ "rawDER": {
+ "type": "boolean",
+ "description": "Include raw certificate data for processing by the extension.",
+ "optional": true
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onBeforeRequest",
+ "type": "function",
+ "description": "Fired when a request is about to occur.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
+ "url": {"type": "string"},
+ "method": {"type": "string", "description": "Standard HTTP method."},
+ "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type
is main_frame
or sub_frame
), frameId
indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
+ "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
+ "incognito": {"type": "boolean", "optional": true, "description": "True for private browsing requests."},
+ "cookieStoreId": {"type": "string", "optional": true, "description": "The cookie store ID of the contextual identity."},
+ "originUrl": {"type": "string", "optional": true, "description": "URL of the resource that triggered this request."},
+ "documentUrl": {"type": "string", "optional": true, "description": "URL of the page into which the requested resource will be loaded."},
+ "requestBody": {
+ "type": "object",
+ "optional": true,
+ "description": "Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'.",
+ "properties": {
+ "error": {"type": "string", "optional": true, "description": "Errors when obtaining request body data."},
+ "formData": {
+ "type": "object",
+ "optional": true,
+ "description": "If the request method is POST and the body is a sequence of key-value pairs encoded in UTF8, encoded as either multipart/form-data, or application/x-www-form-urlencoded, this dictionary is present and for each key contains the list of all values for that key. If the data is of another media type, or if it is malformed, the dictionary is not present. An example value of this dictionary is {'key': ['value1', 'value2']}.",
+ "properties": {},
+ "additionalProperties": {
+ "type": "array",
+ "items": { "type": "string" }
+ }
+ },
+ "raw" : {
+ "type": "array",
+ "optional": true,
+ "items": {"$ref": "UploadData"},
+ "description": "If the request method is PUT or POST, and the body is not already parsed in formData, then the unparsed request body elements are contained in this array."
+ }
+ }
+ },
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
+ "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
+ "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
+ "urlClassification": {"$ref": "UrlClassification", "optional": true, "description": "Tracking classification if the request has been classified."},
+ "thirdParty": {"type": "boolean", "description": "Indicates if this request and its content window hierarchy is third party."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "$ref": "RequestFilter",
+ "name": "filter",
+ "description": "A set of filters that restricts the events that will be sent to this listener."
+ },
+ {
+ "type": "array",
+ "optional": true,
+ "name": "extraInfoSpec",
+ "description": "Array of extra information that should be passed to the listener function.",
+ "items": {
+ "$ref": "OnBeforeRequestOptions"
+ }
+ }
+ ],
+ "returns": {
+ "$ref": "BlockingResponse",
+ "description": "If \"blocking\" is specified in the \"extraInfoSpec\" parameter, the event listener should return an object of this type.",
+ "optional": true
+ }
+ },
+ {
+ "name": "onBeforeSendHeaders",
+ "type": "function",
+ "description": "Fired before sending an HTTP request, once the request headers are available. This may occur after a TCP connection is made to the server, but before any HTTP data is sent. ",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
+ "url": {"type": "string"},
+ "method": {"type": "string", "description": "Standard HTTP method."},
+ "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type
is main_frame
or sub_frame
), frameId
indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
+ "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
+ "incognito": {"type": "boolean", "optional": true, "description": "True for private browsing requests."},
+ "cookieStoreId": {"type": "string", "optional": true, "description": "The cookie store ID of the contextual identity."},
+ "originUrl": {"type": "string", "optional": true, "description": "URL of the resource that triggered this request."},
+ "documentUrl": {"type": "string", "optional": true, "description": "URL of the page into which the requested resource will be loaded."},
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
+ "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
+ "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
+ "requestHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP request headers that are going to be sent out with this request."},
+ "urlClassification": {"$ref": "UrlClassification", "optional": true, "description": "Tracking classification if the request has been classified."},
+ "thirdParty": {"type": "boolean", "description": "Indicates if this request and its content window hierarchy is third party."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "$ref": "RequestFilter",
+ "name": "filter",
+ "description": "A set of filters that restricts the events that will be sent to this listener."
+ },
+ {
+ "type": "array",
+ "optional": true,
+ "name": "extraInfoSpec",
+ "description": "Array of extra information that should be passed to the listener function.",
+ "items": {
+ "$ref": "OnBeforeSendHeadersOptions"
+ }
+ }
+ ],
+ "returns": {
+ "$ref": "BlockingResponse",
+ "description": "If \"blocking\" is specified in the \"extraInfoSpec\" parameter, the event listener should return an object of this type.",
+ "optional": true
+ }
+ },
+ {
+ "name": "onSendHeaders",
+ "type": "function",
+ "description": "Fired just before a request is going to be sent to the server (modifications of previous onBeforeSendHeaders callbacks are visible by the time onSendHeaders is fired).",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
+ "url": {"type": "string"},
+ "method": {"type": "string", "description": "Standard HTTP method."},
+ "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type
is main_frame
or sub_frame
), frameId
indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
+ "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
+ "incognito": {"type": "boolean", "optional": true, "description": "True for private browsing requests."},
+ "cookieStoreId": {"type": "string", "optional": true, "description": "The cookie store ID of the contextual identity."},
+ "originUrl": {"type": "string", "optional": true, "description": "URL of the resource that triggered this request."},
+ "documentUrl": {"type": "string", "optional": true, "description": "URL of the page into which the requested resource will be loaded."},
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
+ "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
+ "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
+ "requestHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP request headers that have been sent out with this request."},
+ "urlClassification": {"$ref": "UrlClassification", "optional": true, "description": "Tracking classification if the request has been classified."},
+ "thirdParty": {"type": "boolean", "description": "Indicates if this request and its content window hierarchy is third party."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "$ref": "RequestFilter",
+ "name": "filter",
+ "description": "A set of filters that restricts the events that will be sent to this listener."
+ },
+ {
+ "type": "array",
+ "optional": true,
+ "name": "extraInfoSpec",
+ "description": "Array of extra information that should be passed to the listener function.",
+ "items": {
+ "$ref": "OnSendHeadersOptions"
+ }
+ }
+ ]
+ },
+ {
+ "name": "onHeadersReceived",
+ "type": "function",
+ "description": "Fired when HTTP response headers of a request have been received.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
+ "url": {"type": "string"},
+ "method": {"type": "string", "description": "Standard HTTP method."},
+ "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type
is main_frame
or sub_frame
), frameId
indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
+ "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
+ "incognito": {"type": "boolean", "optional": true, "description": "True for private browsing requests."},
+ "cookieStoreId": {"type": "string", "optional": true, "description": "The cookie store ID of the contextual identity."},
+ "originUrl": {"type": "string", "optional": true, "description": "URL of the resource that triggered this request."},
+ "documentUrl": {"type": "string", "optional": true, "description": "URL of the page into which the requested resource will be loaded."},
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
+ "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
+ "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
+ "statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line)."},
+ "responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that have been received with this response."},
+ "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."},
+ "urlClassification": {"$ref": "UrlClassification", "optional": true, "description": "Tracking classification if the request has been classified."},
+ "thirdParty": {"type": "boolean", "description": "Indicates if this request and its content window hierarchy is third party."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "$ref": "RequestFilter",
+ "name": "filter",
+ "description": "A set of filters that restricts the events that will be sent to this listener."
+ },
+ {
+ "type": "array",
+ "optional": true,
+ "name": "extraInfoSpec",
+ "description": "Array of extra information that should be passed to the listener function.",
+ "items": {
+ "$ref": "OnHeadersReceivedOptions"
+ }
+ }
+ ],
+ "returns": {
+ "$ref": "BlockingResponse",
+ "description": "If \"blocking\" is specified in the \"extraInfoSpec\" parameter, the event listener should return an object of this type.",
+ "optional": true
+ }
+ },
+ {
+ "name": "onAuthRequired",
+ "type": "function",
+ "description": "Fired when an authentication failure is received. The listener has three options: it can provide authentication credentials, it can cancel the request and display the error page, or it can take no action on the challenge. If bad user credentials are provided, this may be called multiple times for the same request.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
+ "url": {"type": "string"},
+ "method": {"type": "string", "description": "Standard HTTP method."},
+ "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type
is main_frame
or sub_frame
), frameId
indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
+ "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
+ "incognito": {"type": "boolean", "optional": true, "description": "True for private browsing requests."},
+ "cookieStoreId": {"type": "string", "optional": true, "description": "The cookie store ID of the contextual identity."},
+ "originUrl": {"type": "string", "optional": true, "description": "URL of the resource that triggered this request."},
+ "documentUrl": {"type": "string", "optional": true, "description": "URL of the page into which the requested resource will be loaded."},
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
+ "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
+ "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
+ "scheme": {"type": "string", "description": "The authentication scheme, e.g. Basic or Digest."},
+ "realm": {"type": "string", "description": "The authentication realm provided by the server, if there is one.", "optional": true},
+ "challenger": {"type": "object", "description": "The server requesting authentication.", "properties": {"host": {"type": "string"}, "port": {"type": "integer"}}},
+ "isProxy": {"type": "boolean", "description": "True for Proxy-Authenticate, false for WWW-Authenticate."},
+ "responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that were received along with this response."},
+ "statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers."},
+ "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."},
+ "urlClassification": {"$ref": "UrlClassification", "optional": true, "description": "Tracking classification if the request has been classified."},
+ "thirdParty": {"type": "boolean", "description": "Indicates if this request and its content window hierarchy is third party."}
+ }
+ },
+ {
+ "type": "function",
+ "optional": true,
+ "name": "callback",
+ "parameters": [
+ {"name": "response", "$ref": "BlockingResponse"}
+ ]
+ }
+ ],
+ "extraParameters": [
+ {
+ "$ref": "RequestFilter",
+ "name": "filter",
+ "description": "A set of filters that restricts the events that will be sent to this listener."
+ },
+ {
+ "type": "array",
+ "optional": true,
+ "name": "extraInfoSpec",
+ "description": "Array of extra information that should be passed to the listener function.",
+ "items": {
+ "$ref": "OnAuthRequiredOptions"
+ }
+ }
+ ],
+ "returns": {
+ "$ref": "BlockingResponse",
+ "description": "If \"blocking\" is specified in the \"extraInfoSpec\" parameter, the event listener should return an object of this type.",
+ "optional": true
+ }
+ },
+ {
+ "name": "onResponseStarted",
+ "type": "function",
+ "description": "Fired when the first byte of the response body is received. For HTTP requests, this means that the status line and response headers are available.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
+ "url": {"type": "string"},
+ "method": {"type": "string", "description": "Standard HTTP method."},
+ "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type
is main_frame
or sub_frame
), frameId
indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
+ "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
+ "incognito": {"type": "boolean", "optional": true, "description": "True for private browsing requests."},
+ "cookieStoreId": {"type": "string", "optional": true, "description": "The cookie store ID of the contextual identity."},
+ "originUrl": {"type": "string", "optional": true, "description": "URL of the resource that triggered this request."},
+ "documentUrl": {"type": "string", "optional": true, "description": "URL of the page into which the requested resource will be loaded."},
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
+ "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
+ "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
+ "ip": {"type": "string", "optional": true, "description": "The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address."},
+ "fromCache": {"type": "boolean", "description": "Indicates if this response was fetched from disk cache."},
+ "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."},
+ "responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that were received along with this response."},
+ "statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers."},
+ "urlClassification": {"$ref": "UrlClassification", "optional": true, "description": "Tracking classification if the request has been classified."},
+ "thirdParty": {"type": "boolean", "description": "Indicates if this request and its content window hierarchy is third party."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "$ref": "RequestFilter",
+ "name": "filter",
+ "description": "A set of filters that restricts the events that will be sent to this listener."
+ },
+ {
+ "type": "array",
+ "optional": true,
+ "name": "extraInfoSpec",
+ "description": "Array of extra information that should be passed to the listener function.",
+ "items": {
+ "$ref": "OnResponseStartedOptions"
+ }
+ }
+ ]
+ },
+ {
+ "name": "onBeforeRedirect",
+ "type": "function",
+ "description": "Fired when a server-initiated redirect is about to occur.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
+ "url": {"type": "string"},
+ "method": {"type": "string", "description": "Standard HTTP method."},
+ "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type
is main_frame
or sub_frame
), frameId
indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
+ "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
+ "incognito": {"type": "boolean", "optional": true, "description": "True for private browsing requests."},
+ "cookieStoreId": {"type": "string", "optional": true, "description": "The cookie store ID of the contextual identity."},
+ "originUrl": {"type": "string", "optional": true, "description": "URL of the resource that triggered this request."},
+ "documentUrl": {"type": "string", "optional": true, "description": "URL of the page into which the requested resource will be loaded."},
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
+ "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
+ "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
+ "ip": {"type": "string", "optional": true, "description": "The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address."},
+ "fromCache": {"type": "boolean", "description": "Indicates if this response was fetched from disk cache."},
+ "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."},
+ "redirectUrl": {"type": "string", "description": "The new URL."},
+ "responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that were received along with this redirect."},
+ "statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers."},
+ "urlClassification": {"$ref": "UrlClassification", "optional": true, "description": "Tracking classification if the request has been classified."},
+ "thirdParty": {"type": "boolean", "description": "Indicates if this request and its content window hierarchy is third party."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "$ref": "RequestFilter",
+ "name": "filter",
+ "description": "A set of filters that restricts the events that will be sent to this listener."
+ },
+ {
+ "type": "array",
+ "optional": true,
+ "name": "extraInfoSpec",
+ "description": "Array of extra information that should be passed to the listener function.",
+ "items": {
+ "$ref": "OnBeforeRedirectOptions"
+ }
+ }
+ ]
+ },
+ {
+ "name": "onCompleted",
+ "type": "function",
+ "description": "Fired when a request is completed.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
+ "url": {"type": "string"},
+ "method": {"type": "string", "description": "Standard HTTP method."},
+ "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type
is main_frame
or sub_frame
), frameId
indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
+ "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
+ "incognito": {"type": "boolean", "optional": true, "description": "True for private browsing requests."},
+ "cookieStoreId": {"type": "string", "optional": true, "description": "The cookie store ID of the contextual identity."},
+ "originUrl": {"type": "string", "optional": true, "description": "URL of the resource that triggered this request."},
+ "documentUrl": {"type": "string", "optional": true, "description": "URL of the page into which the requested resource will be loaded."},
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
+ "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
+ "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
+ "ip": {"type": "string", "optional": true, "description": "The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address."},
+ "fromCache": {"type": "boolean", "description": "Indicates if this response was fetched from disk cache."},
+ "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."},
+ "responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that were received along with this response."},
+ "statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers."},
+ "urlClassification": {"$ref": "UrlClassification","description": "Tracking classification if the request has been classified."},
+ "thirdParty": {"type": "boolean", "description": "Indicates if this request and its content window hierarchy is third party."},
+ "requestSize": {"type": "integer", "description": "For http requests, the bytes transferred in the request. Only available in onCompleted."},
+ "responseSize": {"type": "integer", "description": "For http requests, the bytes received in the request. Only available in onCompleted."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "$ref": "RequestFilter",
+ "name": "filter",
+ "description": "A set of filters that restricts the events that will be sent to this listener."
+ },
+ {
+ "type": "array",
+ "optional": true,
+ "name": "extraInfoSpec",
+ "description": "Array of extra information that should be passed to the listener function.",
+ "items": {
+ "$ref": "OnCompletedOptions"
+ }
+ }
+ ]
+ },
+ {
+ "name": "onErrorOccurred",
+ "type": "function",
+ "description": "Fired when an error occurs.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
+ "url": {"type": "string"},
+ "method": {"type": "string", "description": "Standard HTTP method."},
+ "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type
is main_frame
or sub_frame
), frameId
indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
+ "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
+ "incognito": {"type": "boolean", "optional": true, "description": "True for private browsing requests."},
+ "cookieStoreId": {"type": "string", "optional": true, "description": "The cookie store ID of the contextual identity."},
+ "originUrl": {"type": "string", "optional": true, "description": "URL of the resource that triggered this request."},
+ "documentUrl": {"type": "string", "optional": true, "description": "URL of the page into which the requested resource will be loaded."},
+ "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
+ "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
+ "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
+ "ip": {"type": "string", "optional": true, "description": "The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address."},
+ "fromCache": {"type": "boolean", "description": "Indicates if this response was fetched from disk cache."},
+ "error": {"type": "string", "description": "The error description. This string is not guaranteed to remain backwards compatible between releases. You must not parse and act based upon its content."},
+ "urlClassification": {"$ref": "UrlClassification", "optional": true, "description": "Tracking classification if the request has been classified."},
+ "thirdParty": {"type": "boolean", "description": "Indicates if this request and its content window hierarchy is third party."}
+ }
+ }
+ ],
+ "extraParameters": [
+ {
+ "$ref": "RequestFilter",
+ "name": "filter",
+ "description": "A set of filters that restricts the events that will be sent to this listener."
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/interfaces/firefox/schemas/windows.json b/interfaces/firefox/schemas/windows.json
new file mode 100644
index 00000000..7cc1b209
--- /dev/null
+++ b/interfaces/firefox/schemas/windows.json
@@ -0,0 +1,505 @@
+[
+ {
+ "namespace": "windows",
+ "description": "Use the browser.windows
API to interact with browser windows. You can use this API to create, modify, and rearrange windows in the browser.",
+ "types": [
+ {
+ "id": "WindowType",
+ "type": "string",
+ "description": "The type of browser window this is. Under some circumstances a Window may not be assigned type property, for example when querying closed windows from the $(ref:sessions) API.",
+ "enum": ["normal", "popup", "panel", "app", "devtools"]
+ },
+ {
+ "id": "WindowState",
+ "type": "string",
+ "description": "The state of this browser window. Under some circumstances a Window may not be assigned state property, for example when querying closed windows from the $(ref:sessions) API.",
+ "enum": ["normal", "minimized", "maximized", "fullscreen", "docked"]
+ },
+ {
+ "id": "Window",
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "optional": true,
+ "minimum": 0,
+ "description": "The ID of the window. Window IDs are unique within a browser session. Under some circumstances a Window may not be assigned an ID, for example when querying windows using the $(ref:sessions) API, in which case a session ID may be present."
+ },
+ "focused": {
+ "type": "boolean",
+ "description": "Whether the window is currently the focused window."
+ },
+ "top": {
+ "type": "integer",
+ "optional": true,
+ "description": "The offset of the window from the top edge of the screen in pixels. Under some circumstances a Window may not be assigned top property, for example when querying closed windows from the $(ref:sessions) API."
+ },
+ "left": {
+ "type": "integer",
+ "optional": true,
+ "description": "The offset of the window from the left edge of the screen in pixels. Under some circumstances a Window may not be assigned left property, for example when querying closed windows from the $(ref:sessions) API."
+ },
+ "width": {
+ "type": "integer",
+ "optional": true,
+ "description": "The width of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned width property, for example when querying closed windows from the $(ref:sessions) API."
+ },
+ "height": {
+ "type": "integer",
+ "optional": true,
+ "description": "The height of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned height property, for example when querying closed windows from the $(ref:sessions) API."
+ },
+ "tabs": {
+ "type": "array",
+ "items": { "$ref": "tabs.Tab" },
+ "optional": true,
+ "description": "Array of $(ref:tabs.Tab) objects representing the current tabs in the window."
+ },
+ "incognito": {
+ "type": "boolean",
+ "description": "Whether the window is incognito."
+ },
+ "type": {
+ "$ref": "WindowType",
+ "optional": true,
+ "description": "The type of browser window this is."
+ },
+ "state": {
+ "$ref": "WindowState",
+ "optional": true,
+ "description": "The state of this browser window."
+ },
+ "alwaysOnTop": {
+ "type": "boolean",
+ "description": "Whether the window is set to be always on top."
+ },
+ "sessionId": {
+ "type": "string",
+ "optional": true,
+ "description": "The session ID used to uniquely identify a Window obtained from the $(ref:sessions) API."
+ },
+ "title": {
+ "type": "string",
+ "optional": true,
+ "description": "The title of the window. Read-only."
+ }
+ }
+ },
+ {
+ "id": "CreateType",
+ "type": "string",
+ "description": "Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the '--enable-panels' flag is set.",
+ "enum": ["normal", "popup", "panel", "detached_panel"]
+ },
+ {
+ "id": "GetInfo",
+ "type": "object",
+ "description": "Specifies whether the $(ref:windows.Window) returned should contain a list of the $(ref:tabs.Tab) objects.",
+ "properties": {
+ "populate": {
+ "type": "boolean",
+ "optional": true,
+ "description": "If true, the $(ref:windows.Window) returned will have a tabs property that contains a list of the $(ref:tabs.Tab) objects. The Tab
objects only contain the url
, title
and favIconUrl
properties if the extension's manifest file includes the \"tabs\"
permission."
+ },
+ "windowTypes": {
+ "type": "array",
+ "items": {
+ "$ref": "WindowType"
+ },
+ "optional": true,
+ "deprecated": true,
+ "description": "windowTypes
is deprecated and ignored on Firefox."
+ }
+ }
+ }
+ ],
+ "properties": {
+ "WINDOW_ID_NONE": {
+ "value": -1,
+ "description": "The windowId value that represents the absence of a browser window."
+ },
+ "WINDOW_ID_CURRENT": {
+ "value": -2,
+ "description": "The windowId value that represents the $(topic:current-window)[current window]."
+ }
+ },
+ "functions": [
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Gets details about a window.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "minimum": -2
+ },
+ {
+ "$ref": "GetInfo",
+ "name": "getInfo",
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "window",
+ "$ref": "Window"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getCurrent",
+ "type": "function",
+ "description": "Gets the $(topic:current-window)[current window].",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "GetInfo",
+ "name": "getInfo",
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "window",
+ "$ref": "Window"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getLastFocused",
+ "type": "function",
+ "description": "Gets the window that was most recently focused — typically the window 'on top'.",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "GetInfo",
+ "name": "getInfo",
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "window",
+ "$ref": "Window"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getAll",
+ "type": "function",
+ "description": "Gets all windows.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "$import": "GetInfo",
+ "name": "getInfo",
+ "optional": true,
+ "description": "Specifies properties used to filter the $(ref:windows.Window) returned and to determine whether they should contain a list of the $(ref:tabs.Tab) objects.",
+ "properties": {
+ "windowTypes": {
+ "type": "array",
+ "items": { "$ref": "WindowType" },
+ "optional": true,
+ "description": "If set, the $(ref:windows.Window) returned will be filtered based on its type. If unset the default filter is set to ['app', 'normal', 'panel', 'popup']
, with 'app'
and 'panel'
window types limited to the extension's own windows."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "windows",
+ "type": "array",
+ "items": { "$ref": "Window" }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "create",
+ "type": "function",
+ "description": "Creates (opens) a new browser with any optional sizing, position or default URL provided.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "createData",
+ "optional": true,
+ "default": {},
+ "properties": {
+ "url": {
+ "description": "A URL or array of URLs to open as tabs in the window. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.",
+ "optional": true,
+ "choices": [
+ { "type": "string" },
+ {
+ "type": "array",
+ "items": { "type": "string" }
+ }
+ ]
+ },
+ "tabId": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The id of the tab for which you want to adopt to the new window."
+ },
+ "left": {
+ "type": "integer",
+ "optional": true,
+ "description": "The number of pixels to position the new window from the left edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels."
+ },
+ "top": {
+ "type": "integer",
+ "optional": true,
+ "description": "The number of pixels to position the new window from the top edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels."
+ },
+ "width": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The width in pixels of the new window, including the frame. If not specified defaults to a natural width."
+ },
+ "height": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The height in pixels of the new window, including the frame. If not specified defaults to a natural height."
+ },
+ "focused": {
+ "choices": [
+ {
+ "type": "boolean",
+ "enum": [true]
+ },
+ {
+ "type": "boolean",
+ "enum": [false],
+ "deprecated": "Opening inactive windows is not supported."
+ }
+ ],
+ "optional": true,
+ "description": "If true, opens an active window. If false, opens an inactive window."
+ },
+ "incognito": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the new window should be an incognito window."
+ },
+ "type": {
+ "$ref": "CreateType",
+ "optional": true,
+ "description": "Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the '--enable-panels' flag is set."
+ },
+ "state": {
+ "$ref": "WindowState",
+ "optional": true,
+ "description": "The initial state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'."
+ },
+ "allowScriptsToClose": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Allow scripts to close the window."
+ },
+ "cookieStoreId": {
+ "type": "string",
+ "optional": true,
+ "description": "The CookieStoreId to use for all tabs that were created when the window is opened."
+ },
+ "titlePreface": {
+ "type": "string",
+ "optional": true,
+ "description": "A string to add to the beginning of the window title."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "window",
+ "$ref": "Window",
+ "description": "Contains details about the created window.",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "update",
+ "type": "function",
+ "description": "Updates the properties of a window. Specify only the properties that you want to change; unspecified properties will be left unchanged.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "minimum": -2
+ },
+ {
+ "type": "object",
+ "name": "updateInfo",
+ "properties": {
+ "left": {
+ "type": "integer",
+ "optional": true,
+ "description": "The offset from the left edge of the screen to move the window to in pixels. This value is ignored for panels."
+ },
+ "top": {
+ "type": "integer",
+ "optional": true,
+ "description": "The offset from the top edge of the screen to move the window to in pixels. This value is ignored for panels."
+ },
+ "width": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The width to resize the window to in pixels. This value is ignored for panels."
+ },
+ "height": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The height to resize the window to in pixels. This value is ignored for panels."
+ },
+ "focused": {
+ "type": "boolean",
+ "optional": true,
+ "description": "If true, brings the window to the front. If false, brings the next window in the z-order to the front."
+ },
+ "drawAttention": {
+ "type": "boolean",
+ "optional": true,
+ "description": "If true, causes the window to be displayed in a manner that draws the user's attention to the window, without changing the focused window. The effect lasts until the user changes focus to the window. This option has no effect if the window already has focus. Set to false to cancel a previous draw attention request."
+ },
+ "state": {
+ "$ref": "WindowState",
+ "optional": true,
+ "description": "The new state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'."
+ },
+ "titlePreface": {
+ "type": "string",
+ "optional": true,
+ "description": "A string to add to the beginning of the window title."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "window",
+ "$ref": "Window"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "remove",
+ "type": "function",
+ "description": "Removes (closes) a window, and all the tabs inside it.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "minimum": -2
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onCreated",
+ "type": "function",
+ "description": "Fired when a window is created.",
+ "filters": [
+ {
+ "name": "windowTypes",
+ "type": "array",
+ "items": { "$ref": "WindowType" },
+ "description": "Conditions that the window's type being created must satisfy. By default it will satisfy ['app', 'normal', 'panel', 'popup']
, with 'app'
and 'panel'
window types limited to the extension's own windows."
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "Window",
+ "name": "window",
+ "description": "Details of the window that was created."
+ }
+ ]
+ },
+ {
+ "name": "onRemoved",
+ "type": "function",
+ "description": "Fired when a window is removed (closed).",
+ "filters": [
+ {
+ "name": "windowTypes",
+ "type": "array",
+ "items": { "$ref": "WindowType" },
+ "description": "Conditions that the window's type being removed must satisfy. By default it will satisfy ['app', 'normal', 'panel', 'popup']
, with 'app'
and 'panel'
window types limited to the extension's own windows."
+ }
+ ],
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "minimum": 0,
+ "description": "ID of the removed window."
+ }
+ ]
+ },
+ {
+ "name": "onFocusChanged",
+ "type": "function",
+ "description": "Fired when the currently focused window changes. Will be $(ref:windows.WINDOW_ID_NONE) if all browser windows have lost focus. Note: On some Linux window managers, WINDOW_ID_NONE will always be sent immediately preceding a switch from one browser window to another.",
+ "filters": [
+ {
+ "name": "windowTypes",
+ "type": "array",
+ "items": { "$ref": "WindowType" },
+ "description": "Conditions that the window's type being removed must satisfy. By default it will satisfy ['app', 'normal', 'panel', 'popup']
, with 'app'
and 'panel'
window types limited to the extension's own windows."
+ }
+ ],
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "minimum": -1,
+ "description": "ID of the newly focused window."
+ }
+ ]
+ }
+ ]
+ }
+]