Commit 57071b26 authored by dpapad's avatar dpapad Committed by Commit Bot

JS compiler: Check-in generated externs for various extensions APIs.

Some manual edits have been recorded in the form of "NOTE" comments,
since the generation script still has some bugs.

Bug: 1081815
Change-Id: I2d2fb4cf82d0b1467a0afd335cd61a3c68688990
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2212998Reviewed-by: default avatarMike Frysinger <vapier@chromium.org>
Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Commit-Queue: dpapad <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774390}
parent 32d95678
// Copyright 2020 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 file.
// This file was generated by:
// tools/json_schema_compiler/compiler.py.
// NOTE: The format of types has changed. 'FooType' is now
// 'chrome.bookmarks.FooType'.
// Please run the closure compiler before committing changes.
// See https://chromium.googlesource.com/chromium/src/+/master/docs/closure_compilation.md
/** @fileoverview Externs generated from namespace: bookmarks */
/** @const */
chrome.bookmarks = {};
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/bookmarks#type-BookmarkTreeNodeUnmodifiable
*/
chrome.bookmarks.BookmarkTreeNodeUnmodifiable = {
MANAGED: 'managed',
};
/**
* A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder.
* @typedef {{
* id: string,
* parentId: (string|undefined),
* index: (number|undefined),
* url: (string|undefined),
* title: string,
* dateAdded: (number|undefined),
* dateGroupModified: (number|undefined),
* unmodifiable: (!chrome.bookmarks.BookmarkTreeNodeUnmodifiable|undefined),
* children: (!Array<!chrome.bookmarks.BookmarkTreeNode>|undefined)
* }}
* @see https://developer.chrome.com/extensions/bookmarks#type-BookmarkTreeNode
*/
chrome.bookmarks.BookmarkTreeNode;
/**
* Object passed to the create() function.
* @typedef {{
* parentId: (string|undefined),
* index: (number|undefined),
* title: (string|undefined),
* url: (string|undefined)
* }}
* @see https://developer.chrome.com/extensions/bookmarks#type-CreateDetails
*/
chrome.bookmarks.CreateDetails;
/**
* @type {number}
* @see https://developer.chrome.com/extensions/bookmarks#type-MAX_WRITE_OPERATIONS_PER_HOUR
*/
chrome.bookmarks.MAX_WRITE_OPERATIONS_PER_HOUR;
/**
* @type {number}
* @see https://developer.chrome.com/extensions/bookmarks#type-MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE
*/
chrome.bookmarks.MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE;
/**
* Retrieves the specified BookmarkTreeNode(s).
* @param {(string|!Array<string>)} idOrIdList A single string-valued id, or an
* array of string-valued ids
* @param {function(!Array<!chrome.bookmarks.BookmarkTreeNode>):void} callback
* @see https://developer.chrome.com/extensions/bookmarks#method-get
*/
chrome.bookmarks.get = function(idOrIdList, callback) {};
/**
* Retrieves the children of the specified BookmarkTreeNode id.
* @param {string} id
* @param {function(!Array<!chrome.bookmarks.BookmarkTreeNode>):void} callback
* @see https://developer.chrome.com/extensions/bookmarks#method-getChildren
*/
chrome.bookmarks.getChildren = function(id, callback) {};
/**
* Retrieves the recently added bookmarks.
* @param {number} numberOfItems The maximum number of items to return.
* @param {function(!Array<!chrome.bookmarks.BookmarkTreeNode>):void} callback
* @see https://developer.chrome.com/extensions/bookmarks#method-getRecent
*/
chrome.bookmarks.getRecent = function(numberOfItems, callback) {};
/**
* Retrieves the entire Bookmarks hierarchy.
* @param {function(!Array<!chrome.bookmarks.BookmarkTreeNode>):void} callback
* @see https://developer.chrome.com/extensions/bookmarks#method-getTree
*/
chrome.bookmarks.getTree = function(callback) {};
/**
* Retrieves part of the Bookmarks hierarchy, starting at the specified node.
* @param {string} id The ID of the root of the subtree to retrieve.
* @param {function(!Array<!chrome.bookmarks.BookmarkTreeNode>):void} callback
* @see https://developer.chrome.com/extensions/bookmarks#method-getSubTree
*/
chrome.bookmarks.getSubTree = function(id, callback) {};
/**
* Searches for BookmarkTreeNodes matching the given query. Queries specified
* with an object produce BookmarkTreeNodes matching all specified properties.
* @param {(string|{
* query: (string|undefined),
* url: (string|undefined),
* title: (string|undefined)
* })} query Either a string of words and quoted phrases that are matched
* against bookmark URLs and titles, or an object. If an object, the
* properties <code>query</code>, <code>url</code>, and <code>title</code>
* may be specified and bookmarks matching all specified properties will be
* produced.
* @param {function(!Array<!chrome.bookmarks.BookmarkTreeNode>):void} callback
* @see https://developer.chrome.com/extensions/bookmarks#method-search
*/
chrome.bookmarks.search = function(query, callback) {};
/**
* Creates a bookmark or folder under the specified parentId. If url is NULL or
* missing, it will be a folder.
* @param {!chrome.bookmarks.CreateDetails} bookmark
* @param {function(!chrome.bookmarks.BookmarkTreeNode):void=} callback
* @see https://developer.chrome.com/extensions/bookmarks#method-create
*/
chrome.bookmarks.create = function(bookmark, callback) {};
/**
* Moves the specified BookmarkTreeNode to the provided location.
* @param {string} id
* @param {{
* parentId: (string|undefined),
* index: (number|undefined)
* }} destination
* @param {function(!chrome.bookmarks.BookmarkTreeNode):void=} callback
* @see https://developer.chrome.com/extensions/bookmarks#method-move
*/
chrome.bookmarks.move = function(id, destination, callback) {};
/**
* Updates the properties of a bookmark or folder. Specify only the properties
* that you want to change; unspecified properties will be left unchanged.
* <b>Note:</b> Currently, only 'title' and 'url' are supported.
* @param {string} id
* @param {{
* title: (string|undefined),
* url: (string|undefined)
* }} changes
* @param {function(!chrome.bookmarks.BookmarkTreeNode):void=} callback
* @see https://developer.chrome.com/extensions/bookmarks#method-update
*/
chrome.bookmarks.update = function(id, changes, callback) {};
/**
* Removes a bookmark or an empty bookmark folder.
* @param {string} id
* @param {function():void=} callback
* @see https://developer.chrome.com/extensions/bookmarks#method-remove
*/
chrome.bookmarks.remove = function(id, callback) {};
/**
* Recursively removes a bookmark folder.
* @param {string} id
* @param {function():void=} callback
* @see https://developer.chrome.com/extensions/bookmarks#method-removeTree
*/
chrome.bookmarks.removeTree = function(id, callback) {};
/**
* Imports bookmarks from a chrome html bookmark file
* @param {function():void=} callback
* @see https://developer.chrome.com/extensions/bookmarks#method-import
*/
chrome.bookmarks.import = function(callback) {};
/**
* Exports bookmarks to a chrome html bookmark file
* @param {function():void=} callback
* @see https://developer.chrome.com/extensions/bookmarks#method-export
*/
chrome.bookmarks.export = function(callback) {};
/**
* Fired when a bookmark or folder is created.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/bookmarks#event-onCreated
*/
chrome.bookmarks.onCreated;
/**
* 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.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/bookmarks#event-onRemoved
*/
chrome.bookmarks.onRemoved;
/**
* Fired when a bookmark or folder changes. <b>Note:</b> Currently, only title
* and url changes trigger this.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/bookmarks#event-onChanged
*/
chrome.bookmarks.onChanged;
/**
* Fired when a bookmark or folder is moved to a different parent folder.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/bookmarks#event-onMoved
*/
chrome.bookmarks.onMoved;
/**
* 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().
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/bookmarks#event-onChildrenReordered
*/
chrome.bookmarks.onChildrenReordered;
/**
* 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.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/bookmarks#event-onImportBegan
*/
chrome.bookmarks.onImportBegan;
/**
* Fired when a bookmark import session is ended.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/bookmarks#event-onImportEnded
*/
chrome.bookmarks.onImportEnded;
// Copyright 2020 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 file.
// This file was generated by:
// tools/json_schema_compiler/compiler.py.
// NOTE: The format of types has changed. 'FooType' is now
// 'chrome.events.FooType'.
// Please run the closure compiler before committing changes.
// See https://chromium.googlesource.com/chromium/src/+/master/docs/closure_compilation.md
/** @fileoverview Externs generated from namespace: events */
/** @const */
chrome.events = {};
/**
* Description of a declarative rule for handling events.
* @typedef {{
* id: (string|undefined),
* tags: (!Array<string>|undefined),
* conditions: !Array<*>,
* actions: !Array<*>,
* priority: (number|undefined)
* }}
* @see https://developer.chrome.com/extensions/events#type-Rule
*/
chrome.events.Rule;
/**
* An object which allows the addition and removal of listeners for a Chrome event.
* @typedef {Object}
* @see https://developer.chrome.com/extensions/events#type-Event
*/
chrome.events.Event;
/**
* Filters URLs for various criteria. See <a href='events#filtered'>event filtering</a>. All criteria are case sensitive.
* @typedef {{
* hostContains: (string|undefined),
* hostEquals: (string|undefined),
* hostPrefix: (string|undefined),
* hostSuffix: (string|undefined),
* pathContains: (string|undefined),
* pathEquals: (string|undefined),
* pathPrefix: (string|undefined),
* pathSuffix: (string|undefined),
* queryContains: (string|undefined),
* queryEquals: (string|undefined),
* queryPrefix: (string|undefined),
* querySuffix: (string|undefined),
* urlContains: (string|undefined),
* urlEquals: (string|undefined),
* urlMatches: (string|undefined),
* originAndPathMatches: (string|undefined),
* urlPrefix: (string|undefined),
* urlSuffix: (string|undefined),
* schemes: (!Array<string>|undefined),
* ports: (!Array<(number|!Array<number>)>|undefined)
* }}
* @see https://developer.chrome.com/extensions/events#type-UrlFilter
*/
chrome.events.UrlFilter;
// Copyright 2020 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 file.
// This file was generated by:
// tools/json_schema_compiler/compiler.py.
// NOTE: The format of types has changed. 'FooType' is now
// 'chrome.extensionTypes.FooType'.
// Please run the closure compiler before committing changes.
// See https://chromium.googlesource.com/chromium/src/+/master/docs/closure_compilation.md
/** @fileoverview Externs generated from namespace: extensionTypes */
/** @const */
chrome.extensionTypes = {};
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/extensionTypes#type-ImageFormat
*/
chrome.extensionTypes.ImageFormat = {
JPEG: 'jpeg',
PNG: 'png',
};
/**
* Details about the format and quality of an image.
* @typedef {{
* format: (!chrome.extensionTypes.ImageFormat|undefined),
* quality: (number|undefined)
* }}
* @see https://developer.chrome.com/extensions/extensionTypes#type-ImageDetails
*/
chrome.extensionTypes.ImageDetails;
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/extensionTypes#type-RunAt
*/
chrome.extensionTypes.RunAt = {
DOCUMENT_START: 'document_start',
DOCUMENT_END: 'document_end',
DOCUMENT_IDLE: 'document_idle',
};
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/extensionTypes#type-CSSOrigin
*/
chrome.extensionTypes.CSSOrigin = {
AUTHOR: 'author',
USER: 'user',
};
/**
* 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.
* @typedef {{
* code: (string|undefined),
* file: (string|undefined),
* allFrames: (boolean|undefined),
* frameId: (number|undefined),
* matchAboutBlank: (boolean|undefined),
* runAt: (!chrome.extensionTypes.RunAt|undefined),
* cssOrigin: (!chrome.extensionTypes.CSSOrigin|undefined)
* }}
* @see https://developer.chrome.com/extensions/extensionTypes#type-InjectDetails
*/
chrome.extensionTypes.InjectDetails;
// Copyright 2020 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 file.
// This file was generated by:
// tools/json_schema_compiler/compiler.py.
// NOTE: The format of types has changed. 'FooType' is now
// 'chrome.runtime.FooType'.
// Please run the closure compiler before committing changes.
// See https://chromium.googlesource.com/chromium/src/+/master/docs/closure_compilation.md
// IMPORTANT NOTE: Work-around for crbug.com/543822
// s/chrome.runtime.events.Event/chrome.events.Event/
// s/chrome.runtime.tabs.Tab/chrome.tabs.Tab/
/** @fileoverview Externs generated from namespace: runtime */
/** @const */
chrome.runtime = {};
/**
* An object which allows two way communication with other pages. See <a href="messaging#connect">Long-lived connections</a> for more information.
* @constructor
* @private
* @see https://developer.chrome.com/extensions/runtime#type-Port
*/
chrome.runtime.Port = function() {};
/**
* The name of the port, as specified in the call to $(ref:runtime.connect).
* @type {string}
* @see https://developer.chrome.com/extensions/runtime#type-name
*/
chrome.runtime.Port.prototype.name;
/**
* Immediately disconnect the port. Calling <code>disconnect()</code> on an
* already-disconnected port has no effect. When a port is disconnected, no new
* events will be dispatched to this port.
* @see https://developer.chrome.com/extensions/runtime#method-disconnect
*/
chrome.runtime.Port.prototype.disconnect = function() {};
/**
* Fired when the port is disconnected from the other end(s). $(ref:runtime.lastError) may be set if the port was disconnected by an error. If the port is closed via $(ref:Port.disconnect disconnect), then this event is <em>only</em> fired on the other end. This event is fired at most once (see also <a href="messaging#port-lifetime">Port lifetime</a>). The first and only parameter to the event handler is this disconnected port.
* @type {!chrome.events.Event}
* @see https://developer.chrome.com/extensions/runtime#type-onDisconnect
*/
chrome.runtime.Port.prototype.onDisconnect;
/**
* This event is fired when $(ref:Port.postMessage postMessage) is called by the other end of the port. The first parameter is the message, the second parameter is the port that received the message.
* @type {!chrome.events.Event}
* @see https://developer.chrome.com/extensions/runtime#type-onMessage
*/
chrome.runtime.Port.prototype.onMessage;
/**
* Send a message to the other end of the port. If the port is disconnected, an
* error is thrown.
* @param {*} message The message to send. This object should be JSON-ifiable.
* @see https://developer.chrome.com/extensions/runtime#method-postMessage
*/
chrome.runtime.Port.prototype.postMessage = function(message) {};
/**
* This property will <b>only</b> be present on ports passed to $(ref:runtime.onConnect onConnect) / $(ref:runtime.onConnectExternal onConnectExternal) / $(ref:runtime.onConnectExternal onConnectNative) listeners.
* @type {(!chrome.runtime.MessageSender|undefined)}
* @see https://developer.chrome.com/extensions/runtime#type-sender
*/
chrome.runtime.Port.prototype.sender;
/**
* An object containing information about the script context that sent a message or request.
* @typedef {{
* tab: (!chrome.tabs.Tab|undefined),
* frameId: (number|undefined),
* guestProcessId: (number|undefined),
* guestRenderFrameRoutingId: (number|undefined),
* id: (string|undefined),
* url: (string|undefined),
* nativeApplication: (string|undefined),
* tlsChannelId: (string|undefined),
* origin: (string|undefined)
* }}
* @see https://developer.chrome.com/extensions/runtime#type-MessageSender
*/
chrome.runtime.MessageSender;
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/runtime#type-PlatformOs
*/
chrome.runtime.PlatformOs = {
MAC: 'mac',
WIN: 'win',
ANDROID: 'android',
CROS: 'cros',
LINUX: 'linux',
OPENBSD: 'openbsd',
};
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/runtime#type-PlatformArch
*/
chrome.runtime.PlatformArch = {
ARM: 'arm',
ARM64: 'arm64',
X86_32: 'x86-32',
X86_64: 'x86-64',
MIPS: 'mips',
MIPS64: 'mips64',
};
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/runtime#type-PlatformNaclArch
*/
chrome.runtime.PlatformNaclArch = {
ARM: 'arm',
X86_32: 'x86-32',
X86_64: 'x86-64',
MIPS: 'mips',
MIPS64: 'mips64',
};
/**
* An object containing information about the current platform.
* @typedef {{
* os: !chrome.runtime.PlatformOs,
* arch: !chrome.runtime.PlatformArch,
* nacl_arch: !chrome.runtime.PlatformNaclArch
* }}
* @see https://developer.chrome.com/extensions/runtime#type-PlatformInfo
*/
chrome.runtime.PlatformInfo;
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/runtime#type-RequestUpdateCheckStatus
*/
chrome.runtime.RequestUpdateCheckStatus = {
THROTTLED: 'throttled',
NO_UPDATE: 'no_update',
UPDATE_AVAILABLE: 'update_available',
};
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/runtime#type-OnInstalledReason
*/
chrome.runtime.OnInstalledReason = {
INSTALL: 'install',
UPDATE: 'update',
CHROME_UPDATE: 'chrome_update',
SHARED_MODULE_UPDATE: 'shared_module_update',
};
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/runtime#type-OnRestartRequiredReason
*/
chrome.runtime.OnRestartRequiredReason = {
APP_UPDATE: 'app_update',
OS_UPDATE: 'os_update',
PERIODIC: 'periodic',
};
/**
* This will be defined during an API method callback if there was an error
* @typedef {{
* message: (string|undefined)
* }}
* @see https://developer.chrome.com/extensions/runtime#type-lastError
*/
chrome.runtime.lastError;
/**
* The ID of the extension/app.
* @type {string}
* @see https://developer.chrome.com/extensions/runtime#type-id
*/
chrome.runtime.id;
/**
* 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.
* @param {function((Object|undefined)):void} callback
* @see https://developer.chrome.com/extensions/runtime#method-getBackgroundPage
*/
chrome.runtime.getBackgroundPage = function(callback) {};
/**
* <p>Open your Extension's options page, if possible.</p><p>The precise
* behavior may depend on your manifest's <code><a
* href="optionsV2">options_ui</a></code> or <code><a
* href="options">options_page</a></code> key, or what Chrome happens to support
* at the time. For example, the page may be opened in a new tab, within
* chrome://extensions, within an App, or it may just focus an open options
* page. It will never cause the caller page to reload.</p><p>If your Extension
* does not declare an options page, or Chrome failed to create one for some
* other reason, the callback will set $(ref:lastError).</p>
* @param {function():void=} callback
* @see https://developer.chrome.com/extensions/runtime#method-openOptionsPage
*/
chrome.runtime.openOptionsPage = function(callback) {};
/**
* Returns details about the app or extension from the manifest. The object
* returned is a serialization of the full <a href="manifest.html">manifest
* file</a>.
* @return {Object} The manifest details.
* @see https://developer.chrome.com/extensions/runtime#method-getManifest
*/
chrome.runtime.getManifest = function() {};
/**
* Converts a relative path within an app/extension install directory to a
* fully-qualified URL.
* @param {string} path A path to a resource within an app/extension expressed
* relative to its install directory.
* @return {string} The fully-qualified URL to the resource.
* @see https://developer.chrome.com/extensions/runtime#method-getURL
*/
chrome.runtime.getURL = function(path) {};
/**
* 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.
* @param {string} url 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.
* @param {function():void=} callback Called when the uninstall URL is set. If
* the given URL is invalid, $(ref:runtime.lastError) will be set.
* @see https://developer.chrome.com/extensions/runtime#method-setUninstallURL
*/
chrome.runtime.setUninstallURL = function(url, callback) {};
/**
* Reloads the app or extension. This method is not supported in kiosk mode. For
* kiosk mode, use chrome.runtime.restart() method.
* @see https://developer.chrome.com/extensions/runtime#method-reload
*/
chrome.runtime.reload = function() {};
/**
* <p>Requests an immediate update check be done for this app/extension.</p>
* <p><b>Important</b>: Most extensions/apps should <b>not</b> use this method,
* since chrome already does automatic checks every few hours, and you can
* listen for the $(ref:runtime.onUpdateAvailable) event without needing to call
* requestUpdateCheck.</p><p>This method is only appropriate to call in very
* limited circumstances, such as if your extension/app talks to a backend
* service, and the backend service has determined that the client extension/app
* version is very far out of date and you'd like to prompt a user to update.
* Most other uses of requestUpdateCheck, such as calling it unconditionally
* based on a repeating timer, probably only serve to waste client, network, and
* server resources.</p>
* @param {function(!chrome.runtime.RequestUpdateCheckStatus, ({
* version: string
* }|undefined)):void} callback
* @see https://developer.chrome.com/extensions/runtime#method-requestUpdateCheck
*/
chrome.runtime.requestUpdateCheck = function(callback) {};
/**
* Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's
* no-op.
* @see https://developer.chrome.com/extensions/runtime#method-restart
*/
chrome.runtime.restart = function() {};
/**
* Restart the ChromeOS device when the app runs in kiosk mode after the given
* seconds. If called again before the time ends, the reboot will be delayed. If
* called with a value of -1, the reboot will be cancelled. It's a no-op in
* non-kiosk mode. It's only allowed to be called repeatedly by the first
* extension to invoke this API.
* @param {number} seconds Time to wait in seconds before rebooting the device,
* or -1 to cancel a scheduled reboot.
* @param {function():void=} callback A callback to be invoked when a restart
* request was successfully rescheduled.
* @see https://developer.chrome.com/extensions/runtime#method-restartAfterDelay
*/
chrome.runtime.restartAfterDelay = function(seconds, callback) {};
/**
* 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 <a href="manifest/externally_connectable.html">web
* messaging</a>. 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).
* @param {string=} extensionId 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 <a
* href="manifest/externally_connectable.html">web messaging</a>.
* @param {{
* name: (string|undefined),
* includeTlsChannelId: (boolean|undefined)
* }=} connectInfo
* @return {!chrome.runtime.Port} Port through which messages can be sent and
* received. The port's $(ref:Port onDisconnect) event is fired if the
* extension/app does not exist.
* @see https://developer.chrome.com/extensions/runtime#method-connect
*/
chrome.runtime.connect = function(extensionId, connectInfo) {};
/**
* Connects to a native application in the host machine. See <a
* href="nativeMessaging">Native Messaging</a> for more information.
* @param {string} application The name of the registered application to connect
* to.
* @return {!chrome.runtime.Port} Port through which messages can be sent and
* received with the application
* @see https://developer.chrome.com/extensions/runtime#method-connectNative
*/
chrome.runtime.connectNative = function(application) {};
/**
* 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 every frame of your extension
* (except for the sender's frame), 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).
* @param {?string|undefined} extensionId 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 <a
* href="manifest/externally_connectable.html">web messaging</a>.
* @param {*} message The message to send. This message should be a JSON-ifiable
* object.
* @param {{
* includeTlsChannelId: (boolean|undefined)
* }=} options
* @param {function(*):void=} responseCallback
* @see https://developer.chrome.com/extensions/runtime#method-sendMessage
*/
chrome.runtime.sendMessage = function(extensionId, message, options, responseCallback) {};
/**
* Send a single message to a native application.
* @param {string} application The name of the native messaging host.
* @param {Object} message The message that will be passed to the native
* messaging host.
* @param {function(*):void=} responseCallback
* @see https://developer.chrome.com/extensions/runtime#method-sendNativeMessage
*/
chrome.runtime.sendNativeMessage = function(application, message, responseCallback) {};
/**
* Returns information about the current platform.
* @param {function(!chrome.runtime.PlatformInfo):void} callback Called with
* results
* @see https://developer.chrome.com/extensions/runtime#method-getPlatformInfo
*/
chrome.runtime.getPlatformInfo = function(callback) {};
/**
* Returns a DirectoryEntry for the package directory.
* @param {function(Object):void} callback
* @see https://developer.chrome.com/extensions/runtime#method-getPackageDirectoryEntry
*/
chrome.runtime.getPackageDirectoryEntry = function(callback) {};
/**
* Fired when a profile that has this extension installed first starts up. This
* event is not fired when an incognito profile is started, even if this
* extension is operating in 'split' incognito mode.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/runtime#event-onStartup
*/
chrome.runtime.onStartup;
/**
* Fired when the extension is first installed, when the extension is updated to
* a new version, and when Chrome is updated to a new version.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/runtime#event-onInstalled
*/
chrome.runtime.onInstalled;
/**
* 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.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/runtime#event-onSuspend
*/
chrome.runtime.onSuspend;
/**
* Sent after onSuspend to indicate that the app won't be unloaded after all.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/runtime#event-onSuspendCanceled
*/
chrome.runtime.onSuspendCanceled;
/**
* 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 chrome.runtime.reload(). If your
* extension is using a persistent background page, the background page of
* course never gets unloaded, so unless you call chrome.runtime.reload()
* manually in response to this event the update will not get installed until
* the next time chrome itself restarts. If no handlers are listening for this
* event, and your extension has a persistent background page, it behaves as if
* chrome.runtime.reload() is called in response to this event.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/runtime#event-onUpdateAvailable
*/
chrome.runtime.onUpdateAvailable;
/**
* Fired when a Chrome update is available, but isn't installed immediately
* because a browser restart is required.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/runtime#event-onBrowserUpdateAvailable
*/
chrome.runtime.onBrowserUpdateAvailable;
/**
* Fired when a connection is made from either an extension process or a content
* script (by $(ref:runtime.connect)).
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/runtime#event-onConnect
*/
chrome.runtime.onConnect;
/**
* Fired when a connection is made from another extension (by
* $(ref:runtime.connect)).
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/runtime#event-onConnectExternal
*/
chrome.runtime.onConnectExternal;
/**
* Fired when a connection is made from a native application. Currently only
* supported on Chrome OS.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/runtime#event-onConnectNative
*/
chrome.runtime.onConnectNative;
/**
* Fired when a message is sent from either an extension process (by
* $(ref:runtime.sendMessage)) or a content script (by $(ref:tabs.sendMessage)).
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/runtime#event-onMessage
*/
chrome.runtime.onMessage;
/**
* Fired when a message is sent from another extension/app (by
* $(ref:runtime.sendMessage)). Cannot be used in a content script.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/runtime#event-onMessageExternal
*/
chrome.runtime.onMessageExternal;
/**
* 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.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/runtime#event-onRestartRequired
*/
chrome.runtime.onRestartRequired;
// Copyright 2020 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 file.
// This file was generated by:
// tools/json_schema_compiler/compiler.py.
// NOTE: The format of types has changed. 'FooType' is now
// 'chrome.tabs.FooType'.
// Please run the closure compiler before committing changes.
// See https://chromium.googlesource.com/chromium/src/+/master/docs/closure_compilation.md
// IMPORTANT NOTE: Work-around for crbug.com/543822
// s/chrome.tabs.extensionTypes.ImageDetails/chrome.extensionTypes.ImageDetails/
// s/chrome.tabs.extensionTypes.InjectDetails/chrome.extensionTypes.InjectDetails/
// s/chrome.tabs.runtime.Port/chrome.runtime.Port/
// s/chrome.tabs.windows.Window/chrome.windows.Window/
/** @fileoverview Externs generated from namespace: tabs */
/** @const */
chrome.tabs = {};
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/tabs#type-TabStatus
*/
chrome.tabs.TabStatus = {
UNLOADED: 'unloaded',
LOADING: 'loading',
COMPLETE: 'complete',
};
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/tabs#type-MutedInfoReason
*/
chrome.tabs.MutedInfoReason = {
USER: 'user',
CAPTURE: 'capture',
EXTENSION: 'extension',
};
/**
* The tab's muted state and the reason for the last state change.
* @typedef {{
* muted: boolean,
* reason: (!chrome.tabs.MutedInfoReason|undefined),
* extensionId: (string|undefined)
* }}
* @see https://developer.chrome.com/extensions/tabs#type-MutedInfo
*/
chrome.tabs.MutedInfo;
/**
* @typedef {{
* id: (number|undefined),
* index: number,
* windowId: number,
* openerTabId: (number|undefined),
* selected: boolean,
* highlighted: boolean,
* active: boolean,
* pinned: boolean,
* audible: (boolean|undefined),
* discarded: boolean,
* autoDiscardable: boolean,
* mutedInfo: (!chrome.tabs.MutedInfo|undefined),
* url: (string|undefined),
* pendingUrl: (string|undefined),
* title: (string|undefined),
* favIconUrl: (string|undefined),
* status: (!chrome.tabs.TabStatus|undefined),
* incognito: boolean,
* width: (number|undefined),
* height: (number|undefined),
* sessionId: (string|undefined)
* }}
* @see https://developer.chrome.com/extensions/tabs#type-Tab
*/
chrome.tabs.Tab;
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/tabs#type-ZoomSettingsMode
*/
chrome.tabs.ZoomSettingsMode = {
AUTOMATIC: 'automatic',
MANUAL: 'manual',
DISABLED: 'disabled',
};
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/tabs#type-ZoomSettingsScope
*/
chrome.tabs.ZoomSettingsScope = {
PER_ORIGIN: 'per-origin',
PER_TAB: 'per-tab',
};
/**
* Defines how zoom changes in a tab are handled and at what scope.
* @typedef {{
* mode: (!chrome.tabs.ZoomSettingsMode|undefined),
* scope: (!chrome.tabs.ZoomSettingsScope|undefined),
* defaultZoomFactor: (number|undefined)
* }}
* @see https://developer.chrome.com/extensions/tabs#type-ZoomSettings
*/
chrome.tabs.ZoomSettings;
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/tabs#type-WindowType
*/
chrome.tabs.WindowType = {
NORMAL: 'normal',
POPUP: 'popup',
PANEL: 'panel',
APP: 'app',
DEVTOOLS: 'devtools',
};
/**
* An ID that represents the absence of a browser tab.
* @type {number}
* @see https://developer.chrome.com/extensions/tabs#type-TAB_ID_NONE
*/
chrome.tabs.TAB_ID_NONE;
/**
* Retrieves details about the specified tab.
* @param {number} tabId
* @param {function(!chrome.tabs.Tab):void} callback
* @see https://developer.chrome.com/extensions/tabs#method-get
*/
chrome.tabs.get = function(tabId, callback) {};
/**
* 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).
* @param {function((!chrome.tabs.Tab|undefined)):void} callback
* @see https://developer.chrome.com/extensions/tabs#method-getCurrent
*/
chrome.tabs.getCurrent = function(callback) {};
/**
* 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 <a
* href='messaging'>Content Script Messaging</a>.
* @param {number} tabId
* @param {{
* name: (string|undefined),
* frameId: (number|undefined)
* }=} connectInfo
* @return {!chrome.runtime.Port} 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.
* @see https://developer.chrome.com/extensions/tabs#method-connect
*/
chrome.tabs.connect = function(tabId, connectInfo) {};
/**
* Sends a single request to the content script(s) in the specified tab, with an
* optional callback to run when a response is sent back. The
* $(ref:extension.onRequest) event is fired in each content script running in
* the specified tab for the current extension.
* @param {number} tabId
* @param {*} request
* @param {function(*):void=} responseCallback
* @deprecated Please use $(ref:runtime.sendMessage).
* @see https://developer.chrome.com/extensions/tabs#method-sendRequest
*/
chrome.tabs.sendRequest = function(tabId, request, responseCallback) {};
/**
* 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.
* @param {number} tabId
* @param {*} message The message to send. This message should be a JSON-ifiable
* object.
* @param {{
* frameId: (number|undefined)
* }=} options
* @param {function(*):void=} responseCallback
* @see https://developer.chrome.com/extensions/tabs#method-sendMessage
*/
chrome.tabs.sendMessage = function(tabId, message, options, responseCallback) {};
/**
* Gets the tab that is selected in the specified window.
* @param {?number|undefined} windowId Defaults to the <a
* href='windows#current-window'>current window</a>.
* @param {function(!chrome.tabs.Tab):void} callback
* @deprecated Please use $(ref:tabs.query) <code>{active: true}</code>.
* @see https://developer.chrome.com/extensions/tabs#method-getSelected
*/
chrome.tabs.getSelected = function(windowId, callback) {};
/**
* Gets details about all tabs in the specified window.
* @param {?number|undefined} windowId Defaults to the <a
* href='windows#current-window'>current window</a>.
* @param {function(!Array<!chrome.tabs.Tab>):void} callback
* @deprecated Please use $(ref:tabs.query) <code>{windowId: windowId}</code>.
* @see https://developer.chrome.com/extensions/tabs#method-getAllInWindow
*/
chrome.tabs.getAllInWindow = function(windowId, callback) {};
/**
* Creates a new tab.
* @param {{
* windowId: (number|undefined),
* index: (number|undefined),
* url: (string|undefined),
* active: (boolean|undefined),
* selected: (boolean|undefined),
* pinned: (boolean|undefined),
* openerTabId: (number|undefined)
* }} createProperties
* @param {function(!chrome.tabs.Tab):void=} callback
* @see https://developer.chrome.com/extensions/tabs#method-create
*/
chrome.tabs.create = function(createProperties, callback) {};
/**
* Duplicates a tab.
* @param {number} tabId The ID of the tab to duplicate.
* @param {function((!chrome.tabs.Tab|undefined)):void=} callback
* @see https://developer.chrome.com/extensions/tabs#method-duplicate
*/
chrome.tabs.duplicate = function(tabId, callback) {};
/**
* Gets all tabs that have the specified properties, or all tabs if no
* properties are specified.
* @param {{
* active: (boolean|undefined),
* pinned: (boolean|undefined),
* audible: (boolean|undefined),
* muted: (boolean|undefined),
* highlighted: (boolean|undefined),
* discarded: (boolean|undefined),
* autoDiscardable: (boolean|undefined),
* currentWindow: (boolean|undefined),
* lastFocusedWindow: (boolean|undefined),
* status: (!chrome.tabs.TabStatus|undefined),
* title: (string|undefined),
* url: ((string|!Array<string>)|undefined),
* windowId: (number|undefined),
* windowType: (!chrome.tabs.WindowType|undefined),
* index: (number|undefined)
* }} queryInfo
* @param {function(!Array<!chrome.tabs.Tab>):void} callback
* @see https://developer.chrome.com/extensions/tabs#method-query
*/
chrome.tabs.query = function(queryInfo, callback) {};
/**
* Highlights the given tabs and focuses on the first of group. Will appear to
* do nothing if the specified tab is currently active.
* @param {{
* windowId: (number|undefined),
* tabs: (!Array<number>|number)
* }} highlightInfo
* @param {function(!chrome.windows.Window):void=} callback
* @see https://developer.chrome.com/extensions/tabs#method-highlight
*/
chrome.tabs.highlight = function(highlightInfo, callback) {};
/**
* Modifies the properties of a tab. Properties that are not specified in
* <var>updateProperties</var> are not modified.
* @param {?number|undefined} tabId Defaults to the selected tab of the <a
* href='windows#current-window'>current window</a>.
* @param {{
* url: (string|undefined),
* active: (boolean|undefined),
* highlighted: (boolean|undefined),
* selected: (boolean|undefined),
* pinned: (boolean|undefined),
* muted: (boolean|undefined),
* openerTabId: (number|undefined),
* autoDiscardable: (boolean|undefined)
* }} updateProperties
* @param {function((!chrome.tabs.Tab|undefined)):void=} callback
* @see https://developer.chrome.com/extensions/tabs#method-update
*/
chrome.tabs.update = function(tabId, updateProperties, callback) {};
/**
* 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.
* @param {(number|!Array<number>)} tabIds The tab ID or list of tab IDs to
* move.
* @param {{
* windowId: (number|undefined),
* index: number
* }} moveProperties
* @param {function((!chrome.tabs.Tab|!Array<!chrome.tabs.Tab>)):void=} callback
* @see https://developer.chrome.com/extensions/tabs#method-move
*/
chrome.tabs.move = function(tabIds, moveProperties, callback) {};
/**
* Reload a tab.
* @param {number=} tabId The ID of the tab to reload; defaults to the selected
* tab of the current window.
* @param {{
* bypassCache: (boolean|undefined)
* }=} reloadProperties
* @param {function():void=} callback
* @see https://developer.chrome.com/extensions/tabs#method-reload
*/
chrome.tabs.reload = function(tabId, reloadProperties, callback) {};
/**
* Closes one or more tabs.
* @param {(number|!Array<number>)} tabIds The tab ID or list of tab IDs to
* close.
* @param {function():void=} callback
* @see https://developer.chrome.com/extensions/tabs#method-remove
*/
chrome.tabs.remove = function(tabIds, callback) {};
/**
* Detects the primary language of the content in a tab.
* @param {?number|undefined} tabId Defaults to the active tab of the <a
* href='windows#current-window'>current window</a>.
* @param {function(string):void} callback
* @see https://developer.chrome.com/extensions/tabs#method-detectLanguage
*/
chrome.tabs.detectLanguage = function(tabId, callback) {};
/**
* Captures the visible area of the currently active tab in the specified
* window. In order to call this method, the extension must have either the <a
* href='declare_permissions'>&lt;all_urls&gt;</a> permission or the <a
* href='activeTab'>activeTab</a> permission. In addition to sites that
* extensions can normally access, this method allows extensions to capture
* sensitive sites that are otherwise restricted, including chrome:-scheme
* pages, other extensions' pages, and data: URLs. These sensitive sites can
* only be captured with the activeTab permission. File URLs may be captured
* only if the extension has been granted file access.
* @param {?number|undefined} windowId The target window. Defaults to the <a
* href='windows#current-window'>current window</a>.
* @param {?chrome.extensionTypes.ImageDetails|undefined} options
* @param {function(string):void} callback
* @see https://developer.chrome.com/extensions/tabs#method-captureVisibleTab
*/
chrome.tabs.captureVisibleTab = function(windowId, options, callback) {};
/**
* Injects JavaScript code into a page. For details, see the <a
* href='content_scripts#pi'>programmatic injection</a> section of the content
* scripts doc.
* @param {?number|undefined} tabId The ID of the tab in which to run the
* script; defaults to the active tab of the current window.
* @param {!chrome.extensionTypes.InjectDetails} details Details of the
* script to run. Either the code or the file property must be set, but both
* may not be set at the same time.
* @param {function((!Array<*>|undefined)):void=} callback Called after all the
* JavaScript has been executed.
* @see https://developer.chrome.com/extensions/tabs#method-executeScript
*/
chrome.tabs.executeScript = function(tabId, details, callback) {};
/**
* Injects CSS into a page. For details, see the <a
* href='content_scripts#pi'>programmatic injection</a> section of the content
* scripts doc.
* @param {?number|undefined} tabId The ID of the tab in which to insert the
* CSS; defaults to the active tab of the current window.
* @param {!chrome.extensionTypes.InjectDetails} details Details of the CSS
* text to insert. Either the code or the file property must be set, but
* both may not be set at the same time.
* @param {function():void=} callback Called when all the CSS has been inserted.
* @see https://developer.chrome.com/extensions/tabs#method-insertCSS
*/
chrome.tabs.insertCSS = function(tabId, details, callback) {};
/**
* Zooms a specified tab.
* @param {?number|undefined} tabId The ID of the tab to zoom; defaults to the
* active tab of the current window.
* @param {number} zoomFactor The new zoom factor. A value of <code>0</code>
* sets the tab to its current default zoom factor. Values greater than
* <code>0</code> specify a (possibly non-default) zoom factor for the tab.
* @param {function():void=} callback Called after the zoom factor has been
* changed.
* @see https://developer.chrome.com/extensions/tabs#method-setZoom
*/
chrome.tabs.setZoom = function(tabId, zoomFactor, callback) {};
/**
* Gets the current zoom factor of a specified tab.
* @param {?number|undefined} tabId The ID of the tab to get the current zoom
* factor from; defaults to the active tab of the current window.
* @param {function(number):void} callback Called with the tab's current zoom
* factor after it has been fetched.
* @see https://developer.chrome.com/extensions/tabs#method-getZoom
*/
chrome.tabs.getZoom = function(tabId, callback) {};
/**
* 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.
* @param {?number|undefined} tabId The ID of the tab to change the zoom
* settings for; defaults to the active tab of the current window.
* @param {!chrome.tabs.ZoomSettings} zoomSettings Defines how zoom changes are
* handled and at what scope.
* @param {function():void=} callback Called after the zoom settings are
* changed.
* @see https://developer.chrome.com/extensions/tabs#method-setZoomSettings
*/
chrome.tabs.setZoomSettings = function(tabId, zoomSettings, callback) {};
/**
* Gets the current zoom settings of a specified tab.
* @param {?number|undefined} tabId The ID of the tab to get the current zoom
* settings from; defaults to the active tab of the current window.
* @param {function(!chrome.tabs.ZoomSettings):void} callback Called with the
* tab's current zoom settings.
* @see https://developer.chrome.com/extensions/tabs#method-getZoomSettings
*/
chrome.tabs.getZoomSettings = function(tabId, callback) {};
/**
* Discards a tab from memory. Discarded tabs are still visible on the tab strip
* and are reloaded when activated.
* @param {number=} tabId The ID of the tab to be discarded. If specified, the
* tab is discarded unless it is active or already discarded. If omitted,
* the browser discards the least important tab. This can fail if no
* discardable tabs exist.
* @param {function((!chrome.tabs.Tab|undefined)):void=} callback Called after
* the operation is completed.
* @see https://developer.chrome.com/extensions/tabs#method-discard
*/
chrome.tabs.discard = function(tabId, callback) {};
/**
* Go foward to the next page, if one is available.
* @param {number=} tabId The ID of the tab to navigate forward; defaults to the
* selected tab of the current window.
* @param {function():void=} callback
* @see https://developer.chrome.com/extensions/tabs#method-goForward
*/
chrome.tabs.goForward = function(tabId, callback) {};
/**
* Go back to the previous page, if one is available.
* @param {number=} tabId The ID of the tab to navigate back; defaults to the
* selected tab of the current window.
* @param {function():void=} callback
* @see https://developer.chrome.com/extensions/tabs#method-goBack
*/
chrome.tabs.goBack = function(tabId, callback) {};
/**
* Fired when a tab is created. Note that the tab's URL may not be set at the
* time this event is fired, but you can listen to onUpdated events so as to be
* notified when a URL is set.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/tabs#event-onCreated
*/
chrome.tabs.onCreated;
/**
* Fired when a tab is updated.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/tabs#event-onUpdated
*/
chrome.tabs.onUpdated;
/**
* 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 to the manually-moved tab. This
* event is not fired when a tab is moved between windows; for details, see
* $(ref:tabs.onDetached).
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/tabs#event-onMoved
*/
chrome.tabs.onMoved;
/**
* Fires when the selected tab in a window changes.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/tabs#event-onSelectionChanged
*/
chrome.tabs.onSelectionChanged;
/**
* Fires when the selected 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
* $(ref:tabs.onUpdated) events so as to be notified when a URL is set.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/tabs#event-onActiveChanged
*/
chrome.tabs.onActiveChanged;
/**
* 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 so as to be notified when a URL is set.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/tabs#event-onActivated
*/
chrome.tabs.onActivated;
/**
* Fired when the highlighted or selected tabs in a window changes.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/tabs#event-onHighlightChanged
*/
chrome.tabs.onHighlightChanged;
/**
* Fired when the highlighted or selected tabs in a window changes.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/tabs#event-onHighlighted
*/
chrome.tabs.onHighlighted;
/**
* Fired when a tab is detached from a window; for example, because it was moved
* between windows.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/tabs#event-onDetached
*/
chrome.tabs.onDetached;
/**
* Fired when a tab is attached to a window; for example, because it was moved
* between windows.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/tabs#event-onAttached
*/
chrome.tabs.onAttached;
/**
* Fired when a tab is closed.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/tabs#event-onRemoved
*/
chrome.tabs.onRemoved;
/**
* Fired when a tab is replaced with another tab due to prerendering or instant.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/tabs#event-onReplaced
*/
chrome.tabs.onReplaced;
/**
* Fired when a tab is zoomed.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/tabs#event-onZoomChange
*/
chrome.tabs.onZoomChange;
// Copyright 2020 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 file.
// This file was generated by:
// tools/json_schema_compiler/compiler.py.
// NOTE: The format of types has changed. 'FooType' is now
// 'chrome.windows.FooType'.
// Please run the closure compiler before committing changes.
// See https://chromium.googlesource.com/chromium/src/+/master/docs/closure_compilation.md
// IMPORTANT NOTE: Work-around for crbug.com/543822
// s/chrome.windows.tabs.Tab/chrome.tabs.Tab/
/** @fileoverview Externs generated from namespace: windows */
/** @const */
chrome.windows = {};
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/windows#type-WindowType
*/
chrome.windows.WindowType = {
NORMAL: 'normal',
POPUP: 'popup',
PANEL: 'panel',
APP: 'app',
DEVTOOLS: 'devtools',
};
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/windows#type-WindowState
*/
chrome.windows.WindowState = {
NORMAL: 'normal',
MINIMIZED: 'minimized',
MAXIMIZED: 'maximized',
FULLSCREEN: 'fullscreen',
LOCKED_FULLSCREEN: 'locked-fullscreen',
};
/**
* @typedef {{
* id: (number|undefined),
* focused: boolean,
* top: (number|undefined),
* left: (number|undefined),
* width: (number|undefined),
* height: (number|undefined),
* tabs: (!Array<!chrome.tabs.Tab>|undefined),
* incognito: boolean,
* type: (!chrome.windows.WindowType|undefined),
* state: (!chrome.windows.WindowState|undefined),
* alwaysOnTop: boolean,
* sessionId: (string|undefined)
* }}
* @see https://developer.chrome.com/extensions/windows#type-Window
*/
chrome.windows.Window;
/**
* @enum {string}
* @see https://developer.chrome.com/extensions/windows#type-CreateType
*/
chrome.windows.CreateType = {
NORMAL: 'normal',
POPUP: 'popup',
PANEL: 'panel',
};
/**
* The windowId value that represents the absence of a chrome browser window.
* @type {number}
* @see https://developer.chrome.com/extensions/windows#type-WINDOW_ID_NONE
*/
chrome.windows.WINDOW_ID_NONE;
/**
* The windowId value that represents the <a href='windows#current-window'>current window</a>.
* @type {number}
* @see https://developer.chrome.com/extensions/windows#type-WINDOW_ID_CURRENT
*/
chrome.windows.WINDOW_ID_CURRENT;
/**
* Gets details about a window.
* @param {number} windowId
* @param {?{
populate: (boolean|undefined),
windowTypes: (!Array<!chrome.windows.WindowType>|undefined)
}|undefined}
* getInfo
* @param {function(!chrome.windows.Window):void} callback
* @see https://developer.chrome.com/extensions/windows#method-get
*/
chrome.windows.get = function(windowId, getInfo, callback) {};
/**
* Gets the <a href='#current-window'>current window</a>.
* @param {?{
populate: (boolean|undefined),
windowTypes: (!Array<!chrome.windows.WindowType>|undefined)
}|undefined}
* getInfo
* @param {function(!chrome.windows.Window):void} callback
* @see https://developer.chrome.com/extensions/windows#method-getCurrent
*/
chrome.windows.getCurrent = function(getInfo, callback) {};
/**
* Gets the window that was most recently focused &mdash; typically the window
* 'on top'.
* @param {?{
populate: (boolean|undefined),
windowTypes: (!Array<!chrome.windows.WindowType>|undefined)
}|undefined}
* getInfo
* @param {function(!chrome.windows.Window):void} callback
* @see https://developer.chrome.com/extensions/windows#method-getLastFocused
*/
chrome.windows.getLastFocused = function(getInfo, callback) {};
/**
* Gets all windows.
* @param {?{
populate: (boolean|undefined),
windowTypes: (!Array<!chrome.windows.WindowType>|undefined)
}|undefined}
* getInfo
* @param {function(!Array<!chrome.windows.Window>):void} callback
* @see https://developer.chrome.com/extensions/windows#method-getAll
*/
chrome.windows.getAll = function(getInfo, callback) {};
/**
* Creates (opens) a new browser window with any optional sizing, position, or
* default URL provided.
* @param {{
* url: ((string|!Array<string>)|undefined),
* tabId: (number|undefined),
* left: (number|undefined),
* top: (number|undefined),
* width: (number|undefined),
* height: (number|undefined),
* focused: (boolean|undefined),
* incognito: (boolean|undefined),
* type: (!chrome.windows.CreateType|undefined),
* state: (!chrome.windows.WindowState|undefined),
* setSelfAsOpener: (boolean|undefined)
* }=} createData
* @param {function((!chrome.windows.Window|undefined)):void=} callback
* @see https://developer.chrome.com/extensions/windows#method-create
*/
chrome.windows.create = function(createData, callback) {};
/**
* Updates the properties of a window. Specify only the properties that to be
* changed; unspecified properties are unchanged.
* @param {number} windowId
* @param {{
* left: (number|undefined),
* top: (number|undefined),
* width: (number|undefined),
* height: (number|undefined),
* focused: (boolean|undefined),
* drawAttention: (boolean|undefined),
* state: (!chrome.windows.WindowState|undefined)
* }} updateInfo
* @param {function(!chrome.windows.Window):void=} callback
* @see https://developer.chrome.com/extensions/windows#method-update
*/
chrome.windows.update = function(windowId, updateInfo, callback) {};
/**
* Removes (closes) a window and all the tabs inside it.
* @param {number} windowId
* @param {function():void=} callback
* @see https://developer.chrome.com/extensions/windows#method-remove
*/
chrome.windows.remove = function(windowId, callback) {};
/**
* Fired when a window is created.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/windows#event-onCreated
*/
chrome.windows.onCreated;
/**
* Fired when a window is removed (closed).
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/windows#event-onRemoved
*/
chrome.windows.onRemoved;
/**
* Fired when the currently focused window changes. Returns
* <code>chrome.windows.WINDOW_ID_NONE</code> if all Chrome windows have lost
* focus. <b>Note:</b> On some Linux window managers,
* <code>WINDOW_ID_NONE</code> is always sent immediately preceding a switch
* from one Chrome window to another.
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/windows#event-onFocusChanged
*/
chrome.windows.onFocusChanged;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment