UNPKG

webextensions-schema

Version:

Programmatically consume the WebExtensions Schema JSON files

203 lines 7.46 kB
[ { "namespace": "manifest", "types": [ { "$extend": "Permission", "choices": [{ "type": "string", "enum": [ "proxy" ] }] } ] }, { "namespace": "proxy", "description": "Use the browser.proxy API to register proxy scripts in Firefox. Proxy scripts in Firefox are proxy auto-config files with extra contextual information and support for additional return types.", "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, "description": "The address of the ftp proxy, can include a port." }, "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." } } } ], "properties": { "settings": { "$ref": "types.Setting", "description": "Configures proxy settings. This setting's value is an object of type ProxyConfig." } }, "functions": [ { "name": "register", "type": "function", "description": "Registers the proxy script for the extension.", "async": true, "parameters": [ { "name": "url", "type": "string", "format": "strictRelativeUrl" } ] }, { "name": "unregister", "type": "function", "description": "Unregisters the proxy script for the extension.", "async": true, "parameters": [] }, { "name": "registerProxyScript", "type": "function", "description": "Registers the proxy script for the extension.", "deprecated": "Please use $(ref:proxy.register)", "async": true, "parameters": [ { "name": "url", "type": "string", "format": "strictRelativeUrl" } ] } ], "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 (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> 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."}, "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."}, "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."}, "requestHeaders": {"$ref": "webRequest.HttpHeaders", "optional": true, "description": "The HTTP request headers that are going to be sent out with this request."} } } ], "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 proxy script errors.", "parameters": [ { "name": "error", "type": "object" } ] }, { "name": "onProxyError", "type": "function", "description": "Please use $(ref:proxy.onError).", "parameters": [ { "name": "error", "type": "object" } ] } ] } ]