3 "namespace": "manifest",
6 "$extend": "OptionalPermission",
10 "enum": ["nativeMessaging"]
17 "namespace": "runtime",
18 "allowedContexts": ["content", "devtools"],
19 "description": "Use the <code>browser.runtime</code> 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.",
24 "allowedContexts": ["content", "devtools"],
25 "description": "An object which allows two way communication with other pages.",
27 "name": { "type": "string" },
28 "disconnect": { "type": "function" },
29 "onDisconnect": { "$ref": "events.Event" },
30 "onMessage": { "$ref": "events.Event" },
31 "postMessage": { "type": "function" },
33 "$ref": "MessageSender",
35 "description": "This property will <b>only</b> be present on ports passed to onConnect/onConnectExternal listeners."
38 "additionalProperties": { "type": "any" }
41 "id": "MessageSender",
43 "allowedContexts": ["content", "devtools"],
44 "description": "An object containing information about the script context that sent a message or request.",
49 "description": "The $(ref:tabs.Tab) which opened the connection, if any. This property will <strong>only</strong> be present when the connection was opened from a tab (including content scripts), and <strong>only</strong> if the receiver is an extension, not an app."
54 "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 <code>tab</code> is set."
59 "description": "The ID of the extension or app that opened the connection, if any."
64 "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."
70 "description": "The TLS channel ID of the page or frame that opened the connection, if requested by the extension or app, and if available."
77 "allowedContexts": ["content", "devtools"],
78 "description": "The operating system the browser is running on.",
79 "enum": ["mac", "win", "android", "cros", "linux", "openbsd"]
94 "allowedContexts": ["content", "devtools"],
95 "description": "The machine's processor architecture."
100 "allowedContexts": ["content", "devtools"],
101 "description": "An object containing information about the current platform.",
104 "$ref": "PlatformOs",
105 "description": "The operating system the browser is running on."
108 "$ref": "PlatformArch",
109 "description": "The machine's processor architecture."
113 "description": "The native client architecture. This may be different from arch on some platforms.",
114 "$ref": "PlatformNaclArch"
121 "description": "An object containing information about the current browser.",
125 "description": "The name of the browser, for example 'Firefox'."
129 "description": "The name of the browser vendor, for example 'Mozilla'."
133 "description": "The browser's version, for example '42.0.0' or '0.8.1pre'."
137 "description": "The browser's build ID/date, for example '20160101'."
142 "id": "RequestUpdateCheckStatus",
144 "enum": ["throttled", "no_update", "update_available"],
145 "allowedContexts": ["content", "devtools"],
146 "description": "Result of the update check."
149 "id": "OnInstalledReason",
151 "enum": ["install", "update", "browser_update"],
152 "allowedContexts": ["content", "devtools"],
153 "description": "The reason that this event is being dispatched."
156 "id": "OnRestartRequiredReason",
158 "allowedContexts": ["content", "devtools"],
159 "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.",
160 "enum": ["app_update", "os_update", "periodic"]
163 "id": "OnPerformanceWarningCategory",
165 "enum": ["content_script"],
166 "description": "The performance warning event category, e.g. 'content_script'."
169 "id": "OnPerformanceWarningSeverity",
171 "enum": ["low", "medium", "high"],
172 "description": "The performance warning event severity. Will be 'high' for serious and user-visible issues."
179 "allowedContexts": ["content", "devtools"],
180 "description": "This will be defined during an API method callback if there was an error",
185 "description": "Details about the error which occurred."
188 "additionalProperties": {
194 "allowedContexts": ["content", "devtools"],
195 "description": "The ID of the extension/app."
200 "name": "getBackgroundPage",
202 "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.",
210 "name": "backgroundPage",
213 "isInstanceOf": "Window",
214 "additionalProperties": { "type": "any" },
215 "description": "The JavaScript 'window' object for the background page."
222 "name": "openOptionsPage",
224 "description": "<p>Open your Extension's options page, if possible.</p><p>The precise behavior may depend on your manifest's <code>$(topic:optionsV2)[options_ui]</code> or <code>$(topic:options)[options_page]</code> key, or what the browser happens to support at the time.</p><p>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).</p>",
236 "name": "getManifest",
237 "allowedContexts": ["content", "devtools"],
238 "description": "Returns details about the app or extension from the manifest. The object returned is a serialization of the full $(topic:manifest)[manifest file].",
244 "additionalProperties": { "type": "any" },
245 "description": "The manifest details."
251 "allowedContexts": ["content", "devtools"],
252 "description": "Converts a relative path within an app/extension install directory to a fully-qualified URL.",
257 "description": "A path to a resource within an app/extension expressed relative to its install directory."
262 "description": "The fully-qualified URL to the resource."
266 "name": "getFrameId",
268 "allowedContexts": ["content", "devtools"],
269 "description": "Get the frameId of any window global or frame element.",
274 "description": "A WindowProxy or a Browsing Context container element (IFrame, Frame, Embed, Object) for the target frame."
277 "allowCrossOriginArguments": true,
280 "description": "The frameId of the target frame, or -1 if it doesn't exist."
284 "name": "setUninstallURL",
286 "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 1023 characters.",
294 "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."
300 "description": "Called when the uninstall URL is set. If the given URL is invalid, $(ref:runtime.lastError) will be set.",
307 "description": "Reloads the app or extension.",
312 "name": "requestUpdateCheck",
315 "description": "Requests an update check for this app/extension.",
324 "$ref": "RequestUpdateCheckStatus",
325 "description": "Result of the update check."
334 "description": "The version of the available update."
337 "description": "If an update is available, this contains more information about the available update."
346 "description": "Restart the device when the app runs in kiosk mode. Otherwise, it's no-op.",
353 "allowedContexts": ["content", "devtools"],
354 "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).",
358 "name": "extensionId",
360 "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]."
364 "name": "connectInfo",
369 "description": "Will be passed into onConnect for processes that are listening for the connection event."
371 "includeTlsChannelId": {
374 "description": "Whether the TLS channel ID will be passed into onConnectExternal for processes that are listening for the connection event."
382 "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. "
386 "name": "connectNative",
388 "description": "Connects to a native application in the host machine.",
389 "allowedContexts": ["content"],
390 "permissions": ["nativeMessaging"],
394 "pattern": "^\\w+(\\.\\w+)*$",
395 "name": "application",
396 "description": "The name of the registered application to connect to."
401 "description": "Port through which messages can be sent and received with the application"
405 "name": "sendMessage",
407 "allowAmbiguousOptionalArguments": true,
408 "allowedContexts": ["content", "devtools"],
409 "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).",
410 "async": "responseCallback",
414 "name": "extensionId",
416 "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]."
418 { "type": "any", "name": "message" },
423 "includeTlsChannelId": {
427 "description": "Whether the TLS channel ID will be passed into onMessageExternal for processes that are listening for the connection event."
434 "name": "responseCallback",
440 "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."
447 "name": "sendNativeMessage",
449 "description": "Send a single message to a native application.",
450 "allowedContexts": ["content"],
451 "permissions": ["nativeMessaging"],
452 "async": "responseCallback",
455 "name": "application",
456 "description": "The name of the native messaging host.",
458 "pattern": "^\\w+(\\.\\w+)*$"
462 "description": "The message that will be passed to the native messaging host.",
467 "name": "responseCallback",
473 "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."
480 "name": "getBrowserInfo",
482 "description": "Returns information about the current browser.",
488 "description": "Called with results",
491 "name": "browserInfo",
492 "$ref": "BrowserInfo"
499 "name": "getPlatformInfo",
501 "description": "Returns information about the current platform.",
507 "description": "Called with results",
510 "name": "platformInfo",
511 "$ref": "PlatformInfo"
518 "name": "getPackageDirectoryEntry",
521 "description": "Returns a DirectoryEntry for the package directory.",
529 "name": "directoryEntry",
531 "additionalProperties": { "type": "any" },
532 "isInstanceOf": "DirectoryEntry"
543 "description": "Fired when a profile that has this extension installed first starts up. This event is not fired for incognito profiles."
546 "name": "onInstalled",
548 "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.",
555 "$ref": "OnInstalledReason",
556 "description": "The reason that this event is being dispatched."
561 "description": "Indicates the previous version of the extension, which has just been updated. This is present only if 'reason' is 'update'."
565 "description": "Indicates whether the addon is installed as a temporary extension."
571 "description": "Indicates the ID of the imported shared module extension which updated. This is present only if 'reason' is 'shared_module_update'."
580 "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. "
583 "name": "onSuspendCanceled",
585 "description": "Sent after onSuspend to indicate that the app won't be unloaded after all."
588 "name": "onUpdateAvailable",
590 "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.",
598 "description": "The version number of the available update."
601 "additionalProperties": { "type": "any" },
602 "description": "The manifest details of the available update."
607 "name": "onBrowserUpdateAvailable",
610 "description": "Fired when an update for the browser is available, but isn't installed immediately because a browser restart is required.",
611 "deprecated": "Please use $(ref:runtime.onRestartRequired).",
617 "allowedContexts": ["content", "devtools"],
618 "description": "Fired when a connection is made from either an extension process or a content script.",
619 "parameters": [{ "$ref": "Port", "name": "port" }]
622 "name": "onConnectExternal",
624 "description": "Fired when a connection is made from another extension.",
625 "parameters": [{ "$ref": "Port", "name": "port" }]
630 "allowedContexts": ["content", "devtools"],
631 "description": "Fired when a message is sent from either an extension process or a content script.",
637 "description": "The message sent by the calling script."
639 { "name": "sender", "$ref": "MessageSender" },
641 "name": "sendResponse",
643 "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 <code>onMessage</code> 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 <code>sendResponse</code> is called)."
649 "description": "Return true from the event listener if you wish to call <code>sendResponse</code> after the event listener returns."
653 "name": "onMessageExternal",
655 "description": "Fired when a message is sent from another extension/app. Cannot be used in a content script.",
661 "description": "The message sent by the calling script."
663 { "name": "sender", "$ref": "MessageSender" },
665 "name": "sendResponse",
667 "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 <code>onMessage</code> 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 <code>sendResponse</code> is called)."
673 "description": "Return true from the event listener if you wish to call <code>sendResponse</code> after the event listener returns."
677 "name": "onRestartRequired",
680 "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.",
683 "$ref": "OnRestartRequiredReason",
685 "description": "The reason that the event is being dispatched."
690 "name": "onPerformanceWarning",
692 "description": "Fired when a runtime performance issue is detected with the extension. Observe this event to be proactively notified of runtime performance problems with the extension.",
699 "$ref": "OnPerformanceWarningCategory",
700 "description": "The performance warning event category, e.g. 'content_script'."
703 "$ref": "OnPerformanceWarningSeverity",
704 "description": "The performance warning event severity, e.g. 'high'."
709 "description": "The $(ref:tabs.Tab) that the performance warning relates to, if any."
713 "description": "An explanation of what the warning means, and hopefully how to address it."