diff --git a/chrome/chrome-app.d.ts b/chrome/chrome-app.d.ts index 0152b74721..b82f5b2e43 100644 --- a/chrome/chrome-app.d.ts +++ b/chrome/chrome-app.d.ts @@ -85,7 +85,7 @@ declare module chrome.app.window { frame?: any; // string ("none", "chrome") or FrameOptions bounds?: ContentBounds; alphaEnabled?: boolean; - state?: string; // "normal", "fullscreen", "maximized", "minimized" + state?: string; // "normal", "fullscreen", "maximized", "minimized" hidden?: boolean; resizable?: boolean; singleton?: boolean; @@ -347,6 +347,91 @@ declare module chrome.sockets.tcpServer { var onAcceptError: chrome.events.Event<(args: AcceptErrorEventArgs) => void>; } +//////////////////// +// System Display +//////////////////// +/** + * Use the system.display API to query display metadata. + * Permissions: "system.display" + * @since Chrome 30. + */ +declare module chrome.system.display { + interface Bounds { + /** The x-coordinate of the upper-left corner. */ + left: number; + /** The y-coordinate of the upper-left corner. */ + top: number; + /** The width of the display in pixels. */ + width: number; + /** The height of the display in pixels. */ + height: number; + } + + interface Insets { + /** The x-axis distance from the left bound. */ + left: number; + /** The y-axis distance from the top bound. */ + top: number; + /** The x-axis distance from the right bound. */ + right: number; + /** The y-axis distance from the bottom bound. */ + bottom: number; + } + + interface DisplayInfo { + /** The unique identifier of the display. */ + id: string; + /** The user-friendly name (e.g. "HP LCD monitor"). */ + name: string; + /** Identifier of the display that is being mirrored on the display unit. If mirroring is not in progress, set to an empty string. Currently exposed only on ChromeOS. Will be empty string on other platforms. */ + mirroringSourceId: string; + /** True if this is the primary display. */ + isPrimary: boolean; + /** True if this is an internal display. */ + isInternal: boolean; + /** True if this display is enabled. */ + isEnabled: boolean; + /** The number of pixels per inch along the x-axis. */ + dpiX: number; + /** The number of pixels per inch along the y-axis. */ + dpiY: number; + /** The display's clockwise rotation in degrees relative to the vertical position. Currently exposed only on ChromeOS. Will be set to 0 on other platforms. */ + rotation: number; + /** The display's logical bounds. */ + bounds: Bounds; + /** The display's insets within its screen's bounds. Currently exposed only on ChromeOS. Will be set to empty insets on other platforms. */ + overscan: Insets; + /** The usable work area of the display within the display bounds. The work area excludes areas of the display reserved for OS, for example taskbar and launcher. */ + workArea: Bounds; + } + + /** The information about display properties that should be changed. A property will be changed only if a new value for it is specified in |info|. */ + interface DisplayProps { + /** If set and not empty, starts mirroring between this and the display with the provided id (the system will determine which of the displays is actually mirrored). If set and not empty, stops mirroring between this and the display with the specified id (if mirroring is in progress). If set, no other parameter may be set. */ + mirroringSourceId?: string; + /** If set to true, makes the display primary. No-op if set to false. */ + isPrimary?: boolean; + /** If set, sets the display's overscan insets to the provided values. Note that overscan values may not be negative or larger than a half of the screen's size. Overscan cannot be changed on the internal monitor. It's applied after isPrimary parameter. */ + overscan?: Insets; + /** If set, updates the display's rotation. Legal values are [0, 90, 180, 270]. The rotation is set clockwise, relative to the display's vertical position. It's applied after overscan paramter. */ + rotation?: number; + /** If set, updates the display's logical bounds origin along x-axis. Applied together with boundsOriginY, if boundsOriginY is set. Note that, when updating the display origin, some constraints will be applied, so the final bounds origin may be different than the one set. The final bounds can be retrieved using getInfo. The bounds origin is applied after rotation. The bounds origin cannot be changed on the primary display. Note that is also invalid to set bounds origin values if isPrimary is also set (as isPrimary parameter is applied first). */ + boundsOriginX?: number; + /** If set, updates the display's logical bounds origin along y-axis. See documentation for boundsOriginX parameter. */ + boundsOriginY?: number; + } + + interface DisplayChangedEvent extends chrome.events.Event<() => void> { } + + /** Queries basic CPU information of the system. */ + export function getInfo(callback: (info: DisplayInfo[]) => void): void; + + /** Updates the properties for the display specified by |id|, according to the information provided in |info|. On failure, runtime.lastError will be set. */ + export function setDisplayProperties(id: string, info: DisplayInfo, callback?: () => void): void; + + export var onDisplayChanged: DisplayChangedEvent; +} + //////////////////// // System - Network //////////////////// diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index d10fab1f7a..fccb84895e 100755 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -1,6 +1,6 @@ // Type definitions for Chrome extension development // Project: http://developer.chrome.com/extensions/ -// Definitions by: Matthew Kimber , otiai10 , couven92 +// Definitions by: Matthew Kimber , otiai10 , couven92 , RReverser // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -18,7 +18,7 @@ interface Window { //////////////////// /** * Use the chrome.accessibilityFeatures API to manage Chrome's accessibility features. This API relies on the ChromeSetting prototype of the type API for getting and setting individual accessibility features. In order to get feature states the extension must request accessibilityFeatures.read permission. For modifying feature state, the extension needs accessibilityFeatures.modify permission. Note that accessibilityFeatures.modify does not imply accessibilityFeatures.read permission. - * Availability: Since Chrome 37. + * Availability: Since Chrome 37. * Permissions: "accessibilityFeatures.read" * Important: This API works only on Chrome OS. */ @@ -45,8 +45,8 @@ declare module chrome.accessibilityFeatures { interface AccessibilityFeaturesSetArg { /** - * 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. + * 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. */ value: any; /** @@ -112,7 +112,7 @@ declare module chrome.accessibilityFeatures { // Alarms //////////////////// /** - * Use the chrome.alarms API to schedule code to run periodically or at a specified time in the future. + * Use the chrome.alarms API to schedule code to run periodically or at a specified time in the future. * Availability: Since Chrome 22. * Permissions: "alarms" */ @@ -141,53 +141,53 @@ declare module chrome.alarms { * Creates an alarm. Near the time(s) specified by alarmInfo, 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. * In order to reduce the load on the user's machine, Chrome limits alarms to at most once every 1 minute but may delay them an arbitrary amount more. That is, setting delayInMinutes or periodInMinutes to less than 1 will not be honored and will cause a warning. when can be set to less than 1 minute after "now" without warning but won't actually cause the alarm to fire for at least 1 minute. * To help you debug your app or extension, when you've loaded it unpacked, there's no limit to how often the alarm can fire. - * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes. + * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes. */ export function create(alarmInfo: AlarmCreateInfo): void; /** * Creates an alarm. Near the time(s) specified by alarmInfo, 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. * In order to reduce the load on the user's machine, Chrome limits alarms to at most once every 1 minute but may delay them an arbitrary amount more. That is, setting delayInMinutes or periodInMinutes to less than 1 will not be honored and will cause a warning. when can be set to less than 1 minute after "now" without warning but won't actually cause the alarm to fire for at least 1 minute. * To help you debug your app or extension, when you've loaded it unpacked, there's no limit to how often the alarm can fire. - * @param name Optional name to identify this alarm. Defaults to the empty string. - * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes. + * @param name Optional name to identify this alarm. Defaults to the empty string. + * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes. */ export function create(name: string, alarmInfo: AlarmCreateInfo): void; /** - * Gets an array of all the alarms. + * Gets an array of all the alarms. * @param callback The callback parameter should be a function that looks like this: - * function(array of Alarm alarms) {...}; + * function(array of Alarm alarms) {...}; */ export function getAll(callback: (alarms: Alarm[]) => void): void; /** - * Clears all alarms. + * Clears all alarms. * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function(boolean wasCleared) {...}; + * function(boolean wasCleared) {...}; */ export function clearAll(callback?: (wasCleared: boolean) => void): void; /** - * Clears the alarm with the given name. - * @param name The name of the alarm to clear. Defaults to the empty string. + * Clears the alarm with the given name. + * @param name The name of the alarm to clear. Defaults to the empty string. * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function(boolean wasCleared) {...}; + * function(boolean wasCleared) {...}; */ export function clear(name?: string, callback?: (wasCleared: boolean) => void): void; /** - * Clears the alarm without a name. + * Clears the alarm without a name. * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function(boolean wasCleared) {...}; + * function(boolean wasCleared) {...}; */ export function clear(callback: (wasCleared: boolean) => void): void; /** - * Retrieves details about the specified alarm. + * Retrieves details about the specified alarm. * @param callback The callback parameter should be a function that looks like this: - * function( Alarm alarm) {...}; + * function( Alarm alarm) {...}; */ export function get(callback: (alarm: Alarm) => void): void; /** - * Retrieves details about the specified alarm. + * Retrieves details about the specified alarm. * @param name The name of the alarm to get. Defaults to the empty string. * @param callback The callback parameter should be a function that looks like this: - * function( Alarm alarm) {...}; + * function( Alarm alarm) {...}; */ export function get(name: string, callback: (alarm: Alarm) => void): void; @@ -196,30 +196,30 @@ declare module chrome.alarms { } /** - * Use the chrome.browser API to interact with the Chrome browser associated with - * the current application and Chrome profile. + * Use the chrome.browser API to interact with the Chrome browser associated with + * the current application and Chrome profile. */ declare module chrome.browser { interface Options { /** The URL to navigate to when the new tab is initially opened. */ url: string; } - + /** - * Opens a new tab in a browser window associated with the current application - * and Chrome profile. If no browser window for the Chrome profile is opened, - * a new one is opened prior to creating the new tab. - * @param options Configures how the tab should be opened. - * @param callback Called when the tab was successfully + * Opens a new tab in a browser window associated with the current application + * and Chrome profile. If no browser window for the Chrome profile is opened, + * a new one is opened prior to creating the new tab. + * @param options Configures how the tab should be opened. + * @param callback Called when the tab was successfully * created, or failed to be created. If failed, runtime.lastError will be set. */ export function openTab(options: Options, callback: () => void): void; - + /** - * Opens a new tab in a browser window associated with the current application - * and Chrome profile. If no browser window for the Chrome profile is opened, - * a new one is opened prior to creating the new tab. Since Chrome 42 only. - * @param options Configures how the tab should be opened. + * Opens a new tab in a browser window associated with the current application + * and Chrome profile. If no browser window for the Chrome profile is opened, + * a new one is opened prior to creating the new tab. Since Chrome 42 only. + * @param options Configures how the tab should be opened. */ export function openTab(options: Options): void; } @@ -228,9 +228,9 @@ declare module chrome.browser { // Bookmarks //////////////////// /** - * Use the chrome.bookmarks API to create, organize, and otherwise manipulate bookmarks. Also see Override Pages, which you can use to create a custom Bookmark Manager page. - * Availability: Since Chrome 5. - * Permissions: "bookmarks" + * Use the chrome.bookmarks API to create, organize, and otherwise manipulate bookmarks. Also see Override Pages, which you can use to create a custom Bookmark Manager page. + * Availability: Since Chrome 5. + * Permissions: "bookmarks" */ declare module chrome.bookmarks { /** A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder. */ @@ -253,8 +253,8 @@ declare module chrome.bookmarks { children?: BookmarkTreeNode[]; /** * Optional. - * Since Chrome 37. - * 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). + * Since Chrome 37. + * 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). */ unmodifiable?: any; } @@ -317,95 +317,95 @@ declare module chrome.bookmarks { title?: string; url?: string; } - + /** @deprecated since Chrome 38. Bookmark write operations are no longer limited by Chrome. */ var MAX_WRITE_OPERATIONS_PER_HOUR: number; /** @deprecated since Chrome 38. Bookmark write operations are no longer limited by Chrome. */ var MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number; /** - * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties. + * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties. * @param query A string of words and quoted phrases that are matched against bookmark URLs and titles. - * @param callback The callback parameter should be a function that looks like this: - * function(array of BookmarkTreeNode results) {...}; + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; */ export function search(query: string, callback: (results: BookmarkTreeNode[]) => void): void; /** - * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties. - * @param query An object with one or more of the properties query, url, and title specified. Bookmarks matching all specified properties will be produced. - * @param callback The callback parameter should be a function that looks like this: - * function(array of BookmarkTreeNode results) {...}; + * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties. + * @param query An object with one or more of the properties query, url, and title specified. Bookmarks matching all specified properties will be produced. + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; */ export function search(query: BookmarkSearchQuery, callback: (results: BookmarkTreeNode[]) => void): void; /** - * Retrieves the entire Bookmarks hierarchy. + * Retrieves the entire Bookmarks hierarchy. * @param callback The callback parameter should be a function that looks like this: - * function(array of BookmarkTreeNode results) {...}; + * function(array of BookmarkTreeNode results) {...}; */ export function getTree(callback: (results: BookmarkTreeNode[]) => void): void; /** - * Retrieves the recently added bookmarks. - * @param numberOfItems The maximum number of items to return. + * Retrieves the recently added bookmarks. + * @param numberOfItems The maximum number of items to return. * @param callback The callback parameter should be a function that looks like this: - * function(array of BookmarkTreeNode results) {...}; + * function(array of BookmarkTreeNode results) {...}; */ export function getRecent(numberOfItems: number, callback: (results: BookmarkTreeNode[]) => void): void; /** * Retrieves the specified BookmarkTreeNode. * @param id A single string-valued id * @param callback The callback parameter should be a function that looks like this: - * function(array of BookmarkTreeNode results) {...}; + * function(array of BookmarkTreeNode results) {...}; */ export function get(id: string, callback: (results: BookmarkTreeNode[]) => void): void; /** * Retrieves the specified BookmarkTreeNode. * @param idList An array of string-valued ids * @param callback The callback parameter should be a function that looks like this: - * function(array of BookmarkTreeNode results) {...}; + * function(array of BookmarkTreeNode results) {...}; */ export function get(idList: string[], callback: (results: BookmarkTreeNode[]) => void): void; /** - * Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder. + * Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder. * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function( BookmarkTreeNode result) {...}; + * function( BookmarkTreeNode result) {...}; */ export function create(bookmark: BookmarkCreateArg, callback?: (result: BookmarkTreeNode) => void): void; /** - * Moves the specified BookmarkTreeNode to the provided location. + * Moves the specified BookmarkTreeNode to the provided location. * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function( BookmarkTreeNode result) {...}; + * function( BookmarkTreeNode result) {...}; */ export function move(id: string, destination: BookmarkDestinationArg, callback?: (result: BookmarkTreeNode) => void): void; /** - * 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. + * 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. * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function( BookmarkTreeNode result) {...}; + * function( BookmarkTreeNode result) {...}; */ export function update(id: string, changes: BookmarkChangesArg, callback?: (result: BookmarkTreeNode) => void): void; /** - * Removes a bookmark or an empty bookmark folder. + * Removes a bookmark or an empty bookmark folder. * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * function() {...}; */ export function remove(id: string, callback?: Function): void; /** - * Retrieves the children of the specified BookmarkTreeNode id. + * Retrieves the children of the specified BookmarkTreeNode id. * @param callback The callback parameter should be a function that looks like this: - * function(array of BookmarkTreeNode results) {...}; + * function(array of BookmarkTreeNode results) {...}; */ export function getChildren(id: string, callback: (results: BookmarkTreeNode[]) => void): void; /** - * Since Chrome 14. - * Retrieves part of the Bookmarks hierarchy, starting at the specified node. - * @param id The ID of the root of the subtree to retrieve. + * Since Chrome 14. + * Retrieves part of the Bookmarks hierarchy, starting at the specified node. + * @param id The ID of the root of the subtree to retrieve. * @param callback The callback parameter should be a function that looks like this: - * function(array of BookmarkTreeNode results) {...}; + * function(array of BookmarkTreeNode results) {...}; */ export function getSubTree(id: string, callback: (results: BookmarkTreeNode[]) => void): void; /** - * Recursively removes a bookmark folder. + * Recursively removes a bookmark folder. * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * function() {...}; */ export function removeTree(id: string, callback?: Function): void; @@ -430,8 +430,8 @@ declare module chrome.bookmarks { //////////////////// /** * Use browser actions to put icons in the main Google Chrome 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. - * Availability: Since Chrome 5. - * Manifest: "browser_action": {...} + * Availability: Since Chrome 5. + * Manifest: "browser_action": {...} */ declare module chrome.browserAction { interface BadgeBackgroundColorDetails { @@ -479,9 +479,9 @@ declare module chrome.browserAction { interface BrowserClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {} /** - * Since Chrome 22. - * Enables the browser action for a tab. By default, browser actions are enabled. - * @param tabId The id of the tab for which you want to modify the browser action. + * Since Chrome 22. + * Enables the browser action for a tab. By default, browser actions are enabled. + * @param tabId The id of the tab for which you want to modify the browser action. */ export function enable(tabId?: number): void; /** Sets the background color for the badge. */ @@ -491,45 +491,45 @@ declare module chrome.browserAction { /** Sets the title of the browser action. This shows up in the tooltip. */ export function setTitle(details: TitleDetails): void; /** - * Since Chrome 19. - * Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned. - * @param callback The callback parameter should be a function that looks like this: - * function(string result) {...}; + * Since Chrome 19. + * Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned. + * @param callback The callback parameter should be a function that looks like this: + * function(string result) {...}; */ export function getBadgeText(details: TabDetails, callback: (result: string) => void): void; /** Sets the html document to be opened as a popup when the user clicks on the browser action's icon. */ export function setPopup(details: PopupDetails): void; /** - * Since Chrome 22. - * Disables the browser action for a tab. - * @param tabId The id of the tab for which you want to modify the browser action. + * Since Chrome 22. + * Disables the browser action for a tab. + * @param tabId The id of the tab for which you want to modify the browser action. */ export function disable(tabId?: number): void; /** - * Since Chrome 19. - * Gets the title of the browser action. - * @param callback The callback parameter should be a function that looks like this: - * function(string result) {...}; + * Since Chrome 19. + * Gets the title of the browser action. + * @param callback The callback parameter should be a function that looks like this: + * function(string result) {...}; */ export function getTitle(details: TabDetails, callback: (result: string) => void): void; /** - * Since Chrome 19. - * Gets the background color of the browser action. - * @param callback The callback parameter should be a function that looks like this: - * function( ColorArray result) {...}; + * Since Chrome 19. + * Gets the background color of the browser action. + * @param callback The callback parameter should be a function that looks like this: + * function( ColorArray result) {...}; */ export function getBadgeBackgroundColor(details: TabDetails, callback: (result: number[]) => void): void; /** - * Since Chrome 19. - * Gets the html document set as the popup for this browser action. - * @param callback The callback parameter should be a function that looks like this: - * function(string result) {...}; + * Since Chrome 19. + * Gets the html document set as the popup for this browser action. + * @param callback The callback parameter should be a function that looks like this: + * function(string result) {...}; */ export function getPopup(details: TabDetails, callback: (result: string) => void): void; /** - * 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. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * 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. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function setIcon(details: TabIconDetails, callback?: Function): void; @@ -541,9 +541,9 @@ declare module chrome.browserAction { // Browsing Data //////////////////// /** - * Use the chrome.browsingData API to remove browsing data from a user's local profile. - * Availability: Since Chrome 19. - * Permissions: "browsingData" + * Use the chrome.browsingData API to remove browsing data from a user's local profile. + * Availability: Since Chrome 19. + * Permissions: "browsingData" */ declare module chrome.browsingData { interface OriginTypes { @@ -559,8 +559,8 @@ declare module chrome.browsingData { interface RemovalOptions { /** * Optional. - * Since Chrome 21. - * 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'. + * Since Chrome 21. + * 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'. */ originTypes?: OriginTypes; /** Optional. 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). */ @@ -568,7 +568,7 @@ declare module chrome.browsingData { } /** - * Since Chrome 27. + * Since Chrome 27. * A set of data types. Missing data types are interpreted as false. */ interface DataTypeSet { @@ -600,8 +600,8 @@ declare module chrome.browsingData { history?: boolean; /** * Optional. - * Since Chrome 39. - * Service Workers. + * Since Chrome 39. + * Service Workers. */ serviceWorkers?: boolean; } @@ -615,102 +615,102 @@ declare module chrome.browsingData { } /** - * Since Chrome 26. - * 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. - * @param callback The callback parameter should be a function that looks like this: - * function(object result) {...}; + * Since Chrome 26. + * 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. + * @param callback The callback parameter should be a function that looks like this: + * function(object result) {...}; */ export function settings(callback: (result: SettingsCallback) => void): void; /** - * Clears plugins' data. - * @param callback Called when plugins' data has been cleared. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears plugins' data. + * @param callback Called when plugins' data has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function removePluginData(options: RemovalOptions, callback?: () => void): void; /** - * Clears the browser's stored form data (autofill). - * @param callback Called when the browser's form data has been cleared. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears the browser's stored form data (autofill). + * @param callback Called when the browser's form data has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function removeFormData(options: RemovalOptions, callback?: () => void): void; /** - * Clears websites' file system data. - * @param callback Called when websites' file systems have been cleared. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears websites' file system data. + * @param callback Called when websites' file systems have been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function removeFileSystems(options: RemovalOptions, callback?: () => void): void; /** - * Clears various types of browsing data stored in a user's profile. - * @param dataToRemove The set of data types to remove. - * @param callback Called when deletion has completed. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears various types of browsing data stored in a user's profile. + * @param dataToRemove The set of data types to remove. + * @param callback Called when deletion has completed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function remove(options: RemovalOptions, dataToRemove: DataTypeSet, callback?: () => void): void; /** - * Clears the browser's stored passwords. - * @param callback Called when the browser's passwords have been cleared. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears the browser's stored passwords. + * @param callback Called when the browser's passwords have been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function removePasswords(options: RemovalOptions, callback?: () => void): void; /** - * Clears the browser's cookies and server-bound certificates modified within a particular timeframe. - * @param callback Called when the browser's cookies and server-bound certificates have been cleared. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears the browser's cookies and server-bound certificates modified within a particular timeframe. + * @param callback Called when the browser's cookies and server-bound certificates have been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function removeCookies(options: RemovalOptions, callback?: () => void): void; /** - * Clears websites' WebSQL data. - * @param callback Called when websites' WebSQL databases have been cleared. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears websites' WebSQL data. + * @param callback Called when websites' WebSQL databases have been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function removeWebSQL(options: RemovalOptions, callback?: () => void): void; /** - * Clears websites' appcache data. - * @param callback Called when websites' appcache data has been cleared. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears websites' appcache data. + * @param callback Called when websites' appcache data has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function removeAppcache(options: RemovalOptions, callback?: () => void): void; /** - * Clears the browser's list of downloaded files (not the downloaded files themselves). - * @param callback Called when the browser's list of downloaded files has been cleared. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears the browser's list of downloaded files (not the downloaded files themselves). + * @param callback Called when the browser's list of downloaded files has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function removeDownloads(options: RemovalOptions, callback?: () => void): void; /** - * Clears websites' local storage data. - * @param callback Called when websites' local storage has been cleared. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears websites' local storage data. + * @param callback Called when websites' local storage has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function removeLocalStorage(options: RemovalOptions, callback?: () => void): void; /** - * Clears the browser's cache. - * @param callback Called when the browser's cache has been cleared. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears the browser's cache. + * @param callback Called when the browser's cache has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function removeCache(options: RemovalOptions, callback?: () => void): void; /** - * Clears the browser's history. - * @param callback Called when the browser's history has cleared. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears the browser's history. + * @param callback Called when the browser's history has cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function removeHistory(options: RemovalOptions, callback?: () => void): void; /** - * Clears websites' IndexedDB data. - * @param callback Called when websites' IndexedDB data has been cleared. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears websites' IndexedDB data. + * @param callback Called when websites' IndexedDB data has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function removeIndexedDB(options: RemovalOptions, callback?: () => void): void; } @@ -719,9 +719,9 @@ declare module chrome.browsingData { // Commands //////////////////// /** - * 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 extension. - * Availability: Since Chrome 25. - * Manifest: "commands": {...} + * 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 extension. + * Availability: Since Chrome 25. + * Manifest: "commands": {...} */ declare module chrome.commands { interface Command { @@ -736,10 +736,10 @@ declare module chrome.commands { interface CommandEvent extends chrome.events.Event<(command: string) => void> {} /** - * Returns all the registered extension commands for this extension and their shortcut (if active). - * @param callback Called to return the registered commands. + * Returns all the registered extension commands for this extension and their shortcut (if active). + * @param callback Called to return the registered commands. * If you specify the callback parameter, it should be a function that looks like this: - * function(array of Command commands) {...}; + * function(array of Command commands) {...}; */ export function getAll(callback: (commands: Command[]) => void): void; @@ -751,15 +751,15 @@ declare module chrome.commands { // Content Settings //////////////////// /** - * Use the chrome.contentSettings API to change settings that control whether websites can use features such as cookies, JavaScript, and plugins. More generally speaking, content settings allow you to customize Chrome's behavior on a per-site basis instead of globally. - * Availability: Since Chrome 16. - * Permissions: "contentSettings" + * Use the chrome.contentSettings API to change settings that control whether websites can use features such as cookies, JavaScript, and plugins. More generally speaking, content settings allow you to customize Chrome's behavior on a per-site basis instead of globally. + * Availability: Since Chrome 16. + * Permissions: "contentSettings" */ declare module chrome.contentSettings { interface ClearDetails { /** * Optional. - * Where to clear the setting (default: regular). + * Where to clear the setting (default: regular). * The scope of the ContentSetting. One of * * regular: setting for regular profile (which is inherited by the incognito profile if not overridden elsewhere), * * incognito_session_only: setting for incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular settings). @@ -798,27 +798,27 @@ declare module chrome.contentSettings { interface ContentSetting { /** - * Clear all content setting rules set by this extension. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clear all content setting rules set by this extension. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ clear(details: ClearDetails, callback?: () => void): void; /** - * Applies a new content setting rule. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Applies a new content setting rule. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ set(details: SetDetails, callback?: () => void): void; /** - * @param callback The callback parameter should be a function that looks like this: - * function(array of ResourceIdentifier resourceIdentifiers) {...}; - * Parameter resourceIdentifiers: A list of resource identifiers for this content type, or undefined if this content type does not use resource identifiers. + * @param callback The callback parameter should be a function that looks like this: + * function(array of ResourceIdentifier resourceIdentifiers) {...}; + * Parameter resourceIdentifiers: A list of resource identifiers for this content type, or undefined if this content type does not use resource identifiers. */ getResourceIdentifiers(callback: (resourceIdentifiers?: ResourceIdentifier[]) => void): void; /** - * Gets the current content setting for a given pair of URLs. - * @param callback The callback parameter should be a function that looks like this: - * function(object details) {...}; + * Gets the current content setting for a given pair of URLs. + * @param callback The callback parameter should be a function that looks like this: + * function(object details) {...}; */ get(details: GetDetails, callback: (details: ReturnedDetails) => void): void; } @@ -835,9 +835,9 @@ declare module chrome.contentSettings { * Whether to allow cookies and other local data to be set by websites. One of * allow: Accept cookies, * block: Block cookies, - * session_only: Accept cookies only for the current session. + * session_only: Accept cookies only for the current session. * Default is allow. - * The primary URL is the URL representing the cookie origin. The secondary URL is the URL of the top-level frame. + * The primary URL is the URL representing the cookie origin. The secondary URL is the URL of the top-level frame. */ var cookies: ContentSetting; /** @@ -851,9 +851,9 @@ declare module chrome.contentSettings { /** * Whether to run JavaScript. One of * allow: Run JavaScript, - * block: Don't run JavaScript. + * block: Don't run JavaScript. * Default is allow. - * The primary URL is the URL of the top-level frame. The secondary URL is not used. + * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ var javascript: ContentSetting; /** @@ -862,7 +862,7 @@ declare module chrome.contentSettings { * block: Don't allow sites to show desktop notifications, * ask: Ask when a site wants to show desktop notifications. * Default is ask. - * The primary URL is the URL of the document which wants to show the notification. The secondary URL is not used. + * The primary URL is the URL of the document which wants to show the notification. The secondary URL is not used. */ var notifications: ContentSetting; /** @@ -877,23 +877,23 @@ declare module chrome.contentSettings { /** * Whether to show images. One of * allow: Show images, - * block: Don't show images. + * block: Don't show images. * Default is allow. - * The primary URL is the URL of the top-level frame. The secondary URL is the URL of the image. + * The primary URL is the URL of the top-level frame. The secondary URL is the URL of the image. */ var images: ContentSetting; /** - * Since Chrome 42. - * Whether to allow Geolocation. One of + * Since Chrome 42. + * Whether to allow Geolocation. One of * allow: Allow sites to track your physical location, * block: Don't allow sites to track your physical location, * ask: Ask before allowing sites to track your physical location. * Default is ask. - * The primary URL is the URL of the document which requested location data. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL). + * The primary URL is the URL of the document which requested location data. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL). */ var location: ContentSetting; /** - * Since Chrome 42. + * Since Chrome 42. * Whether to allow sites to toggle the fullscreen mode. One of * allow: Allow sites to toggle the fullscreen mode, * ask: Ask when a site wants to toggle the fullscreen mode. @@ -912,7 +912,7 @@ declare module chrome.contentSettings { */ var mouselock: ContentSetting; /** - * Since Chrome 42. + * Since Chrome 42. * Whether to allow sites to run plugins unsandboxed. One of * allow: Allow sites to run plugins unsandboxed, * block: Don't allow sites to run plugins unsandboxed, @@ -922,7 +922,7 @@ declare module chrome.contentSettings { */ var unsandboxedPlugins: ContentSetting; /** - * Since Chrome 42. + * Since Chrome 42. * Whether to allow sites to download multiple files automatically. One of * allow: Allow sites to download multiple files automatically, * block: Don't allow sites to download multiple files automatically, @@ -938,15 +938,15 @@ declare module chrome.contentSettings { //////////////////// /** * Use the chrome.contextMenus API to add items to Google Chrome's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages. - * Availability: Since Chrome 6. - * Permissions: "contextMenus" + * Availability: Since Chrome 6. + * Permissions: "contextMenus" */ declare module chrome.contextMenus { interface OnClickData { /** * Optional. * Since Chrome 35. - * The text for the context selection, if any. + * The text for the context selection, if any. */ selectionText?: string; /** @@ -973,7 +973,7 @@ declare module chrome.contextMenus { editable: boolean; /** * Optional. - * Since Chrome 35. + * Since Chrome 35. * One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements. */ mediaType?: string; @@ -984,14 +984,14 @@ declare module chrome.contextMenus { */ wasChecked?: boolean; /** - * Since Chrome 35. - * 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. + * Since Chrome 35. + * 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. */ pageUrl: string; /** * Optional. * Since Chrome 35. - * If the element is a link, the URL it points to. + * If the element is a link, the URL it points to. */ linkUrl?: string; /** @@ -1002,7 +1002,7 @@ declare module chrome.contextMenus { parentMenuItemId?: any; /** * Optional. - * Since Chrome 35. + * Since Chrome 35. * Will be present for elements with a 'src' URL. */ srcUrl?: string; @@ -1019,17 +1019,17 @@ declare module chrome.contextMenus { contexts?: string[]; /** * Optional. - * Since Chrome 20. - * Whether this context menu item is enabled or disabled. Defaults to true. + * Since Chrome 20. + * Whether this context menu item is enabled or disabled. Defaults to true. */ enabled?: boolean; /** Optional. Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags. */ targetUrlPatterns?: string[]; /** * Optional. - * 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 chrome.contextMenus.onClicked. - * @param info Information sent when a context menu item is clicked. - * @param tab The details of the tab where the click took place. Note: this parameter only present for extensions. + * 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 chrome.contextMenus.onClicked. + * @param info Information sent when a context menu item is clicked. + * @param tab The details of the tab where the click took place. Note: this parameter only present for extensions. */ onclick?: (info: OnClickData, tab: chrome.tabs.Tab) => void; /** Optional. The ID of a parent menu item; this makes the item a child of a previously added item. */ @@ -1038,7 +1038,7 @@ declare module chrome.contextMenus { type?: string; /** * Optional. - * Since Chrome 21. + * Since Chrome 21. * The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension. */ id?: string; @@ -1061,63 +1061,63 @@ declare module chrome.contextMenus { interface MenuClickedEvent extends chrome.events.Event<(info: OnClickData, tab?: chrome.tabs.Tab) => void> {} /** - * Since Chrome 38. - * 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. + * Since Chrome 38. + * 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. */ var ACTION_MENU_TOP_LEVEL_LIMIT: number; /** - * Removes all context menu items added by this extension. - * @param callback Called when removal is complete. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Removes all context menu items added by this extension. + * @param callback Called when removal is complete. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function removeAll(callback?: () => void): void; /** * 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 chrome.runtime.lastError). - * @param callback Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * @param callback Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function create(createProperties: CreateProperties, callback?: () => void): void; /** - * Updates a previously created context menu item. - * @param id The ID of the item to update. - * @param updateProperties The properties to update. Accepts the same values as the create function. - * @param callback Called when the context menu has been updated. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Updates a previously created context menu item. + * @param id The ID of the item to update. + * @param updateProperties The properties to update. Accepts the same values as the create function. + * @param callback Called when the context menu has been updated. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function update(id: string, updateProperties: UpdateProperties, callback?: () => void): void; /** - * Updates a previously created context menu item. - * @param id The ID of the item to update. - * @param updateProperties The properties to update. Accepts the same values as the create function. - * @param callback Called when the context menu has been updated. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Updates a previously created context menu item. + * @param id The ID of the item to update. + * @param updateProperties The properties to update. Accepts the same values as the create function. + * @param callback Called when the context menu has been updated. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function update(id: number, updateProperties: UpdateProperties, callback?: () => void): void; /** - * Removes a context menu item. - * @param menuItemId The ID of the context menu item to remove. - * @param callback Called when the context menu has been removed. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Removes a context menu item. + * @param menuItemId The ID of the context menu item to remove. + * @param callback Called when the context menu has been removed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function remove(menuItemId: string, callback?: () => void): void; /** - * Removes a context menu item. - * @param menuItemId The ID of the context menu item to remove. - * @param callback Called when the context menu has been removed. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Removes a context menu item. + * @param menuItemId The ID of the context menu item to remove. + * @param callback Called when the context menu has been removed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function remove(menuItemId: number, callback?: () => void): void; /** - * Since Chrome 21. - * Fired when a context menu item is clicked. + * Since Chrome 21. + * Fired when a context menu item is clicked. */ var onClicked: MenuClickedEvent; } @@ -1127,8 +1127,8 @@ declare module chrome.contextMenus { //////////////////// /** * Use the chrome.cookies API to query and modify cookies, and to be notified when they change. - * Availability: Since Chrome 6. - * Permissions: "cookies", host permissions + * Availability: Since Chrome 6. + * Permissions: "cookies", host permissions */ declare module chrome.cookies { /** Represents information about an HTTP cookie. */ @@ -1212,9 +1212,9 @@ declare module chrome.cookies { cookie: Cookie; /** True if a cookie was removed. */ removed: boolean; - /** - * Since Chrome 12. - * The underlying reason behind the cookie's change. + /** + * Since Chrome 12. + * The underlying reason behind the cookie's change. */ cause: string; } @@ -1222,41 +1222,41 @@ declare module chrome.cookies { interface CookieChangedEvent extends chrome.events.Event<(changeInfo: CookieChangeInfo) => void> {} /** - * Lists all existing cookie stores. - * @param callback The callback parameter should be a function that looks like this: - * function(array of CookieStore cookieStores) {...}; - * Parameter cookieStores: All the existing cookie stores. + * Lists all existing cookie stores. + * @param callback The callback parameter should be a function that looks like this: + * function(array of CookieStore cookieStores) {...}; + * Parameter cookieStores: All the existing cookie stores. */ export function getAllCookieStores(callback: (cookieStores: CookieStore[]) => void): void; /** - * 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. - * @param details Information to filter the cookies being retrieved. - * @param callback The callback parameter should be a function that looks like this: - * function(array of Cookie cookies) {...}; - * Parameter cookies: All the existing, unexpired cookies that match the given cookie info. + * 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. + * @param details Information to filter the cookies being retrieved. + * @param callback The callback parameter should be a function that looks like this: + * function(array of Cookie cookies) {...}; + * Parameter cookies: All the existing, unexpired cookies that match the given cookie info. */ export function getAll(details: GetAllDetails, callback: (cookies: Cookie[]) => void): void; /** - * Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist. - * @param details Details about the cookie being set. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function( Cookie cookie) {...}; - * Optional parameter cookie: Contains details about the cookie that's been set. If setting failed for any reason, this will be "null", and "chrome.runtime.lastError" will be set. + * Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist. + * @param details Details about the cookie being set. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( Cookie cookie) {...}; + * Optional parameter cookie: Contains details about the cookie that's been set. If setting failed for any reason, this will be "null", and "chrome.runtime.lastError" will be set. */ export function set(details: SetDetails, callback?: (cookie?: Cookie) => void): void; /** - * Deletes a cookie by name. - * @param details Information to identify the cookie to remove. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function(object details) {...}; + * Deletes a cookie by name. + * @param details Information to identify the cookie to remove. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; */ export function remove(details: Details, callback?: (details: Details) => void): void; /** * 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. - * @param details Details to identify the cookie being retrieved. - * @param callback The callback parameter should be a function that looks like this: - * function( Cookie cookie) {...}; - * Parameter cookie: Contains details about the cookie. This parameter is null if no such cookie was found. + * @param details Details to identify the cookie being retrieved. + * @param callback The callback parameter should be a function that looks like this: + * function( Cookie cookie) {...}; + * Parameter cookie: Contains details about the cookie. This parameter is null if no such cookie was found. */ export function get(details: Details, callback: (cookie?: Cookie) => void): void; @@ -1268,9 +1268,9 @@ declare module chrome.cookies { // Debugger //////////////////// /** - * The chrome.debugger API serves as an alternate transport for Chrome's remote debugging protocol. Use chrome.debugger to attach to one or more tabs to instrument network interaction, debug JavaScript, mutate the DOM and CSS, etc. Use the Debuggee tabId to target tabs with sendCommand and route events by tabId from onEvent callbacks. - * Availability: Since Chrome 18. - * Permissions: "debugger" + * The chrome.debugger API serves as an alternate transport for Chrome's remote debugging protocol. Use chrome.debugger to attach to one or more tabs to instrument network interaction, debug JavaScript, mutate the DOM and CSS, etc. Use the Debuggee tabId to target tabs with sendCommand and route events by tabId from onEvent callbacks. + * Availability: Since Chrome 18. + * Permissions: "debugger" */ declare module "chrome.debugger" { /** Debuggee identifier. Either tabId or extensionId must be specified */ @@ -1279,8 +1279,8 @@ declare module "chrome.debugger" { tabId?: number; /** * Optional. - * Since Chrome 27. - * The id of the extension which you intend to debug. Attaching to an extension background page is only possible when 'silent-debugger-extension-api' flag is enabled on the target browser. + * Since Chrome 27. + * The id of the extension which you intend to debug. Attaching to an extension background page is only possible when 'silent-debugger-extension-api' flag is enabled on the target browser. */ extensionId?: string; /** @@ -1290,9 +1290,9 @@ declare module "chrome.debugger" { */ targetId?: string; } - + /** - * Since Chrome 28. + * Since Chrome 28. * Debug target information */ interface TargetInfo { @@ -1302,14 +1302,14 @@ declare module "chrome.debugger" { id: string; /** * Optional. - * Since Chrome 30. - * The tab id, defined if type == 'page'. + * Since Chrome 30. + * The tab id, defined if type == 'page'. */ tabId?: number; /** * Optional. - * Since Chrome 30. - * The extension id, defined if type = 'background_page'. + * Since Chrome 30. + * The extension id, defined if type = 'background_page'. */ extensionId?: string; /** True if debugger is already attached. */ @@ -1327,39 +1327,39 @@ declare module "chrome.debugger" { interface DebuggerEventEvent extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void> {} /** - * Attaches debugger to the given target. - * @param target Debugging target to which you want to attach. + * Attaches debugger to the given target. + * @param target Debugging target to which you want to attach. * @param requiredVersion Required debugging protocol version ("0.1"). One can only attach to the debuggee with matching major version and greater or equal minor version. List of the protocol versions can be obtained in the documentation pages. - * @param callback Called once the attach operation succeeds or fails. Callback receives no arguments. If the attach fails, runtime.lastError will be set to the error message. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * @param callback Called once the attach operation succeeds or fails. Callback receives no arguments. If the attach fails, runtime.lastError will be set to the error message. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function attach(target: Debuggee, requiredVersion: string, callback?: () => void): void; /** - * Detaches debugger from the given target. - * @param target Debugging target from which you want to detach. - * @param callback Called once the detach operation succeeds or fails. Callback receives no arguments. If the detach fails, runtime.lastError will be set to the error message. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Detaches debugger from the given target. + * @param target Debugging target from which you want to detach. + * @param callback Called once the detach operation succeeds or fails. Callback receives no arguments. If the detach fails, runtime.lastError will be set to the error message. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function detach(target: Debuggee, callback?: () => void): void; /** - * Sends given command to the debugging target. - * @param target Debugging target to which you want to send the command. - * @param method Method name. Should be one of the methods defined by the remote debugging protocol. - * @param commandParams Since Chrome 22. - * JSON object with request parameters. This object must conform to the remote debugging params scheme for given method. - * @param callback Response body. If an error occurs while posting the message, the callback will be called with no arguments and runtime.lastError will be set to the error message. - * If you specify the callback parameter, it should be a function that looks like this: - * function(object result) {...}; + * Sends given command to the debugging target. + * @param target Debugging target to which you want to send the command. + * @param method Method name. Should be one of the methods defined by the remote debugging protocol. + * @param commandParams Since Chrome 22. + * JSON object with request parameters. This object must conform to the remote debugging params scheme for given method. + * @param callback Response body. If an error occurs while posting the message, the callback will be called with no arguments and runtime.lastError will be set to the error message. + * If you specify the callback parameter, it should be a function that looks like this: + * function(object result) {...}; */ export function sendCommand(target: Debuggee, method: string, commandParams?: Object, callback?: (result?: Object) => void): void; /** - * Since Chrome 28. - * Returns the list of available debug targets. - * @param callback The callback parameter should be a function that looks like this: - * function(array of TargetInfo result) {...}; - * Parameter result: Array of TargetInfo objects corresponding to the available debug targets. + * Since Chrome 28. + * Returns the list of available debug targets. + * @param callback The callback parameter should be a function that looks like this: + * function(array of TargetInfo result) {...}; + * Parameter result: Array of TargetInfo objects corresponding to the available debug targets. */ export function getTargets(callback: (result: TargetInfo[]) => void): void; @@ -1373,9 +1373,9 @@ declare module "chrome.debugger" { // Declarative Content //////////////////// /** - * Use the chrome.declarativeContent API to take actions depending on the content of a page, without requiring permission to read the page's content. - * Availability: Since Chrome 33. - * Permissions: "declarativeContent" + * Use the chrome.declarativeContent API to take actions depending on the content of a page, without requiring permission to read the page's content. + * Availability: Since Chrome 33. + * Permissions: "declarativeContent" */ declare module chrome.declarativeContent { interface PageStateUrlDetails { @@ -1420,7 +1420,7 @@ declare module chrome.declarativeContent { /** Optional. Matches if the port of the URL is contained in any of the specified port lists. For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200. */ ports?: (number | number[])[]; } - + /** Matches the state of a web page by various criteria. */ interface PageStateMatcher { /** Optional. Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */ @@ -1430,7 +1430,7 @@ declare module chrome.declarativeContent { /** * Optional. * Since Chrome 45. Warning: this is the current Beta channel. More information available on the API documentation pages. - * Matches if the bookmarked state of the page is equal to the specified value. Requres the bookmarks permission. + * Matches if the bookmarked state of the page is equal to the specified value. Requres the bookmarks permission. */ isBookmarked?: boolean; } @@ -1549,31 +1549,31 @@ declare module chrome.declarativeWebRequest { // DesktopCapture //////////////////// /** - * Desktop Capture API that can be used to capture content of screen, individual windows or tabs. - * Availability: Since Chrome 34. - * Permissions: "desktopCapture" + * Desktop Capture API that can be used to capture content of screen, individual windows or tabs. + * Availability: Since Chrome 34. + * Permissions: "desktopCapture" */ declare module chrome.desktopCapture { /** - * Shows desktop media picker UI with the specified set of sources. - * @param sources Set of sources that should be shown to the user. - * @param callback The callback parameter should be a function that looks like this: - * function(string streamId) {...}; - * Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used. + * Shows desktop media picker UI with the specified set of sources. + * @param sources Set of sources that should be shown to the user. + * @param callback The callback parameter should be a function that looks like this: + * function(string streamId) {...}; + * Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used. */ export function chooseDesktopMedia(sources: string[], callback: (streamId: string) => void): number; /** - * Shows desktop media picker UI with the specified set of sources. - * @param sources Set of sources that should be shown to the user. - * @param targetTab Optional tab for which the stream is created. If not specified then the resulting stream can be used only by the calling extension. The stream can only be used by frames in the given tab whose security origin matches tab.url. - * @param callback The callback parameter should be a function that looks like this: - * function(string streamId) {...}; - * Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used. + * Shows desktop media picker UI with the specified set of sources. + * @param sources Set of sources that should be shown to the user. + * @param targetTab Optional tab for which the stream is created. If not specified then the resulting stream can be used only by the calling extension. The stream can only be used by frames in the given tab whose security origin matches tab.url. + * @param callback The callback parameter should be a function that looks like this: + * function(string streamId) {...}; + * Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used. */ export function chooseDesktopMedia(sources: string[], targetTab: chrome.tabs.Tab, callback: (streamId: string) => void): number; /** - * Hides desktop media picker dialog shown by chooseDesktopMedia(). - * @param desktopMediaRequestId Id returned by chooseDesktopMedia() + * Hides desktop media picker dialog shown by chooseDesktopMedia(). + * @param desktopMediaRequestId Id returned by chooseDesktopMedia() */ export function cancelChooseDesktopMedia(desktopMediaRequestId: number): void; } @@ -1582,30 +1582,30 @@ declare module chrome.desktopCapture { // Dev Tools - Inspected Window //////////////////// /** - * 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. - * Availability: Since Chrome 18. + * 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. + * Availability: Since Chrome 18. */ declare module chrome.devtools.inspectedWindow { /** A resource within the inspected page, such as a document, a script, or an image. */ interface Resource { /** The URL of the resource. */ url: string; - /** + /** * Gets the content of the resource. * @param callback A function that receives resource content when the request completes. - * The callback parameter should be a function that looks like this: - * function(string content, string encoding) {...}; - * Parameter content: Content of the resource (potentially encoded). - * Parameter encoding: Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported. + * The callback parameter should be a function that looks like this: + * function(string content, string encoding) {...}; + * Parameter content: Content of the resource (potentially encoded). + * Parameter encoding: Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported. */ getContent(callback: (content: string, encoding: string) => void): void; /** - * Sets the content of the resource. - * @param content New content of the resource. Only resources with the text type are currently supported. - * @param commit 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. - * @param callback A function called upon request completion. - * If you specify the callback parameter, it should be a function that looks like this: - * function(object error) {...}; + * Sets the content of the resource. + * @param content New content of the resource. Only resources with the text type are currently supported. + * @param commit 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. + * @param callback A function called upon request completion. + * If you specify the callback parameter, it should be a function that looks like this: + * function(object error) {...}; * Optional parameter error: Set to undefined if the resource content was set successfully; describes error otherwise. */ setContent(content: string, commit: boolean, callback?: (error: Object) => void): void; @@ -1620,8 +1620,8 @@ declare module chrome.devtools.inspectedWindow { injectedScript?: boolean; /** * Optional. - * 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. - * @deprecated Deprecated since Chrome 41. Please avoid using this parameter, it will be removed soon. + * 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. + * @deprecated Deprecated since Chrome 41. Please avoid using this parameter, it will be removed soon. */ preprocessorScript?: string; } @@ -1651,20 +1651,20 @@ declare module chrome.devtools.inspectedWindow { /** Reloads the inspected page. */ export function reload(reloadOptions: ReloadOptions): void; /** - * 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. - * @param expression An expression to evaluate. - * @param callback A function called when evaluation completes. - * If you specify the callback parameter, it should be a function that looks like this: - * function(object result, object exceptionInfo) {...}; - * Parameter result: The result of evaluation. - * Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression. + * 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. + * @param expression An expression to evaluate. + * @param callback A function called when evaluation completes. + * If you specify the callback parameter, it should be a function that looks like this: + * function(object result, object exceptionInfo) {...}; + * Parameter result: The result of evaluation. + * Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression. */ export function eval(expression: string, callback?: (result: Object, exceptionInfo: EvaluationExceptionInfo) => void): void; /** - * Retrieves the list of resources from the inspected page. - * @param callback A function that receives the list of resources when the request completes. - * The callback parameter should be a function that looks like this: - * function(array of Resource resources) {...}; + * Retrieves the list of resources from the inspected page. + * @param callback A function that receives the list of resources when the request completes. + * The callback parameter should be a function that looks like this: + * function(array of Resource resources) {...}; */ export function getResources(callback: (resources: Resource[]) => void): void; @@ -1678,19 +1678,19 @@ declare module chrome.devtools.inspectedWindow { // Dev Tools - Network //////////////////// /** - * Use the chrome.devtools.network API to retrieve the information about network requests displayed by the Developer Tools in the Network panel. - * Availability: Since Chrome 18. + * Use the chrome.devtools.network API to retrieve the information about network requests displayed by the Developer Tools in the Network panel. + * Availability: Since Chrome 18. */ declare module chrome.devtools.network { /** Represents a network request for a document resource (script, image and so on). See HAR Specification for reference. */ interface Request { - /** + /** * Returns content of the response body. * @param callback A function that receives the response body when the request completes. - * The callback parameter should be a function that looks like this: - * function(string content, string encoding) {...}; - * Parameter content: Content of the response body (potentially encoded). - * Parameter encoding: Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported. + * The callback parameter should be a function that looks like this: + * function(string content, string encoding) {...}; + * Parameter content: Content of the response body (potentially encoded). + * Parameter encoding: Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported. */ getContent(callback: (content: string, encoding: string) => void): void; } @@ -1700,11 +1700,11 @@ declare module chrome.devtools.network { interface NavigatedEvent extends chrome.events.Event<(url: string) => void> {} /** - * Returns HAR log that contains all known network requests. - * @param callback A function that receives the HAR log when the request completes. - * The callback parameter should be a function that looks like this: - * function(object harLog) {...}; - * Parameter harLog: A HAR log. See HAR specification for details. + * Returns HAR log that contains all known network requests. + * @param callback A function that receives the HAR log when the request completes. + * The callback parameter should be a function that looks like this: + * function(object harLog) {...}; + * Parameter harLog: A HAR log. See HAR specification for details. */ export function getHAR(callback: (harLog: Object) => void): void; @@ -1718,8 +1718,8 @@ declare module chrome.devtools.network { // Dev Tools - Panels //////////////////// /** - * 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. - * Availability: Since Chrome 18. + * 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. + * Availability: Since Chrome 18. */ declare module chrome.devtools.panels { interface PanelShownEvent extends chrome.events.Event<(window: chrome.windows.Window) => void> {} @@ -1731,10 +1731,10 @@ declare module chrome.devtools.panels { /** Represents a panel created by extension. */ interface ExtensionPanel { /** - * Appends a button to the status bar of the panel. - * @param iconPath 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. - * @param tooltipText Text shown as a tooltip when user hovers the mouse over the button. - * @param disabled Whether the button is disabled. + * Appends a button to the status bar of the panel. + * @param iconPath 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. + * @param tooltipText Text shown as a tooltip when user hovers the mouse over the button. + * @param disabled Whether the button is disabled. */ createStatusBarButton(iconPath: string, tooltipText: string, disabled: boolean): Button; /** Fired when the user switches to the panel. */ @@ -1750,10 +1750,10 @@ declare module chrome.devtools.panels { /** A button created by the extension. */ interface Button { /** - * Updates the attributes of the button. If some of the arguments are omitted or null, the corresponding attributes are not updated. - * @param iconPath Path to the new icon of the button. - * @param tooltipText Text shown as a tooltip when user hovers the mouse over the button. - * @param disabled Whether the button is disabled. + * Updates the attributes of the button. If some of the arguments are omitted or null, the corresponding attributes are not updated. + * @param iconPath Path to the new icon of the button. + * @param tooltipText Text shown as a tooltip when user hovers the mouse over the button. + * @param disabled Whether the button is disabled. */ update(iconPath?: string, tooltipText?: string, disabled?: boolean): void; /** Fired when the button is clicked. */ @@ -1765,12 +1765,12 @@ declare module chrome.devtools.panels { /** Represents the Elements panel. */ interface ElementsPanel { /** - * Creates a pane within panel's sidebar. - * @param title Text that is displayed in sidebar caption. - * @param callback A callback invoked when the sidebar is created. - * If you specify the callback parameter, it should be a function that looks like this: - * function( ExtensionSidebarPane result) {...}; - * Parameter result: An ExtensionSidebarPane object for created sidebar pane. + * Creates a pane within panel's sidebar. + * @param title Text that is displayed in sidebar caption. + * @param callback A callback invoked when the sidebar is created. + * If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionSidebarPane result) {...}; + * Parameter result: An ExtensionSidebarPane object for created sidebar pane. */ createSidebarPane(title: string, callback?: (result: ExtensionSidebarPane) => void): void; /** Fired when an object is selected in the panel. */ @@ -1778,17 +1778,17 @@ declare module chrome.devtools.panels { } /** - * Since Chrome 41. + * Since Chrome 41. * Represents the Sources panel. */ interface SourcesPanel { /** - * Creates a pane within panel's sidebar. - * @param title Text that is displayed in sidebar caption. - * @param callback A callback invoked when the sidebar is created. - * If you specify the callback parameter, it should be a function that looks like this: - * function( ExtensionSidebarPane result) {...}; - * Parameter result: An ExtensionSidebarPane object for created sidebar pane. + * Creates a pane within panel's sidebar. + * @param title Text that is displayed in sidebar caption. + * @param callback A callback invoked when the sidebar is created. + * If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionSidebarPane result) {...}; + * Parameter result: An ExtensionSidebarPane object for created sidebar pane. */ createSidebarPane(title: string, callback?: (result: ExtensionSidebarPane) => void): void; /** Fired when an object is selected in the panel. */ @@ -1802,47 +1802,47 @@ declare module chrome.devtools.panels { /** A sidebar created by the extension. */ interface ExtensionSidebarPane { /** - * Sets the height of the sidebar. - * @param height A CSS-like size specification, such as '100px' or '12ex'. + * Sets the height of the sidebar. + * @param height A CSS-like size specification, such as '100px' or '12ex'. */ setHeight(height: string): void; /** - * Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane. - * @param expression 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. + * Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane. + * @param expression 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. * @param rootTitle An optional title for the root of the expression tree. - * @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ setExpression(expression: string, rootTitle?: string, callback?: () => void): void; /** - * Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane. - * @param expression 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. - * @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane. + * @param expression 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. + * @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ setExpression(expression: string, callback?: () => void): void; /** - * Sets a JSON-compliant object to be displayed in the sidebar pane. - * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client). - * @param rootTitle An optional title for the root of the expression tree. - * @param callback A callback invoked after the sidebar is updated with the object. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Sets a JSON-compliant object to be displayed in the sidebar pane. + * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client). + * @param rootTitle An optional title for the root of the expression tree. + * @param callback A callback invoked after the sidebar is updated with the object. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ setObject(jsonObject: string, rootTitle?: string, callback?: () => void): void; /** - * Sets a JSON-compliant object to be displayed in the sidebar pane. - * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client). - * @param callback A callback invoked after the sidebar is updated with the object. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Sets a JSON-compliant object to be displayed in the sidebar pane. + * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client). + * @param callback A callback invoked after the sidebar is updated with the object. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ setObject(jsonObject: string, callback?: () => void): void; /** - * Sets an HTML page to be displayed in the sidebar pane. - * @param path Relative path of an extension page to display within the sidebar. + * Sets an HTML page to be displayed in the sidebar pane. + * @param path Relative path of an extension page to display within the sidebar. */ setPage(path: string): void; /** Fired when the sidebar pane becomes visible as a result of user switching to the panel that hosts it. */ @@ -1854,38 +1854,38 @@ declare module chrome.devtools.panels { /** Elements panel. */ var elements: ElementsPanel; /** - * Since Chrome 38. - * Sources panel. + * Since Chrome 38. + * Sources panel. */ var sources: SourcesPanel; /** - * Creates an extension panel. - * @param title Title that is displayed next to the extension icon in the Developer Tools toolbar. - * @param iconPath Path of the panel's icon relative to the extension directory. - * @param pagePath Path of the panel's HTML page relative to the extension directory. - * @param callback A function that is called when the panel is created. - * If you specify the callback parameter, it should be a function that looks like this: - * function( ExtensionPanel panel) {...}; - * Parameter panel: An ExtensionPanel object representing the created panel. + * Creates an extension panel. + * @param title Title that is displayed next to the extension icon in the Developer Tools toolbar. + * @param iconPath Path of the panel's icon relative to the extension directory. + * @param pagePath Path of the panel's HTML page relative to the extension directory. + * @param callback A function that is called when the panel is created. + * If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionPanel panel) {...}; + * Parameter panel: An ExtensionPanel object representing the created panel. */ export function create(title: string, iconPath: string, pagePath: string, callback?: (panel: ExtensionPanel) => void): void; /** - * 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. - * @param callback 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. - * If you specify the callback parameter, it should be a function that looks like this: - * function( devtools.inspectedWindow.Resource resource) {...}; - * Parameter resource: A devtools.inspectedWindow.Resource object for the resource that was clicked. + * 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. + * @param callback 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. + * If you specify the callback parameter, it should be a function that looks like this: + * function( devtools.inspectedWindow.Resource resource) {...}; + * Parameter resource: A devtools.inspectedWindow.Resource object for the resource that was clicked. */ export function setOpenResourceHandler(callback?: (resource: chrome.devtools.inspectedWindow.Resource) => void): void; /** - * Since Chrome 38. - * Requests DevTools to open a URL in a Developer Tools panel. - * @param url The URL of the resource to open. - * @param lineNumber Specifies the line number to scroll to when the resource is loaded. - * @param callback A function that is called when the resource has been successfully loaded. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Since Chrome 38. + * Requests DevTools to open a URL in a Developer Tools panel. + * @param url The URL of the resource to open. + * @param lineNumber Specifies the line number to scroll to when the resource is loaded. + * @param callback A function that is called when the resource has been successfully loaded. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function openResource(url: string, lineNumber: number, callback: () => void): void; } @@ -1894,10 +1894,10 @@ declare module chrome.devtools.panels { // Document Scan //////////////////// /** - * Use the chrome.documentScan API to discover and retrieve images from attached paper document scanners. - * Availability: Since Chrome 44. - * Permissions: "documentScan" - * Important: This API works only on Chrome OS. + * Use the chrome.documentScan API to discover and retrieve images from attached paper document scanners. + * Availability: Since Chrome 44. + * Permissions: "documentScan" + * Important: This API works only on Chrome OS. */ declare module chrome.documentScan { interface DocumentScanOptions { @@ -1913,13 +1913,13 @@ declare module chrome.documentScan { /** The MIME type of dataUrls. */ mimeType: string; } - + /** - * Performs a document scan. On success, the PNG data will be sent to the callback. - * @param options Object containing scan parameters. - * @param callback Called with the result and data from the scan. - * The callback parameter should be a function that looks like this: - * function(object result) {...}; + * Performs a document scan. On success, the PNG data will be sent to the callback. + * @param options Object containing scan parameters. + * @param callback Called with the result and data from the scan. + * The callback parameter should be a function that looks like this: + * function(object result) {...}; */ export function scan(options: DocumentScanOptions, callback: (result: DocumentScanCallbackArg) => void): void; } @@ -1929,8 +1929,8 @@ declare module chrome.documentScan { //////////////////// /** * Use the chrome.downloads API to programmatically initiate, monitor, manipulate, and search for downloads. - * Availability: Since Chrome 31. - * Permissions: "downloads" + * Availability: Since Chrome 31. + * Permissions: "downloads" */ declare module chrome.downloads { interface HeaderNameValuePair { @@ -2048,7 +2048,7 @@ declare module chrome.downloads { } interface GetFileIconOptions { - /** Optional. * The size of the returned icon. The icon will be square with dimensions size * size pixels. The default and largest size for the icon is 32x32 pixels. The only supported sizes are 16 and 32. It is an error to specify any other size. + /** Optional. * The size of the returned icon. The icon will be square with dimensions size * size pixels. The default and largest size for the icon is 32x32 pixels. The only supported sizes are 16 and 32. It is an error to specify any other size. */ size?: number; } @@ -2122,67 +2122,67 @@ declare module chrome.downloads { interface DownloadDeterminingFilenameEvent extends chrome.events.Event<(downloadItem: DownloadItem, suggest: (suggestion?: DownloadFilenameSuggestion) => void) => void> {} /** - * Find DownloadItem. Set query to the empty object to get all DownloadItem. To get a specific DownloadItem, set only the id field. To page through a large number of items, set orderBy: ['-startTime'], set limit to the number of items per page, and set startedAfter to the startTime of the last item from the last page. - * @param callback The callback parameter should be a function that looks like this: - * function(array of DownloadItem results) {...}; + * Find DownloadItem. Set query to the empty object to get all DownloadItem. To get a specific DownloadItem, set only the id field. To page through a large number of items, set orderBy: ['-startTime'], set limit to the number of items per page, and set startedAfter to the startTime of the last item from the last page. + * @param callback The callback parameter should be a function that looks like this: + * function(array of DownloadItem results) {...}; */ export function search(query: DownloadQuery, callback: (results: DownloadItem[]) => void): void; /** - * Pause the download. If the request was successful the download is in a paused state. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active. - * @param downloadId The id of the download to pause. - * @param callback Called when the pause request is completed. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Pause the download. If the request was successful the download is in a paused state. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active. + * @param downloadId The id of the download to pause. + * @param callback Called when the pause request is completed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function pause(downloadId: number, callback?: () => void): void; /** - * 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, runtime.lastError will contain an error message. - * @param downloadId The identifier for the download. - * @param callback A URL to an image that represents the download. - * The callback parameter should be a function that looks like this: - * function(string iconURL) {...}; + * 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, runtime.lastError will contain an error message. + * @param downloadId The identifier for the download. + * @param callback A URL to an image that represents the download. + * The callback parameter should be a function that looks like this: + * function(string iconURL) {...}; */ export function getFileIcon(downloadId: number, callback: (iconURL: string) => void): void; /** - * 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, runtime.lastError will contain an error message. - * @param downloadId The identifier for the download. - * @param callback A URL to an image that represents the download. - * The callback parameter should be a function that looks like this: - * function(string iconURL) {...}; + * 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, runtime.lastError will contain an error message. + * @param downloadId The identifier for the download. + * @param callback A URL to an image that represents the download. + * The callback parameter should be a function that looks like this: + * function(string iconURL) {...}; */ export function getFileIcon(downloadId: number, options: GetFileIconOptions, callback: (iconURL: string) => void): void; /** - * Resume a paused download. If the request was successful the download is in progress and unpaused. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active. + * Resume a paused download. If the request was successful the download is in progress and unpaused. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active. * @param downloadId The id of the download to resume. - * @param callback Called when the resume request is completed. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * @param callback Called when the resume request is completed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function resume(downloadId: number, callback?: () => void): void; /** - * Cancel a download. When callback is run, the download is cancelled, completed, interrupted or doesn't exist anymore. - * @param downloadId The id of the download to cancel. - * @param callback Called when the cancel request is completed. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Cancel a download. When callback is run, the download is cancelled, completed, interrupted or doesn't exist anymore. + * @param downloadId The id of the download to cancel. + * @param callback Called when the cancel request is completed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function cancel(downloadId: number, callback?: () => void): void; /** - * 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 runtime.lastError will contain a descriptive string. The error strings are not guaranteed to remain backwards compatible between releases. Extensions must not parse it. - * @param options What to download and how. - * @param callback Called with the id of the new DownloadItem. - * If you specify the callback parameter, it should be a function that looks like this: - * function(integer downloadId) {...}; + * 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 runtime.lastError will contain a descriptive string. The error strings are not guaranteed to remain backwards compatible between releases. Extensions must not parse it. + * @param options What to download and how. + * @param callback Called with the id of the new DownloadItem. + * If you specify the callback parameter, it should be a function that looks like this: + * function(integer downloadId) {...}; */ export function download(options: DownloadOptions, callback?: (downloadId: number) => void): void; /** - * Open the downloaded file now if the DownloadItem is complete; otherwise returns an error through runtime.lastError. Requires the "downloads.open" permission in addition to the "downloads" permission. An onChanged event will fire when the item is opened for the first time. - * @param downloadId The identifier for the downloaded file. + * Open the downloaded file now if the DownloadItem is complete; otherwise returns an error through runtime.lastError. Requires the "downloads.open" permission in addition to the "downloads" permission. An onChanged event will fire when the item is opened for the first time. + * @param downloadId The identifier for the downloaded file. */ export function open(downloadId: number): void; /** - * Show the downloaded file in its folder in a file manager. - * @param downloadId The identifier for the downloaded file. + * Show the downloaded file in its folder in a file manager. + * @param downloadId The identifier for the downloaded file. */ export function show(downloadId: number): void; /** Show the default Downloads folder in a file manager. */ @@ -2190,21 +2190,21 @@ declare module chrome.downloads { /** * Erase matching DownloadItem from history without deleting the downloaded file. An onErased event will fire for each DownloadItem that matches query, then callback will be called. * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function(array of integer erasedIds) {...}; + * function(array of integer erasedIds) {...}; */ export function erase(query: DownloadQuery, callback: (erasedIds: number[]) => void): void; /** - * Remove the downloaded file if it exists and the DownloadItem is complete; otherwise return an error through runtime.lastError. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Remove the downloaded file if it exists and the DownloadItem is complete; otherwise return an error through runtime.lastError. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function removeFile(downloadId: number, callback?: () => void): void; /** * Prompt the user to accept a dangerous download. Can only be called from a visible context (tab, window, or page/browser action popup). Does not automatically accept dangerous downloads. If the download is accepted, then an onChanged event will fire, otherwise nothing will happen. When all the data is fetched into a temporary file and either the download is not dangerous or the danger has been accepted, then the temporary file is renamed to the target filename, the |state| changes to 'complete', and onChanged fires. * @param downloadId The identifier for the DownloadItem. - * @param callback Called when the danger prompt dialog closes. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * @param callback Called when the danger prompt dialog closes. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function acceptDanger(downloadId: number, callback: () => void): void; /** Initiate dragging the downloaded file to another application. Call in a javascript ondragstart handler. */ @@ -2226,60 +2226,60 @@ declare module chrome.downloads { // Enterprise Platform Keys //////////////////// /** - * Use the chrome.enterprise.platformKeys API to generate hardware-backed keys and to install certificates for these keys. The certificates will be managed by the platform and can be used for TLS authentication, network access or by other extension through chrome.platformKeys. - * Availability: Since Chrome 37. - * Permissions: "enterprise.platformKeys" - * Important: This API works only on Chrome OS. - * Note: This API is only for extensions pre-installed by policy. + * Use the chrome.enterprise.platformKeys API to generate hardware-backed keys and to install certificates for these keys. The certificates will be managed by the platform and can be used for TLS authentication, network access or by other extension through chrome.platformKeys. + * Availability: Since Chrome 37. + * Permissions: "enterprise.platformKeys" + * Important: This API works only on Chrome OS. + * Note: This API is only for extensions pre-installed by policy. */ declare module chrome.enterprise.platformKeys { interface Token { /** - * Uniquely identifies this Token. + * Uniquely identifies this Token. * Static IDs are "user" and "system", referring to the platform's user-specific and the system-wide hardware token, respectively. Any other tokens (with other identifiers) might be returned by enterprise.platformKeys.getTokens. */ id: string; /** - * Implements the WebCrypto's SubtleCrypto interface. The cryptographic operations, including key generation, are hardware-backed. + * Implements the WebCrypto's SubtleCrypto interface. The cryptographic operations, including key generation, are hardware-backed. * Only non-extractable RSASSA-PKCS1-V1_5 keys with modulusLength up to 2048 can be generated. Each key can be used for signing data at most once. * Keys generated on a specific Token cannot be used with any other Tokens, nor can they be used with window.crypto.subtle. Equally, Key objects created with window.crypto.subtle cannot be used with this interface. */ subtleCrypto: SubtleCrypto; } - + /** - * Returns the available Tokens. In a regular user's session the list will always contain the user's token with id "user". If a system-wide TPM token is available, the returned list will also contain the system-wide token with id "system". The system-wide token will be the same for all sessions on this device (device in the sense of e.g. a Chromebook). - * @param callback Invoked by getTokens with the list of available Tokens. + * Returns the available Tokens. In a regular user's session the list will always contain the user's token with id "user". If a system-wide TPM token is available, the returned list will also contain the system-wide token with id "system". The system-wide token will be the same for all sessions on this device (device in the sense of e.g. a Chromebook). + * @param callback Invoked by getTokens with the list of available Tokens. * The callback parameter should be a function that looks like this: * function(array of Token tokens) {...}; - * Parameter tokens: The list of available tokens. + * Parameter tokens: The list of available tokens. */ export function getToken(callback: (tokens: Token[]) => void): void; /** - * Returns the list of all client certificates available from the given token. Can be used to check for the existence and expiration of client certificates that are usable for a certain authentication. - * @param tokenId The id of a Token returned by getTokens. - * @param callback Called back with the list of the available certificates. - * The callback parameter should be a function that looks like this: - * function(array of ArrayBuffer certificates) {...}; - * Parameter certificates: The list of certificates, each in DER encoding of a X.509 certificate. + * Returns the list of all client certificates available from the given token. Can be used to check for the existence and expiration of client certificates that are usable for a certain authentication. + * @param tokenId The id of a Token returned by getTokens. + * @param callback Called back with the list of the available certificates. + * The callback parameter should be a function that looks like this: + * function(array of ArrayBuffer certificates) {...}; + * Parameter certificates: The list of certificates, each in DER encoding of a X.509 certificate. */ export function getCertificates(tokenId: string, callback: (certificates: ArrayBuffer) => void): void; /** - * Imports certificate to the given token if the certified key is already stored in this token. After a successful certification request, this function should be used to store the obtained certificate and to make it available to the operating system and browser for authentication. - * @param tokenId The id of a Token returned by getTokens. - * @param certificate The DER encoding of a X.509 certificate. - * @param callback Called back when this operation is finished. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Imports certificate to the given token if the certified key is already stored in this token. After a successful certification request, this function should be used to store the obtained certificate and to make it available to the operating system and browser for authentication. + * @param tokenId The id of a Token returned by getTokens. + * @param certificate The DER encoding of a X.509 certificate. + * @param callback Called back when this operation is finished. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function importCertificate(tokenId: string, certificate: ArrayBuffer, callback?: () => void): void; /** - * Removes certificate from the given token if present. Should be used to remove obsolete certificates so that they are not considered during authentication and do not clutter the certificate choice. Should be used to free storage in the certificate store. - * @param tokenId The id of a Token returned by getTokens. - * @param certificate The DER encoding of a X.509 certificate. - * @param callback Called back when this operation is finished. + * Removes certificate from the given token if present. Should be used to remove obsolete certificates so that they are not considered during authentication and do not clutter the certificate choice. Should be used to free storage in the certificate store. + * @param tokenId The id of a Token returned by getTokens. + * @param certificate The DER encoding of a X.509 certificate. + * @param callback Called back when this operation is finished. * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * function() {...}; */ export function removeCertificate(tokenId: string, certificate: ArrayBuffer, callback?: () => void): void; } @@ -2288,8 +2288,8 @@ declare module chrome.enterprise.platformKeys { // Events //////////////////// /** - * The chrome.events namespace contains common types used by APIs dispatching events to notify you when something interesting happens. - * Availability: Since Chrome 21. + * The chrome.events namespace contains common types used by APIs dispatching events to notify you when something interesting happens. + * Availability: Since Chrome 21. */ declare module chrome.events { /** Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */ @@ -2298,8 +2298,8 @@ declare module chrome.events { schemes?: string[]; /** * Optional. - * Since Chrome 23. - * Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. + * Since Chrome 23. + * Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. */ urlMatches?: string; /** Optional. Matches if the path segment of the URL contains a specified string. */ @@ -2338,8 +2338,8 @@ declare module chrome.events { ports?: any[]; /** * Optional. - * Since Chrome 28. - * Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. + * Since Chrome 28. + * Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. */ originAndPathMatches?: string; } @@ -2347,62 +2347,62 @@ declare module chrome.events { /** An object which allows the addition and removal of listeners for a Chrome event. */ interface Event { /** - * Registers an event listener callback to an event. - * @param callback Called when an event occurs. The parameters of this function depend on the type of event. + * Registers an event listener callback to an event. + * @param callback Called when an event occurs. The parameters of this function depend on the type of event. * The callback parameter should be a function that looks like this: - * function() {...}; + * function() {...}; */ addListener(callback: T): void; /** - * Returns currently registered rules. - * @param callback Called with registered rules. + * Returns currently registered rules. + * @param callback Called with registered rules. * The callback parameter should be a function that looks like this: * function(array of Rule rules) {...}; - * Parameter rules: Rules that were registered, the optional parameters are filled with values. + * Parameter rules: Rules that were registered, the optional parameters are filled with values. */ getRules(callback: (rules: Rule[]) => void): void; /** - * Returns currently registered rules. - * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are returned. - * @param callback Called with registered rules. + * Returns currently registered rules. + * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are returned. + * @param callback Called with registered rules. * The callback parameter should be a function that looks like this: * function(array of Rule rules) {...}; - * Parameter rules: Rules that were registered, the optional parameters are filled with values. + * Parameter rules: Rules that were registered, the optional parameters are filled with values. */ getRules(ruleIdentifiers: string[], callback: (rules: Rule[]) => void): void; /** - * @param callback Listener whose registration status shall be tested. + * @param callback Listener whose registration status shall be tested. */ hasListener(callback: T): boolean; /** - * Unregisters currently registered rules. - * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are unregistered. - * @param callback Called when rules were unregistered. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Unregisters currently registered rules. + * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are unregistered. + * @param callback Called when rules were unregistered. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ removeRules(ruleIdentifiers?: string[], callback?: () => void): void; /** - * Unregisters currently registered rules. - * @param callback Called when rules were unregistered. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Unregisters currently registered rules. + * @param callback Called when rules were unregistered. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ removeRules(callback?: () => void): void; /** - * Registers rules to handle events. - * @param rules Rules to be registered. These do not replace previously registered rules. - * @param callback Called with registered rules. - * If you specify the callback parameter, it should be a function that looks like this: - * function(array of Rule rules) {...}; - * Parameter rules: Rules that were registered, the optional parameters are filled with values. + * Registers rules to handle events. + * @param rules Rules to be registered. These do not replace previously registered rules. + * @param callback Called with registered rules. + * If you specify the callback parameter, it should be a function that looks like this: + * function(array of Rule rules) {...}; + * Parameter rules: Rules that were registered, the optional parameters are filled with values. */ addRules(rules: Rule[], callback?: (rules: Rule[]) => void): void; /** - * Deregisters an event listener callback from an event. - * @param callback Listener that shall be unregistered. + * Deregisters an event listener callback from an event. + * @param callback Listener that shall be unregistered. * The callback parameter should be a function that looks like this: - * function() {...}; + * function() {...}; */ removeListener(callback: T): void; hasListeners(): boolean; @@ -2420,8 +2420,8 @@ declare module chrome.events { actions: any[]; /** * Optional. - * Since Chrome 28. - * Tags can be used to annotate rules and perform operations on sets of rules. + * Since Chrome 28. + * Tags can be used to annotate rules and perform operations on sets of rules. */ tags?: string[]; } @@ -2431,8 +2431,8 @@ declare module chrome.events { // Extension //////////////////// /** - * The chrome.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 Message Passing. - * Availability: Since Chrome 5. + * The chrome.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 Message Passing. + * Availability: Since Chrome 5. */ declare module chrome.extension { interface FetchProperties { @@ -2450,8 +2450,8 @@ declare module chrome.extension { interface OnRequestEvent extends chrome.events.Event<((request: any, sender: runtime.MessageSender, sendResponse: (response: any) => void) => void) | ((sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)> {} /** - * Since Chrome 7. - * 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. + * Since Chrome 7. + * 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. */ var inIncognitoContext: boolean; /** 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. */ @@ -2459,65 +2459,65 @@ declare module chrome.extension { /** Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page. */ export function getBackgroundPage(): Window; - /** + /** * Converts a relative path within an extension install directory to a fully-qualified URL. - * @param path A path to a resource within an extension expressed relative to its install directory. + * @param path A path to a resource within an extension expressed relative to its install directory. */ export function getURL(path: string): string; /** - * 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 Chrome Extension Gallery. - * Since Chrome 9. + * 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 Chrome Extension Gallery. + * Since Chrome 9. */ export function setUpdateUrlData(data: string): void; /** Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension. */ export function getViews(fetchProperties?: FetchProperties): Window[]; /** - * Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox. - * Since Chrome 12. - * @param callback The callback parameter should be a function that looks like this: + * Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox. + * Since Chrome 12. + * @param callback The callback parameter should be a function that looks like this: * function(boolean isAllowedAccess) {...}; - * Parameter isAllowedAccess: True if the extension can access the 'file://' scheme, false otherwise. + * Parameter isAllowedAccess: True if the extension can access the 'file://' scheme, false otherwise. */ export function isAllowedFileSchemeAccess(callback: (isAllowedAccess: boolean) => void): void; /** - * Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox. - * Since Chrome 12. - * @param callback The callback parameter should be a function that looks like this: + * Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox. + * Since Chrome 12. + * @param callback The callback parameter should be a function that looks like this: * function(boolean isAllowedAccess) {...}; - * Parameter isAllowedAccess: True if the extension has access to Incognito mode, false otherwise. + * Parameter isAllowedAccess: True if the extension has access to Incognito mode, false otherwise. */ export function isAllowedIncognitoAccess(callback: (isAllowedAccess: boolean) => void): void; /** - * Sends a single request to other listeners within the extension. Similar to runtime.connect, but only sends a single request with an optional response. The extension.onRequest event is fired in each page of the extension. + * Sends a single request to other listeners within the extension. Similar to runtime.connect, but only sends a single request with an optional response. The extension.onRequest event is fired in each page of the extension. * @deprecated Deprecated since Chrome 33. Please use runtime.sendMessage. - * @param extensionId The extension ID of the extension you want to connect to. If omitted, default is your own extension. - * @param responseCallback If you specify the responseCallback parameter, it should be a function that looks like this: + * @param extensionId The extension ID of the extension you want to connect to. If omitted, default is your own extension. + * @param responseCallback If you specify the responseCallback parameter, it should be a function that looks like this: * function(any response) {...}; - * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. + * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. */ export function sendRequest(extensionId: string, request: any, responseCallback?: (response: any) => void): void; /** - * Sends a single request to other listeners within the extension. Similar to runtime.connect, but only sends a single request with an optional response. The extension.onRequest event is fired in each page of the extension. + * Sends a single request to other listeners within the extension. Similar to runtime.connect, but only sends a single request with an optional response. The extension.onRequest event is fired in each page of the extension. * @deprecated Deprecated since Chrome 33. Please use runtime.sendMessage. - * @param responseCallback If you specify the responseCallback parameter, it should be a function that looks like this: + * @param responseCallback If you specify the responseCallback parameter, it should be a function that looks like this: * function(any response) {...}; - * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. + * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. */ export function sendRequest(request: any, responseCallback?: (response: any) => void): void; /** - * Returns an array of the JavaScript 'window' objects for each of the tabs running inside the current extension. If windowId is specified, returns only the 'window' objects of tabs attached to the specified window. - * @deprecated Deprecated since Chrome 33. Please use extension.getViews {type: "tab"}. + * Returns an array of the JavaScript 'window' objects for each of the tabs running inside the current extension. If windowId is specified, returns only the 'window' objects of tabs attached to the specified window. + * @deprecated Deprecated since Chrome 33. Please use extension.getViews {type: "tab"}. */ export function getExtensionTabs(windowId?: number): Window[]; - + /** - * Fired when a request is sent from either an extension process or a content script. - * @deprecated Deprecated since Chrome 33. Please use runtime.onMessage. + * Fired when a request is sent from either an extension process or a content script. + * @deprecated Deprecated since Chrome 33. Please use runtime.onMessage. */ var onRequest: OnRequestEvent; /** - * Fired when a request is sent from another extension. - * @deprecated Deprecated since Chrome 33. Please use runtime.onMessageExternal. + * Fired when a request is sent from another extension. + * @deprecated Deprecated since Chrome 33. Please use runtime.onMessageExternal. */ var onRequestExternal: OnRequestEvent; } @@ -2526,17 +2526,17 @@ declare module chrome.extension { // File Browser Handler //////////////////// /** - * Use the chrome.fileBrowserHandler API to extend the Chrome OS file browser. For example, you can use this API to enable users to upload files to your website. - * Availability: Since Chrome 12. - * Permissions: "fileBrowserHandler" - * Important: This API works only on Chrome OS. + * Use the chrome.fileBrowserHandler API to extend the Chrome OS file browser. For example, you can use this API to enable users to upload files to your website. + * Availability: Since Chrome 12. + * Permissions: "fileBrowserHandler" + * Important: This API works only on Chrome OS. */ declare module chrome.fileBrowserHandler { interface SelectionParams { /** * Optional. - * List of file extensions that the selected file can have. The list is also used to specify what files to be shown in the select file dialog. Files with the listed extensions are only shown in the dialog. Extensions should not include the leading '.'. Example: ['jpg', 'png'] - * Since Chrome 23. + * List of file extensions that the selected file can have. The list is also used to specify what files to be shown in the select file dialog. Files with the listed extensions are only shown in the dialog. Extensions should not include the leading '.'. Example: ['jpg', 'png'] + * Since Chrome 23. */ allowedFileExtensions?: string[]; /** Suggested name for the file. */ @@ -2561,16 +2561,16 @@ declare module chrome.fileBrowserHandler { interface FileBrowserHandlerExecuteEvent extends chrome.events.Event<(id: string, details: FileHandlerExecuteEventDetails) => void> {} /** - * Prompts user to select file path under which file should be saved. When the file is selected, file access permission required to use the file (read, write and create) are granted to the caller. The file will not actually get created during the function call, so function caller must ensure its existence before using it. The function has to be invoked with a user gesture. - * Since Chrome 21. - * @param selectionParams Parameters that will be used while selecting the file. - * @param callback Function called upon completion. - * The callback parameter should be a function that looks like this: - * function(object result) {...}; - * Parameter result: Result of the method. + * Prompts user to select file path under which file should be saved. When the file is selected, file access permission required to use the file (read, write and create) are granted to the caller. The file will not actually get created during the function call, so function caller must ensure its existence before using it. The function has to be invoked with a user gesture. + * Since Chrome 21. + * @param selectionParams Parameters that will be used while selecting the file. + * @param callback Function called upon completion. + * The callback parameter should be a function that looks like this: + * function(object result) {...}; + * Parameter result: Result of the method. */ export function selectFile(selectionParams: SelectionParams, callback: (result: SelectionResult) => void): void; - + /** Fired when file system action is executed from ChromeOS file browser. */ var onExecute: FileBrowserHandlerExecuteEvent; } @@ -2579,10 +2579,10 @@ declare module chrome.fileBrowserHandler { // File System Provider //////////////////// /** - * Use the chrome.fileSystemProvider API to create file systems, that can be accessible from the file manager on Chrome OS. - * Availability: Since Chrome 40. - * Permissions: "fileSystemProvider" - * Important: This API works only on Chrome OS. + * Use the chrome.fileSystemProvider API to create file systems, that can be accessible from the file manager on Chrome OS. + * Availability: Since Chrome 40. + * Permissions: "fileSystemProvider" + * Important: This API works only on Chrome OS. */ declare module chrome.fileSystemProvider { interface OpenedFileInfo { @@ -2625,29 +2625,29 @@ declare module chrome.fileSystemProvider { displayName: string; /** Whether the file system supports operations which may change contents of the file system (such as creating, deleting or writing to files). */ writable: boolean; - /** - * The maximum number of files that can be opened at once. If 0, then not limited. + /** + * The maximum number of files that can be opened at once. If 0, then not limited. * @since Since Chrome 42. */ openedFilesLimit: number; /** - * List of currently opened files. + * List of currently opened files. * @since Since Chrome 42. */ openedFiles: OpenedFileInfo[]; /** * Optional. - * Whether the file system supports the tag field for observing directories. - * @since Since Chrome 45. Warning: this is the current Beta channel. + * Whether the file system supports the tag field for observing directories. + * @since Since Chrome 45. Warning: this is the current Beta channel. */ supportsNotifyTag?: boolean; /** - * List of watchers. - * @since Since Chrome 45. Warning: this is the current Beta channel. + * List of watchers. + * @since Since Chrome 45. Warning: this is the current Beta channel. */ watchers: FileWatchersInfo[]; } - + /** @since Since Chrome 45. Warning: this is the current Beta channel. */ interface GetActionsRequestedOptions { /** The identifier of the file system related to this operation. */ @@ -2657,7 +2657,7 @@ declare module chrome.fileSystemProvider { /** The path of the entry to return the list of actions for. */ entryPath: string; } - + /** @since Since Chrome 45. Warning: this is the current Beta channel. */ interface Action { /** The identifier of the action. Any string or CommonActionId for common actions. */ @@ -2665,7 +2665,7 @@ declare module chrome.fileSystemProvider { /** Optional. The title of the action. It may be ignored for common actions. */ title?: string; } - + /** @since Since Chrome 45. Warning: this is the current Beta channel. */ interface ExecuteActionRequestedOptions { /** The identifier of the file system related to this operation. */ @@ -2687,13 +2687,13 @@ declare module chrome.fileSystemProvider { writable?: boolean; /** * Optional. - * The maximum number of files that can be opened at once. If not specified, or 0, then not limited. + * The maximum number of files that can be opened at once. If not specified, or 0, then not limited. * @since Since Chrome 41. */ openedFilesLimit?: number; /** * Optional. - * Whether the file system supports the tag field for observed directories. + * Whether the file system supports the tag field for observed directories. * @since Since Chrome 45. Warning: this is the current Beta channel. */ supportsNotifyTag?: boolean; @@ -2831,37 +2831,37 @@ declare module chrome.fileSystemProvider { interface OperationRequestedEvent extends chrome.events.Event<(options: OperationRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} interface OptionlessRequestedEvent extends chrome.events.Event<(successCallback: Function, errorCallback: (error: string) => void) => void> {} - + /** * Mounts a file system with the given fileSystemId and displayName. displayName will be shown in the left panel of Files.app. displayName can contain any characters including '/', but cannot be an empty string. displayName must be descriptive but doesn't have to be unique. The fileSystemId must not be an empty string. * Depending on the type of the file system being mounted, the source option must be set appropriately. * In case of an error, runtime.lastError will be set with a corresponding error code. - * @param callback A generic result callback to indicate success or failure. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * @param callback A generic result callback to indicate success or failure. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function mount(options: MountOptions, callback?: () => void): void; /** * Unmounts a file system with the given fileSystemId. It must be called after onUnmountRequested is invoked. Also, the providing extension can decide to perform unmounting if not requested (eg. in case of lost connection, or a file error). * In case of an error, runtime.lastError will be set with a corresponding error code. - * @param callback A generic result callback to indicate success or failure. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * @param callback A generic result callback to indicate success or failure. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function unmount(options: UnmountOptions, callback?: () => void): void; /** - * Returns all file systems mounted by the extension. - * @param callback Callback to receive the result of getAll function. - * The callback parameter should be a function that looks like this: - * function(array of FileSystemInfo fileSystems) {...}; + * Returns all file systems mounted by the extension. + * @param callback Callback to receive the result of getAll function. + * The callback parameter should be a function that looks like this: + * function(array of FileSystemInfo fileSystems) {...}; */ export function getAll(callback: (fileSystems: FileSystemInfo[]) => void): void; /** - * Returns information about a file system with the passed fileSystemId. - * @since Since Chrome 42. - * @param callback Callback to receive the result of get function. - * The callback parameter should be a function that looks like this: - * function(FileSystemInfo fileSystem) {...}; + * Returns information about a file system with the passed fileSystemId. + * @since Since Chrome 42. + * @param callback Callback to receive the result of get function. + * The callback parameter should be a function that looks like this: + * function(FileSystemInfo fileSystem) {...}; */ export function get(fileSystemId: string, callback: (fileSystem: FileSystemInfo) => void): void; /** @@ -2871,12 +2871,12 @@ declare module chrome.fileSystemProvider { * Not all providers are able to provide a tag, but if the file system has a changelog, then the tag can be eg. a change number, or a revision number. * Note that if a parent directory is removed, then all descendant entries are also removed, and if they are watched, then the API must be notified about the fact. Also, if a directory is renamed, then all descendant entries are in fact removed, as there is no entry under their original paths anymore. * In case of an error, runtime.lastError will be set will a corresponding error code. - * @param callback A generic result callback to indicate success or failure. + * @param callback A generic result callback to indicate success or failure. * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * function() {...}; */ export function notify(options: NotificationOptions, callback: () => void): void; - + /** Raised when unmounting for the file system with the fileSystemId identifier is requested. In the response, the unmount API method must be called together with successCallback. If unmounting is not possible (eg. due to a pending operation), then errorCallback must be called. */ var onUnmountRequested: RequestedEvent; /** Raised when metadata of a file or a directory at entryPath is requested. The metadata must be returned with the successCallback call. In case of an error, errorCallback must be called. */ @@ -2906,23 +2906,23 @@ declare module chrome.fileSystemProvider { /** Raised when aborting an operation with operationRequestId is requested. The operation executed with operationRequestId must be immediately stopped and successCallback of this abort request executed. If aborting fails, then errorCallback must be called. Note, that callbacks of the aborted operation must not be called, as they will be ignored. Despite calling errorCallback, the request may be forcibly aborted. */ var onAbortRequested: OperationRequestedEvent; /** - * Raised when showing a configuration dialog for fileSystemId is requested. If it's handled, the file_system_provider.configurable manfiest option must be set to true. - * @since Since Chrome 44. + * Raised when showing a configuration dialog for fileSystemId is requested. If it's handled, the file_system_provider.configurable manfiest option must be set to true. + * @since Since Chrome 44. */ var onConfigureRequested: RequestedEvent; /** - * Raised when showing a dialog for mounting a new file system is requested. If the extension/app is a file handler, then this event shouldn't be handled. Instead app.runtime.onLaunched should be handled in order to mount new file systems when a file is opened. For multiple mounts, the file_system_provider.multiple_mounts manifest option must be set to true. - * @since Since Chrome 44. + * Raised when showing a dialog for mounting a new file system is requested. If the extension/app is a file handler, then this event shouldn't be handled. Instead app.runtime.onLaunched should be handled in order to mount new file systems when a file is opened. For multiple mounts, the file_system_provider.multiple_mounts manifest option must be set to true. + * @since Since Chrome 44. */ var onMountRequested: OptionlessRequestedEvent; /** - * Raised when setting a new directory watcher is requested. If an error occurs, then errorCallback must be called. + * Raised when setting a new directory watcher is requested. If an error occurs, then errorCallback must be called. * @since Since Chrome 45. Warning: this is the current Beta channel. */ var onAddWatcherRequested: EntryPathRecursiveRequestedEvent; /** - * Raised when the watcher should be removed. If an error occurs, then errorCallback must be called. - * @since Since Chrome 45. Warning: this is the current Beta channel. + * Raised when the watcher should be removed. If an error occurs, then errorCallback must be called. + * @since Since Chrome 45. Warning: this is the current Beta channel. */ var onRemoveWatcherRequested: EntryPathRecursiveRequestedEvent; } @@ -2931,9 +2931,9 @@ declare module chrome.fileSystemProvider { // Font Settings //////////////////// /** - * Use the chrome.fontSettings API to manage Chrome's font settings. - * Availability: Since Chrome 22. - * Permissions: "fontSettings" + * Use the chrome.fontSettings API to manage Chrome's font settings. + * Availability: Since Chrome 22. + * Permissions: "fontSettings" */ declare module chrome.fontSettings { /** Represents a font name. */ @@ -3000,87 +3000,87 @@ declare module chrome.fontSettings { interface FontChangedEvent extends chrome.events.Event<(details: FullFontDetails) => void> {} /** - * Sets the default font size. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Sets the default font size. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function setDefaultFontSize(details: DefaultFontSizeDetails, callback?: Function): void; /** - * Gets the font for a given script and generic font family. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function(object details) {...}; + * Gets the font for a given script and generic font family. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; */ export function getFont(details: FontDetails, callback?: (details: FontDetailsResult) => void): void; /** - * Gets the default font size. - * @param details This parameter is currently unused. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function(object details) {...}; + * Gets the default font size. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; */ export function getDefaultFontSize(details?: Object, callback?: (options: FontSizeDetails) => void): void; /** - * Gets the minimum font size. - * @param details This parameter is currently unused. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function(object details) {...}; + * Gets the minimum font size. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; */ export function getMinimumFontSize(details?: FontSizeDetails, callback?: (options: FontSizeDetails) => void): void; /** - * Sets the minimum font size. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Sets the minimum font size. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function setMinimumFontSize(details: SetFontSizeDetails, callback?: Function): void; /** - * Gets the default size for fixed width fonts. - * @param details This parameter is currently unused. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function(object details) {...}; + * Gets the default size for fixed width fonts. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; */ export function getDefaultFixedFontSize(details?: Object, callback?: (details: FontSizeDetails) => void): void; /** - * Clears the default font size set by this extension, if any. - * @param details This parameter is currently unused. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears the default font size set by this extension, if any. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function clearDefaultFontSize(details?: Object, callback?: Function): void; /** - * Sets the default size for fixed width fonts. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Sets the default size for fixed width fonts. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function setDefaultFixedFontSize(details: SetFontSizeDetails, callback?: Function): void; /** - * Clears the font set by this extension, if any. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears the font set by this extension, if any. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function clearFont(details: FontDetails, callback?: Function): void; /** - * Sets the font for a given script and generic font family. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function(object details) {...}; + * Sets the font for a given script and generic font family. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; */ export function setFont(details: SetFontDetails, callback?: Function): void; /** - * Clears the minimum font size set by this extension, if any. - * @param details This parameter is currently unused. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears the minimum font size set by this extension, if any. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function clearMinimumFontSize(details?: Object, callback?: Function): void; /** - * Gets a list of fonts on the system. - * @param callback The callback parameter should be a function that looks like this: - * function(array of FontName results) {...}; + * Gets a list of fonts on the system. + * @param callback The callback parameter should be a function that looks like this: + * function(array of FontName results) {...}; */ export function getFontList(callback: (results: FontName[]) => void): void; /** - * Clears the default fixed font size set by this extension, if any. - * @param details This parameter is currently unused. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Clears the default fixed font size set by this extension, if any. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function clearDefaultFixedFontSize(details: Object, callback?: Function): void; @@ -3098,9 +3098,9 @@ declare module chrome.fontSettings { // Google Cloud Messaging //////////////////// /** - * Use chrome.gcm to enable apps and extensions to send and receive messages through the Google Cloud Messaging Service. - * Availability: Since Chrome 35. - * Permissions: "gcm" + * Use chrome.gcm to enable apps and extensions to send and receive messages through the Google Cloud Messaging Service. + * Availability: Since Chrome 35. + * Permissions: "gcm" */ declare module chrome.gcm { interface OutgoingMessage { @@ -3119,13 +3119,13 @@ declare module chrome.gcm { data: Object; /** * Optional. - * The sender who issued the message. - * @since Since Chrome 41. + * The sender who issued the message. + * @since Since Chrome 41. */ from?: string; /** * Optional. - * The collapse key of a message. See Collapsible Messages section of Cloud Messaging documentation for details. + * The collapse key of a message. See Collapsible Messages section of Cloud Messaging documentation for details. */ collapseKey?: string; } @@ -3144,36 +3144,36 @@ declare module chrome.gcm { interface MessageDeletionEvent extends chrome.events.Event<() => void> {} interface GcmErrorEvent extends chrome.events.Event<(error: GcmError) => void> {} - + /** The maximum size (in bytes) of all key/value pairs in a message. */ var MAX_MESSAGE_SIZE: number; - + /** - * Registers the application with GCM. The registration ID will be returned by the callback. If register is called again with the same list of senderIds, the same registration ID will be returned. - * @param senderIds A list of server IDs that are allowed to send messages to the application. It should contain at least one and no more than 100 sender IDs. - * @param callback Function called when registration completes. It should check runtime.lastError for error when registrationId is empty. - * The callback parameter should be a function that looks like this: + * Registers the application with GCM. The registration ID will be returned by the callback. If register is called again with the same list of senderIds, the same registration ID will be returned. + * @param senderIds A list of server IDs that are allowed to send messages to the application. It should contain at least one and no more than 100 sender IDs. + * @param callback Function called when registration completes. It should check runtime.lastError for error when registrationId is empty. + * The callback parameter should be a function that looks like this: * function(string registrationId) {...}; - * Parameter registrationId: A registration ID assigned to the application by the GCM. + * Parameter registrationId: A registration ID assigned to the application by the GCM. */ export function register(senderIds: string[], callback: (registrationId: string) => void): void; /** - * Unregisters the application from GCM. - * @param callback A function called after the unregistration completes. Unregistration was successful if runtime.lastError is not set. + * Unregisters the application from GCM. + * @param callback A function called after the unregistration completes. Unregistration was successful if runtime.lastError is not set. * The callback parameter should be a function that looks like this: - * function() {...}; + * function() {...}; */ export function unregister(callback: () => void): void; /** - * Sends a message according to its contents. - * @param message A message to send to the other party via GCM. - * @param callback A function called after the message is successfully queued for sending. runtime.lastError should be checked, to ensure a message was sent without problems. + * Sends a message according to its contents. + * @param message A message to send to the other party via GCM. + * @param callback A function called after the message is successfully queued for sending. runtime.lastError should be checked, to ensure a message was sent without problems. * The callback parameter should be a function that looks like this: * function(string messageId) {...}; - * Parameter messageId: The ID of the message that the callback was issued for. + * Parameter messageId: The ID of the message that the callback was issued for. */ export function send(message: OutgoingMessage, callback: (messageId: string) => void): void; - + /** Fired when a message is received through GCM. */ var onMessage: MessageReceptionEvent; /** Fired when a GCM server had to delete messages sent by an app server to the application. See Messages deleted event section of Cloud Messaging documentation for details on handling this event. */ @@ -3186,9 +3186,9 @@ declare module chrome.gcm { // History //////////////////// /** - * Use the chrome.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 Override Pages. - * Availability: Since Chrome 5. - * Permissions: "history" + * Use the chrome.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 Override Pages. + * Availability: Since Chrome 5. + * Permissions: "history" */ declare module chrome.history { /** An object encapsulating one visit to a URL. */ @@ -3256,39 +3256,39 @@ declare module chrome.history { interface HistoryVisitRemovedEvent extends chrome.events.Event<(removed: RemovedResult) => void> {} /** - * Searches the history for the last visit time of each page matching the query. - * @param callback The callback parameter should be a function that looks like this: - * function(array of HistoryItem results) {...}; + * Searches the history for the last visit time of each page matching the query. + * @param callback The callback parameter should be a function that looks like this: + * function(array of HistoryItem results) {...}; */ export function search(query: HistoryQuery, callback: (results: HistoryItem[]) => void): void; /** - * Adds a URL to the history at the current time with a transition type of "link". - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Adds a URL to the history at the current time with a transition type of "link". + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function addUrl(details: Url, callback?: () => void): void; /** - * 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. - * @param callback The callback parameter should be a function that looks like this: - * function() {...}; + * 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. + * @param callback The callback parameter should be a function that looks like this: + * function() {...}; */ export function deleteRange(range: Range, callback: () => void): void; /** - * Deletes all items from the history. - * @param callback The callback parameter should be a function that looks like this: - * function() {...}; + * Deletes all items from the history. + * @param callback The callback parameter should be a function that looks like this: + * function() {...}; */ export function deleteAll(callback: () => void): void; /** - * Retrieves information about visits to a URL. - * @param callback The callback parameter should be a function that looks like this: - * function(array of VisitItem results) {...}; + * Retrieves information about visits to a URL. + * @param callback The callback parameter should be a function that looks like this: + * function(array of VisitItem results) {...}; */ export function getVisits(details: Url, callback: (results: VisitItem[]) => void): void; /** - * Removes all occurrences of the given URL from the history. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Removes all occurrences of the given URL from the history. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function deleteUrl(details: Url, callback?: () => void): void; @@ -3302,26 +3302,26 @@ declare module chrome.history { // i18n //////////////////// /** - * Use the chrome.i18n infrastructure to implement internationalization across your whole app or extension. - * @since Chrome 5. + * Use the chrome.i18n infrastructure to implement internationalization across your whole app or extension. + * @since Chrome 5. */ declare module chrome.i18n { /** - * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use i18n.getUILanguage. - * @param callback The callback parameter should be a function that looks like this: + * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use i18n.getUILanguage. + * @param callback The callback parameter should be a function that looks like this: * function(array of string languages) {...}; - * Parameter languages: Array of the accept languages of the browser, such as en-US,en,zh-CN + * Parameter languages: Array of the accept languages of the browser, such as en-US,en,zh-CN */ export function getAcceptLanguages(callback: (languages: string[]) => void): void; /** - * 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. + * 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. * @param messageName The name of the message, as specified in the messages.json file. - * @param substitutions Optional. Up to 9 substitution strings, if the message requires any. + * @param substitutions Optional. Up to 9 substitution strings, if the message requires any. */ export function getMessage(messageName: string, substitutions?: any): string; /** - * Gets the browser UI language of the browser. This is different from i18n.getAcceptLanguages which returns the preferred user languages. - * @since Chrome 35. + * Gets the browser UI language of the browser. This is different from i18n.getAcceptLanguages which returns the preferred user languages. + * @since Chrome 35. */ export function getUILanguage(): string; } @@ -3330,9 +3330,9 @@ declare module chrome.i18n { // Identity //////////////////// /** - * Use the chrome.identity API to get OAuth2 access tokens. - * Permissions: "identity" - * @since Chrome 29. + * Use the chrome.identity API to get OAuth2 access tokens. + * Permissions: "identity" + * @since Chrome 29. */ declare module chrome.identity { /** @since Chrome 32. */ @@ -3343,8 +3343,8 @@ declare module chrome.identity { interface TokenDetails { /** - * Optional. - * Fetching a token may require the user to sign-in to Chrome, or approve the application's requested scopes. If the interactive flag is true, getAuthToken will prompt the user as necessary. When the flag is false or omitted, getAuthToken will return failure any time a prompt would be required. + * Optional. + * Fetching a token may require the user to sign-in to Chrome, or approve the application's requested scopes. If the interactive flag is true, getAuthToken will prompt the user as necessary. When the flag is false or omitted, getAuthToken will return failure any time a prompt would be required. */ interactive?: boolean; /** @@ -3399,10 +3399,10 @@ declare module chrome.identity { * Gets an OAuth2 access token using the client ID and scopes specified in the oauth2 section of manifest.json. * The Identity API caches access tokens in memory, so it's ok to call getAuthToken non-interactively any time a token is required. The token cache automatically handles expiration. * For a good user experience it is important interactive token requests are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests, or Chrome sign in screens if they are not signed in, with with no context. In particular, do not use getAuthToken interactively when your app is first launched. - * @param details Token options. - * @param callback Called with an OAuth2 access token as specified by the manifest, or undefined if there was an error. + * @param details Token options. + * @param callback Called with an OAuth2 access token as specified by the manifest, or undefined if there was an error. * If you specify the callback parameter, it should be a function that looks like this: - * function(string token) {...}; + * function(string token) {...}; */ export function getAuthToken(details: TokenDetails, callback?: (token: string) => void): void; /** @@ -3414,32 +3414,32 @@ declare module chrome.identity { /** * Removes an OAuth2 access token from the Identity API's token cache. * If an access token is discovered to be invalid, it should be passed to removeCachedAuthToken to remove it from the cache. The app may then retrieve a fresh token with getAuthToken. - * @param details Token information. - * @param callback Called when the token has been removed from the cache. + * @param details Token information. + * @param callback Called when the token has been removed from the cache. * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * function() {...}; */ export function removeCachedAuthToken(details: TokenInformation, callback?: () => void): void; /** * Starts an auth flow at the specified URL. * This method enables auth flows with non-Google identity providers by launching a web view and navigating it to the first URL in the provider's auth flow. When the provider redirects to a URL matching the pattern https://.chromiumapp.org/*, the window will close, and the final redirect URL will be passed to the callback function. * For a good user experience it is important interactive auth flows are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests with no context. In particular, do not launch an interactive auth flow when your app is first launched. - * @param details WebAuth flow options. - * @param callback Called with the URL redirected back to your application. + * @param details WebAuth flow options. + * @param callback Called with the URL redirected back to your application. * The callback parameter should be a function that looks like this: - * function(string responseUrl) {...}; + * function(string responseUrl) {...}; */ export function launchWebAuthFlow(details: WebAuthFlowOptions, callback: (responseUrl?: string) => void): void; /** * Generates a redirect URL to be used in launchWebAuthFlow. * The generated URLs match the pattern https://.chromiumapp.org/*. * @since Chrome 33. - * @param path Optional. The path appended to the end of the generated URL. + * @param path Optional. The path appended to the end of the generated URL. */ export function getRedirectURL(path?: string): string; /** - * Fired when signin state changes for an account on the user's profile. + * Fired when signin state changes for an account on the user's profile. * @since Chrome 33. */ var onSignInChanged: SignInChangeEvent; @@ -3449,25 +3449,25 @@ declare module chrome.identity { // Idle //////////////////// /** - * Use the chrome.idle API to detect when the machine's idle state changes. - * Permissions: "idle" + * Use the chrome.idle API to detect when the machine's idle state changes. + * Permissions: "idle" * @since Chrome 6. */ declare module chrome.idle { interface IdleStateChangedEvent extends chrome.events.Event<(newState: string) => void> {} /** - * Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise. - * @param detectionIntervalInSeconds The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected. - * Since Chrome 25. - * @param callback The callback parameter should be a function that looks like this: - * function( IdleState newState) {...}; + * Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise. + * @param detectionIntervalInSeconds The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected. + * Since Chrome 25. + * @param callback The callback parameter should be a function that looks like this: + * function( IdleState newState) {...}; */ export function queryState(detectionIntervalInSeconds: number, callback: (newState: string) => void): void; /** - * 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. + * 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. * @since Chrome 25. - * @param intervalInSeconds Threshold, in seconds, used to determine when the system is in an idle state. + * @param intervalInSeconds Threshold, in seconds, used to determine when the system is in an idle state. */ export function setDetectionInterval(intervalInSeconds: number): void; @@ -3479,8 +3479,8 @@ declare module chrome.idle { // Input - IME //////////////////// /** - * Use the chrome.input.ime API to implement a custom IME for Chrome OS. This allows your extension to handle keystrokes, set the composition, and manage the candidate window. - * Permissions: "input" + * Use the chrome.input.ime API to implement a custom IME for Chrome OS. This allows your extension to handle keystrokes, set the composition, and manage the candidate window. + * Permissions: "input" * @since Chrome 21. */ declare module chrome.input.ime { @@ -3488,12 +3488,12 @@ declare module chrome.input.ime { interface KeyboardEvent { /** * Optional. - * Whether or not the SHIFT key is pressed. + * Whether or not the SHIFT key is pressed. */ shiftKey?: boolean; /** * Optional. - * Whether or not the ALT key is pressed. + * Whether or not the ALT key is pressed. */ altKey?: boolean; /** The ID of the request. */ @@ -3502,32 +3502,32 @@ declare module chrome.input.ime { key: string; /** * Optional. - * Whether or not the CTRL key is pressed. + * Whether or not the CTRL key is pressed. */ ctrlKey?: boolean; /** One of keyup or keydown. */ type: string; /** * Optional. - * The extension ID of the sender of this keyevent. + * The extension ID of the sender of this keyevent. * @since Chrome 34. */ extensionId?: string; /** * Optional. - * Value of the physical key being pressed. The value is not affected by current keyboard layout or modifier state. + * Value of the physical key being pressed. The value is not affected by current keyboard layout or modifier state. * @since Chrome 26. */ code: string; /** * Optional. - * The deprecated HTML keyCode, which is system- and implementation-dependent numerical code signifying the unmodified identifier associated with the key pressed. + * The deprecated HTML keyCode, which is system- and implementation-dependent numerical code signifying the unmodified identifier associated with the key pressed. * @since Chrome 37. */ keyCode?: number; /** * Optional. - * Whether or not the CAPS_LOCK is enabled. + * Whether or not the CAPS_LOCK is enabled. * @since Chrome 29. */ capsLock?: boolean; @@ -3540,22 +3540,22 @@ declare module chrome.input.ime { /** Type of value this text field edits, (Text, Number, URL, etc) */ type: string; /** - * Whether the text field wants auto-correct. + * Whether the text field wants auto-correct. * @since Chrome 40. */ autoCorrect: boolean; /** - * Whether the text field wants auto-complete. + * Whether the text field wants auto-complete. * @since Chrome 40. */ autoComplete: boolean; /** - * Whether the text field wants spell-check. + * Whether the text field wants spell-check. * @since Chrome 40. */ spellCheck: boolean; } - + /** * A menu item used by an input method to interact with the user from the language menu. * @since Chrome 30. @@ -3601,24 +3601,24 @@ declare module chrome.input.ime { candidate: string; /** The candidate's id */ id: number; - /** + /** * Optional. - * The id to add these candidates under + * The id to add these candidates under */ parentId?: number; /** * Optional. - * Short string displayed to next to the candidate, often the shortcut key or index + * Short string displayed to next to the candidate, often the shortcut key or index */ label?: string; /** * Optional. - * Additional text describing the candidate + * Additional text describing the candidate */ annotation?: string; /** * Optional. - * The usage or detail description of word. + * The usage or detail description of word. */ usage?: CandidateUsage; } @@ -3662,37 +3662,37 @@ declare module chrome.input.ime { interface CandidateWindowParameterProperties { /** * Optional. - * True to show the cursor, false to hide it. + * True to show the cursor, false to hide it. */ cursorVisible?: boolean; /** * Optional. - * True if the candidate window should be rendered vertical, false to make it horizontal. + * True if the candidate window should be rendered vertical, false to make it horizontal. */ vertical?: boolean; /** * Optional. - * The number of candidates to display per page. + * The number of candidates to display per page. */ pageSize?: number; /** * Optional. - * True to display the auxiliary text, false to hide it. + * True to display the auxiliary text, false to hide it. */ auxiliaryTextVisible?: boolean; /** * Optional. - * Text that is shown at the bottom of the candidate window. + * Text that is shown at the bottom of the candidate window. */ auxiliaryText?: string; /** * Optional. - * True to show the Candidate window, false to hide it. + * True to show the Candidate window, false to hide it. */ visible?: boolean; - /** + /** * Optional. - * Where to display the candidate window. + * Where to display the candidate window. * @since Chrome 28. */ windowPosition?: string; @@ -3764,83 +3764,83 @@ declare module chrome.input.ime { interface InputResetEvent extends chrome.events.Event<(engineID: string) => void> {} /** - * Adds the provided menu items to the language menu when this IME is active. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Adds the provided menu items to the language menu when this IME is active. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function setMenuItems(parameters: ImeParameters, callback?: () => void): void; /** - * Commits the provided text to the current input. - * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set. + * Commits the provided text to the current input. + * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set. * If you specify the callback parameter, it should be a function that looks like this: - * function(boolean success) {...}; + * function(boolean success) {...}; */ export function commitText(parameters: CommitTextParameters, callback?: (success: boolean) => void): void; /** - * Sets the current candidate list. This fails if this extension doesn't own the active IME - * @param callback Called when the operation completes. + * Sets the current candidate list. This fails if this extension doesn't own the active IME + * @param callback Called when the operation completes. * If you specify the callback parameter, it should be a function that looks like this: - * function(boolean success) {...}; + * function(boolean success) {...}; */ export function setCandidates(parameters: CandidatesParameters, callback?: (success: boolean) => void): void; - /** - * Set the current composition. If this extension does not own the active IME, this fails. - * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set. + /** + * Set the current composition. If this extension does not own the active IME, this fails. + * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set. * If you specify the callback parameter, it should be a function that looks like this: - * function(boolean success) {...}; + * function(boolean success) {...}; */ export function setComposition(parameters: CompositionParameters, callback?: (success: boolean) => void): void; /** - * Updates the state of the MenuItems specified - * @param callback Called when the operation completes + * Updates the state of the MenuItems specified + * @param callback Called when the operation completes * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * function() {...}; */ export function updateMenuItems(parameters: MenuItemParameters, callback?: () => void): void; /** - * Sets the properties of the candidate window. This fails if the extension doesn't own the active IME - * @param callback Called when the operation completes. + * Sets the properties of the candidate window. This fails if the extension doesn't own the active IME + * @param callback Called when the operation completes. * If you specify the callback parameter, it should be a function that looks like this: - * function(boolean success) {...}; + * function(boolean success) {...}; */ export function setCandidateWindowProperties(parameters: CandidateWindowParameter, callback?: (success: boolean) => void): void; /** - * Clear the current composition. If this extension does not own the active IME, this fails. - * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set. + * Clear the current composition. If this extension does not own the active IME, this fails. + * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set. * If you specify the callback parameter, it should be a function that looks like this: - * function(boolean success) {...}; + * function(boolean success) {...}; */ export function clearComposition(parameters: ClearCompositionParameters, callback?: (success: boolean) => void): void; /** - * Set the position of the cursor in the candidate window. This is a no-op if this extension does not own the active IME. - * @param callback Called when the operation completes + * Set the position of the cursor in the candidate window. This is a no-op if this extension does not own the active IME. + * @param callback Called when the operation completes * If you specify the callback parameter, it should be a function that looks like this: - * function(boolean success) {...}; + * function(boolean success) {...}; */ export function setCursorPosition(parameters: CursorPositionParameters, callback?: (success: boolean) => void): void; /** - * Sends the key events. This function is expected to be used by virtual keyboards. When key(s) on a virtual keyboard is pressed by a user, this function is used to propagate that event to the system. + * Sends the key events. This function is expected to be used by virtual keyboards. When key(s) on a virtual keyboard is pressed by a user, this function is used to propagate that event to the system. * @since Chrome 33. - * @param callback Called when the operation completes. + * @param callback Called when the operation completes. * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * function() {...}; */ export function sendKeyEvents(parameters: SendKeyEventParameters, callback?: () => void): void; /** - * Hides the input view window, which is popped up automatically by system. If the input view window is already hidden, this function will do nothing. + * Hides the input view window, which is popped up automatically by system. If the input view window is already hidden, this function will do nothing. * @since Chrome 34. */ export function hideInputView(): void; /** - * Deletes the text around the caret. + * Deletes the text around the caret. * @since Chrome 27. */ export function deleteSurroundingText(parameters: DeleteSurroundingTextParameters, callback?: () => void): void; /** - * Indicates that the key event received by onKeyEvent is handled. This should only be called if the onKeyEvent listener is asynchronous. + * Indicates that the key event received by onKeyEvent is handled. This should only be called if the onKeyEvent listener is asynchronous. * @since Chrome 25. - * @param requestId Request id of the event that was handled. This should come from keyEvent.requestId - * @param response True if the keystroke was handled, false if not + * @param requestId Request id of the event that was handled. This should come from keyEvent.requestId + * @param response True if the keystroke was handled, false if not */ export function keyEventHandled(requestId: string, response: boolean): void; @@ -3861,12 +3861,12 @@ declare module chrome.input.ime { /** Called when the user selects a menu item */ var onMenuItemActivated: MenuItemActivatedEvent; /** - * Called when the editable string around caret is changed or when the caret position is moved. The text length is limited to 100 characters for each back and forth direction. + * Called when the editable string around caret is changed or when the caret position is moved. The text length is limited to 100 characters for each back and forth direction. * @since Chrome 27. */ var onSurroundingTextChanged: SurroundingTextChangedEvent; /** - * This event is sent when chrome terminates ongoing text input session. + * This event is sent when chrome terminates ongoing text input session. * @since Chrome 29. */ var onReset: InputResetEvent; @@ -3876,8 +3876,8 @@ declare module chrome.input.ime { // Management //////////////////// /** - * The chrome.management API provides ways to manage the list of extensions/apps that are installed and running. It is particularly useful for extensions that override the built-in New Tab page. - * Permissions: "management" + * The chrome.management API provides ways to manage the list of extensions/apps that are installed and running. It is particularly useful for extensions that override the built-in New Tab page. + * Permissions: "management" * @since Chrome 8. */ declare module chrome.management { @@ -3885,29 +3885,29 @@ declare module chrome.management { interface ExtensionInfo { /** * Optional. - * A reason the item is disabled. + * A reason the item is disabled. * @since Chrome 17. */ disabledReason?: string; /** Optional. The launch url (only present for apps). */ appLaunchUrl?: string; /** - * The description of this extension, app, or theme. + * The description of this extension, app, or theme. * @since Chrome 9. */ description: string; /** - * Returns a list of API based permissions. + * Returns a list of API based permissions. * @since Chrome 9. */ permissions: string[]; /** * Optional. - * A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the manifest documentation on icons for more details. + * A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the manifest documentation on icons for more details. */ icons?: IconInfo[]; /** - * Returns a list of host based permissions. + * Returns a list of host based permissions. * @since Chrome 9. */ hostPermissions: string[]; @@ -3915,17 +3915,17 @@ declare module chrome.management { enabled: boolean; /** * Optional. - * The URL of the homepage of this extension, app, or theme. + * The URL of the homepage of this extension, app, or theme. * @since Chrome 11. */ homepageUrl?: string; /** - * Whether this extension can be disabled or uninstalled by the user. + * Whether this extension can be disabled or uninstalled by the user. * @since Chrome 12. */ mayDisable: boolean; /** - * How the extension was installed. + * How the extension was installed. * @since Chrome 22. */ installType: string; @@ -3934,18 +3934,18 @@ declare module chrome.management { /** The extension's unique identifier. */ id: string; /** - * Whether the extension, app, or theme declares that it supports offline. + * Whether the extension, app, or theme declares that it supports offline. * @since Chrome 15. */ offlineEnabled: boolean; /** * Optional. - * The update URL of this extension, app, or theme. + * The update URL of this extension, app, or theme. * @since Chrome 16. */ updateUrl?: string; /** - * The type of this extension, app, or theme. + * The type of this extension, app, or theme. * @since Chrome 23. */ type: string; @@ -3954,24 +3954,24 @@ declare module chrome.management { /** The name of this extension, app, or theme. */ name: string; /** - * A short version of the name of this extension, app, or theme. + * A short version of the name of this extension, app, or theme. * @since Chrome 31. */ shortName: string; /** * True if this is an app. - * @deprecated since Chrome 33. Please use management.ExtensionInfo.type. + * @deprecated since Chrome 33. Please use management.ExtensionInfo.type. */ isApp: boolean; /** * Optional. - * The app launch type (only present for apps). + * The app launch type (only present for apps). * @since Chrome 37. */ launchType?: string; /** * Optional. - * The currently available launch types (only present for apps). + * The currently available launch types (only present for apps). * @since Chrome 37. */ availableLaunchTypes?: string[]; @@ -3988,7 +3988,7 @@ declare module chrome.management { interface UninstallOptions { /** * Optional. - * Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false for self uninstalls. If an extension uninstalls another extension, this parameter is ignored and the dialog is always shown. + * Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false for self uninstalls. If an extension uninstalls another extension, this parameter is ignored and the dialog is always shown. */ showConfirmDialog?: boolean; } @@ -4002,112 +4002,112 @@ declare module chrome.management { interface ManagementEnabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {} /** - * Enables or disables an app or extension. - * @param id This should be the id from an item of management.ExtensionInfo. - * @param enabled Whether this item should be enabled or disabled. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Enables or disables an app or extension. + * @param id This should be the id from an item of management.ExtensionInfo. + * @param enabled Whether this item should be enabled or disabled. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function setEnabled(id: string, enabled: boolean, callback?: () => void): void; /** - * Returns a list of permission warnings for the given extension id. + * Returns a list of permission warnings for the given extension id. * @since Chrome 15. - * @param id The ID of an already installed extension. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function(array of string permissionWarnings) {...}; + * @param id The ID of an already installed extension. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(array of string permissionWarnings) {...}; */ export function getPermissionWarningsById(id: string, callback?: (permissionWarnings: string[]) => void): void; /** - * Returns information about the installed extension, app, or theme that has the given ID. + * Returns information about the installed extension, app, or theme that has the given ID. * @since Chrome 9. - * @param id The ID from an item of management.ExtensionInfo. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function( ExtensionInfo result) {...}; + * @param id The ID from an item of management.ExtensionInfo. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionInfo result) {...}; */ export function get(id: string, callback?: (result: ExtensionInfo) => void): void; /** - * Returns a list of information about installed extensions and apps. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function(array of ExtensionInfo result) {...}; + * Returns a list of information about installed extensions and apps. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(array of ExtensionInfo result) {...}; */ export function getAll(callback?: (result: ExtensionInfo[]) => void): void; /** - * Returns a list of permission warnings for the given extension manifest string. Note: This function can be used without requesting the 'management' permission in the manifest. + * Returns a list of permission warnings for the given extension manifest string. Note: This function can be used without requesting the 'management' permission in the manifest. * @since Chrome 15. - * @param manifestStr Extension manifest JSON string. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function(array of string permissionWarnings) {...}; + * @param manifestStr Extension manifest JSON string. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(array of string permissionWarnings) {...}; */ export function getPermissionWarningsByManifest(manifestStr: string, callback?: (permissionwarnings: string[]) => void): void; /** - * Launches an application. - * @param id The extension id of the application. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * Launches an application. + * @param id The extension id of the application. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function launchApp(id: string, callback?: () => void): void; /** * Uninstalls a currently installed app or extension. - * @since Chrome 21. + * @since Chrome 21. * @param id This should be the id from an item of management.ExtensionInfo. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function uninstall(id: string, options?: UninstallOptions, callback?: () => void): void; /** * Uninstalls a currently installed app or extension. - * @deprecated since Chrome 21. The options parameter was added to this function. + * @deprecated since Chrome 21. The options parameter was added to this function. * @param id This should be the id from an item of management.ExtensionInfo. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function uninstall(id: string, callback?: () => void): void; /** - * Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest. + * Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest. * @since Chrome 39. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function( ExtensionInfo result) {...}; + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionInfo result) {...}; */ export function getSelf(callback?: (result: ExtensionInfo) => void): void; /** - * Uninstalls the calling extension. + * Uninstalls the calling extension. * Note: This function can be used without requesting the 'management' permission in the manifest. - * @since Chrome 26. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * @since Chrome 26. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function uninstallSelf(options?: UninstallOptions, callback?: () => void): void; /** - * Uninstalls the calling extension. + * Uninstalls the calling extension. * Note: This function can be used without requesting the 'management' permission in the manifest. - * @since Chrome 26. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * @since Chrome 26. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function uninstallSelf(callback?: () => void): void; /** - * Display options to create shortcuts for an app. On Mac, only packaged app shortcuts can be created. + * Display options to create shortcuts for an app. On Mac, only packaged app shortcuts can be created. * @since Chrome 37. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function createAppShortcut(id: string, callback?: () => void): void; /** - * Set the launch type of an app. + * Set the launch type of an app. * @since Chrome 37. - * @param id This should be the id from an app item of management.ExtensionInfo. - * @param launchType The target launch type. Always check and make sure this launch type is in ExtensionInfo.availableLaunchTypes, because the available launch types vary on different platforms and configurations. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * @param id This should be the id from an app item of management.ExtensionInfo. + * @param launchType The target launch type. Always check and make sure this launch type is in ExtensionInfo.availableLaunchTypes, because the available launch types vary on different platforms and configurations. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function setLaunchType(id: string, launchType: string, callback?: () => void): void; /** - * Generate an app for a URL. Returns the generated bookmark app. + * Generate an app for a URL. Returns the generated bookmark app. * @since Chrome 37. - * @param url The URL of a web page. The scheme of the URL can only be "http" or "https". - * @param title The title of the generated app. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function( ExtensionInfo result) {...}; + * @param url The URL of a web page. The scheme of the URL can only be "http" or "https". + * @param title The title of the generated app. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionInfo result) {...}; */ export function generateAppForLink(url: string, title: string, callback?: (result: ExtensionInfo) => void): void; @@ -4125,9 +4125,9 @@ declare module chrome.management { // Notifications //////////////////// /** - * Use the networking.config API to authenticate to captive portals. - * Permissions: "networking.config" - * Important: This API works only on Chrome OS. + * Use the networking.config API to authenticate to captive portals. + * Permissions: "networking.config" + * Important: This API works only on Chrome OS. * @since Chrome 43. */ declare module chrome.networking.config { @@ -4147,29 +4147,29 @@ declare module chrome.networking.config { } interface CaptivePorttalDetectedEvent extends chrome.events.Event<(networkInfo: NetworkInfo) => void> {} - + /** - * Allows an extension to define network filters for the networks it can handle. A call to this function will remove all filters previously installed by the extension before setting the new list. - * @param networks Network filters to set. Every NetworkInfo must either have the SSID or HexSSID set. Other fields will be ignored. - * @param callback Called back when this operation is finished. + * Allows an extension to define network filters for the networks it can handle. A call to this function will remove all filters previously installed by the extension before setting the new list. + * @param networks Network filters to set. Every NetworkInfo must either have the SSID or HexSSID set. Other fields will be ignored. + * @param callback Called back when this operation is finished. * The callback parameter should be a function that looks like this: - * function() {...}; + * function() {...}; */ export function setNetworkFilter(networks: NetworkInfo[], callback: () => void): void; /** - * Called by the extension to notify the network config API that it finished a captive portal authentication attempt and hand over the result of the attempt. This function must only be called with the GUID of the latest onCaptivePortalDetected event. - * @param GUID Unique network identifier obtained from onCaptivePortalDetected. - * @param result The result of the authentication attempt. + * Called by the extension to notify the network config API that it finished a captive portal authentication attempt and hand over the result of the attempt. This function must only be called with the GUID of the latest onCaptivePortalDetected event. + * @param GUID Unique network identifier obtained from onCaptivePortalDetected. + * @param result The result of the authentication attempt. * unhandled: The extension does not handle this network or captive portal (e.g. server end-point not found or not compatible). * succeeded: The extension handled this network and authenticated successfully. * rejected: The extension handled this network, tried to authenticate, however was rejected by the server. - * failed: The extension handled this network, tried to authenticate, however failed due to an unspecified error. - * @param callback Called back when this operation is finished. + * failed: The extension handled this network, tried to authenticate, however failed due to an unspecified error. + * @param callback Called back when this operation is finished. * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * function() {...}; */ export function finishAuthentication(GUID: string, result: string, callback?: () => void): void; - + /** This event fires everytime a captive portal is detected on a network matching any of the currently registered network filters and the user consents to use the extension for authentication. Network filters may be set using the setNetworkFilter. Upon receiving this event the extension should start its authentication attempt with the captive portal. When the extension finishes its attempt, it must call finishAuthentication with the GUID received with this event and the appropriate authentication result. */ var onCaptivePortalDetected: CaptivePorttalDetectedEvent; } @@ -4179,8 +4179,8 @@ declare module chrome.networking.config { // https://developer.chrome.com/extensions/notifications //////////////////// /** - * Use the chrome.notifications API to create rich notifications using templates and show these notifications to users in the system tray. - * Permissions: "notifications" + * Use the chrome.notifications API to create rich notifications using templates and show these notifications to users in the system tray. + * Permissions: "notifications" * @since Chrome 28. */ declare module chrome.notifications { @@ -4199,7 +4199,7 @@ declare module chrome.notifications { interface NotificationOptions { /** Optional. Which type of notification to display. Required for notifications.create method. */ type?: string; - /** + /** * Optional. * A URL to the sender's avatar, app icon, or a thumbnail for image notifications. * URLs can be a data URL, a blob URL, or a URL relative to a resource within this extension's .crx file Required for notifications.create method. @@ -4211,7 +4211,7 @@ declare module chrome.notifications { message?: string; /** * Optional. - * Alternate notification content with a lower-weight font. + * Alternate notification content with a lower-weight font. * @since Chrome 31. */ contextMessage?: string; @@ -4225,19 +4225,19 @@ declare module chrome.notifications { items?: ItemOptions[]; /** * Optional. - * Current progress ranges from 0 to 100. + * Current progress ranges from 0 to 100. * @since Chrome 30. */ progress?: number; /** * Optional. - * Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification. + * Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification. * @since Chrome 32. */ isClickable?: boolean; /** * Optional. - * A URL to the app icon mask. URLs have the same restrictions as iconUrl. The app icon mask should be in alpha channel, as only the alpha channel of the image will be considered. + * A URL to the app icon mask. URLs have the same restrictions as iconUrl. The app icon mask should be in alpha channel, as only the alpha channel of the image will be considered. * @since Chrome 38. */ appIconMaskUrl?: string; @@ -4262,71 +4262,71 @@ declare module chrome.notifications { /** The user pressed a button in the notification. */ export var onButtonClicked: NotificationButtonClickedEvent; /** - * The user changes the permission level. + * The user changes the permission level. * @since Chrome 32. */ export var onPermissionLevelChanged: NotificationPermissionLevelChangedEvent; /** - * The user clicked on a link for the app's notification settings. + * The user clicked on a link for the app's notification settings. * @since Chrome 32. */ export var onShowSettings: NotificationShowSettingsEvent; /** - * Creates and displays a notification. + * Creates and displays a notification. * @param notificationId Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation. * The notificationId parameter is required before Chrome 42. - * @param options Contents of the notification. + * @param options Contents of the notification. * @param callback Returns the notification id (either supplied or generated) that represents the created notification. * The callback is required before Chrome 42. * If you specify the callback parameter, it should be a function that looks like this: - * function(string notificationId) {...}; + * function(string notificationId) {...}; */ export function create(notificationId: string, options: NotificationOptions, callback?: (notificationId: string) => void): void; /** - * Creates and displays a notification. + * Creates and displays a notification. * @param notificationId Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation. * The notificationId parameter is required before Chrome 42. - * @param options Contents of the notification. + * @param options Contents of the notification. * @param callback Returns the notification id (either supplied or generated) that represents the created notification. * The callback is required before Chrome 42. * If you specify the callback parameter, it should be a function that looks like this: - * function(string notificationId) {...}; + * function(string notificationId) {...}; */ export function create(options: NotificationOptions, callback?: (notificationId: string) => void): void; /** - * Updates an existing notification. - * @param notificationId The id of the notification to be updated. This is returned by notifications.create method. - * @param options Contents of the notification to update to. + * Updates an existing notification. + * @param notificationId The id of the notification to be updated. This is returned by notifications.create method. + * @param options Contents of the notification to update to. * @param callback Called to indicate whether a matching notification existed. * The callback is required before Chrome 42. * If you specify the callback parameter, it should be a function that looks like this: - * function(boolean wasUpdated) {...}; + * function(boolean wasUpdated) {...}; */ export function update(notificationId: string, options: NotificationOptions, callback?: (wasUpdated: boolean) => void): void; /** - * Clears the specified notification. - * @param notificationId The id of the notification to be cleared. This is returned by notifications.create method. + * Clears the specified notification. + * @param notificationId The id of the notification to be cleared. This is returned by notifications.create method. * @param callback Called to indicate whether a matching notification existed. * The callback is required before Chrome 42. * If you specify the callback parameter, it should be a function that looks like this: - * function(boolean wasCleared) {...}; + * function(boolean wasCleared) {...}; */ export function clear(notificationId: string, callback?: (wasCleared: boolean) => void): void; /** - * Retrieves all the notifications. + * Retrieves all the notifications. * @since Chrome 29. - * @param callback Returns the set of notification_ids currently in the system. + * @param callback Returns the set of notification_ids currently in the system. * The callback parameter should be a function that looks like this: - * function(object notifications) {...}; + * function(object notifications) {...}; */ export function getAll(callback: (notifications: Object) => void): void; /** - * Retrieves whether the user has enabled notifications from this app or extension. + * Retrieves whether the user has enabled notifications from this app or extension. * @since Chrome 32. - * @param callback Returns the current permission level. + * @param callback Returns the current permission level. * The callback parameter should be a function that looks like this: - * function( PermissionLevel level) {...}; + * function( PermissionLevel level) {...}; */ export function getPermissionLevel(callback: (level: string) => void): void; } @@ -4335,9 +4335,9 @@ declare module chrome.notifications { // Omnibox //////////////////// /** - * The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox. + * The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox. * Manifest: "omnibox": {...} - * @since Chrome 9. + * @since Chrome 9. */ declare module chrome.omnibox { /** A suggest result. */ @@ -4362,8 +4362,8 @@ declare module chrome.omnibox { interface OmniboxInputCancelledEvent extends chrome.events.Event<() => void> {} /** - * Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar. - * @param suggestion A partial SuggestResult object, without the 'content' parameter. + * Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar. + * @param suggestion A partial SuggestResult object, without the 'content' parameter. */ export function setDefaultSuggestion(suggestion: Suggestion): void; @@ -4381,8 +4381,8 @@ declare module chrome.omnibox { // Page Action //////////////////// /** - * Use the chrome.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. - * Manifest: "page_action": {...} + * Use the chrome.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. + * Manifest: "page_action": {...} * @since Chrome 5. */ declare module chrome.pageAction { @@ -4412,29 +4412,29 @@ declare module chrome.pageAction { tabId: number; /** * Optional. - * @deprecated This argument is ignored. + * @deprecated This argument is ignored. */ iconIndex?: number; /** * Optional. - * 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}' + * 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}' */ imageData?: ImageData; /** * Optional. - * 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}' + * 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}' */ path?: any; } /** - * Shows the page action. The page action is shown whenever the tab is selected. - * @param tabId The id of the tab for which you want to modify the page action. + * Shows the page action. The page action is shown whenever the tab is selected. + * @param tabId The id of the tab for which you want to modify the page action. */ export function hide(tabId: number): void; /** - * Shows the page action. The page action is shown whenever the tab is selected. - * @param tabId The id of the tab for which you want to modify the page action. + * Shows the page action. The page action is shown whenever the tab is selected. + * @param tabId The id of the tab for which you want to modify the page action. */ export function show(tabId: number): void; /** Sets the title of the page action. This is displayed in a tooltip over the page action. */ @@ -4442,23 +4442,23 @@ declare module chrome.pageAction { /** Sets the html document to be opened as a popup when the user clicks on the page action's icon. */ export function setPopup(details: PopupDetails): void; /** - * Gets the title of the page action. + * Gets the title of the page action. * @since Chrome 19. - * @param callback The callback parameter should be a function that looks like this: + * @param callback The callback parameter should be a function that looks like this: * function(string result) {...}; */ export function getTitle(details: GetDetails, callback: (result: string) => void): void; /** - * Gets the html document set as the popup for this page action. + * Gets the html document set as the popup for this page action. * @since Chrome 19. - * @param callback The callback parameter should be a function that looks like this: - * function(string result) {...}; + * @param callback The callback parameter should be a function that looks like this: + * function(string result) {...}; */ export function getPopup(details: GetDetails, callback: (result: string) => void): void; /** - * 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. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * 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. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; */ export function setIcon(details: IconDetails, callback?: () => void): void; @@ -4470,8 +4470,8 @@ declare module chrome.pageAction { // Page Capture //////////////////// /** - * Use the chrome.pageCapture API to save a tab as MHTML. - * Permissions: "pageCapture" + * Use the chrome.pageCapture API to save a tab as MHTML. + * Permissions: "pageCapture" * @since Chrome 18. */ declare module chrome.pageCapture { @@ -4481,11 +4481,11 @@ declare module chrome.pageCapture { } /** - * Saves the content of the tab with given id as MHTML. - * @param callback Called when the MHTML has been generated. + * Saves the content of the tab with given id as MHTML. + * @param callback Called when the MHTML has been generated. * The callback parameter should be a function that looks like this: * function(binary mhtmlData) {...}; - * Parameter mhtmlData: The MHTML data as a Blob. + * Parameter mhtmlData: The MHTML data as a Blob. */ export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData: any) => void): void; } @@ -4494,67 +4494,67 @@ declare module chrome.pageCapture { // Permissions //////////////////// /** - * Use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary. + * Use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary. * @since Chrome 16. */ declare module chrome.permissions { interface Permissions { /** * Optional. - * List of named permissions (does not include hosts or origins). Anything listed here must appear in the optional_permissions list in the manifest. + * List of named permissions (does not include hosts or origins). Anything listed here must appear in the optional_permissions list in the manifest. */ origins?: string[]; /** * Optional. - * List of origin permissions. Anything listed here must be a subset of a host that appears in the optional_permissions list in the manifest. For example, if http://*.example.com/ or http://* appears in optional_permissions, you can request an origin of http://help.example.com/. Any path is ignored. + * List of origin permissions. Anything listed here must be a subset of a host that appears in the optional_permissions list in the manifest. For example, if http://*.example.com/ or http://* appears in optional_permissions, you can request an origin of http://help.example.com/. Any path is ignored. */ permissions?: string[]; } interface PermissionsRemovedEvent { /** - * @param callback The callback parameter should be a function that looks like this: + * @param callback The callback parameter should be a function that looks like this: * function( Permissions permissions) {...}; - * Parameter permissions: The permissions that have been removed. + * Parameter permissions: The permissions that have been removed. */ addListener(callback: (permissions: Permissions) => void): void; } interface PermissionsAddedEvent { /** - * @param callback The callback parameter should be a function that looks like this: + * @param callback The callback parameter should be a function that looks like this: * function( Permissions permissions) {...}; - * Parameter permissions: The newly acquired permissions. + * Parameter permissions: The newly acquired permissions. */ addListener(callback: (permissions: Permissions) => void): void; } /** - * Checks if the extension has the specified permissions. - * @param callback The callback parameter should be a function that looks like this: + * Checks if the extension has the specified permissions. + * @param callback The callback parameter should be a function that looks like this: * function(boolean result) {...}; - * Parameter result: True if the extension has the specified permissions. + * Parameter result: True if the extension has the specified permissions. */ export function contains(permissions: Permissions, callback: (result: boolean) => void): void; /** - * Gets the extension's current set of permissions. - * @param callback The callback parameter should be a function that looks like this: + * Gets the extension's current set of permissions. + * @param callback The callback parameter should be a function that looks like this: * function( Permissions permissions) {...}; - * Parameter permissions: The extension's active permissions. + * Parameter permissions: The extension's active permissions. */ export function getAll(callback: (permissions: Permissions) => void): void; /** - * Requests access to the specified permissions. These permissions must be defined in the optional_permissions field of the manifest. If there are any problems requesting the permissions, runtime.lastError will be set. - * @param callback If you specify the callback parameter, it should be a function that looks like this: + * Requests access to the specified permissions. These permissions must be defined in the optional_permissions field of the manifest. If there are any problems requesting the permissions, runtime.lastError will be set. + * @param callback If you specify the callback parameter, it should be a function that looks like this: * function(boolean granted) {...}; - * Parameter granted: True if the user granted the specified permissions. + * Parameter granted: True if the user granted the specified permissions. */ export function request(permissions: Permissions, callback?: (granted: boolean) => void): void; /** - * Removes access to the specified permissions. If there are any problems removing the permissions, runtime.lastError will be set. - * @param callback If you specify the callback parameter, it should be a function that looks like this: + * Removes access to the specified permissions. If there are any problems removing the permissions, runtime.lastError will be set. + * @param callback If you specify the callback parameter, it should be a function that looks like this: * function(boolean removed) {...}; - * Parameter removed: True if the permissions were removed. + * Parameter removed: True if the permissions were removed. */ export function remove(permissions: Permissions, callback?: (removed: boolean) => void): void; @@ -4568,9 +4568,9 @@ declare module chrome.permissions { // Platform Keys //////////////////// /** - * Use the chrome.platformKeys API to access client certificates managed by the platform. If the user or policy grants the permission, an extension can use such a certficate in its custom authentication protocol. E.g. this allows usage of platform managed certificates in third party VPNs (see chrome.vpnProvider). - * Permissions: "platformKeys" - * Important: This API works only on Chrome OS. + * Use the chrome.platformKeys API to access client certificates managed by the platform. If the user or policy grants the permission, an extension can use such a certficate in its custom authentication protocol. E.g. this allows usage of platform managed certificates in third party VPNs (see chrome.vpnProvider). + * Permissions: "platformKeys" + * Important: This API works only on Chrome OS. * @since Chrome 45. */ declare module chrome.platformKeys { @@ -4593,7 +4593,7 @@ declare module chrome.platformKeys { request: ClientCertificateSelectRequestDetails; /** * Optional. - * If given, the selectClientCertificates operates on this list. Otherwise, obtains the list of all certificates from the platform's certificate stores that are available to this extensions. Entries that the extension doesn't have permission for or which doesn't match the request, are removed. + * If given, the selectClientCertificates operates on this list. Otherwise, obtains the list of all certificates from the platform's certificate stores that are available to this extensions. Entries that the extension doesn't have permission for or which doesn't match the request, are removed. */ clientCerts?: ArrayBuffer[]; /** If true, the filtered list is presented to the user to manually select a certificate and thereby granting the extension access to the certificate(s) and key(s). Only the selected certificate(s) will be returned. If is false, the list is reduced to all certificates that the extension has been granted access to (automatically or manually). */ @@ -4616,30 +4616,30 @@ declare module chrome.platformKeys { */ debug_errors: string[]; } - + /** - * This function filters from a list of client certificates the ones that are known to the platform, match request and for which the extension has permission to access the certificate and its private key. If interactive is true, the user is presented a dialog where he can select from matching certificates and grant the extension access to the certificate. The selected/filtered client certificates will be passed to callback. - * @param callback The callback parameter should be a function that looks like this: + * This function filters from a list of client certificates the ones that are known to the platform, match request and for which the extension has permission to access the certificate and its private key. If interactive is true, the user is presented a dialog where he can select from matching certificates and grant the extension access to the certificate. The selected/filtered client certificates will be passed to callback. + * @param callback The callback parameter should be a function that looks like this: * function(array of Match matches) {...}; - * Parameter matches: The list of certificates that match the request, that the extension has permission for and, if interactive is true, that were selected by the user. + * Parameter matches: The list of certificates that match the request, that the extension has permission for and, if interactive is true, that were selected by the user. */ export function selectClientCertificates(details: ClientCertificateSelectDetails, callback: (matches: Match[]) => void): void; /** - * Passes the key pair of certificate for usage with platformKeys.subtleCrypto to callback. - * @param certificate The certificate of a Match returned by selectClientCertificates. - * @param parameters Determines signature/hash algorithm parameters additionally to the parameters fixed by the key itself. The same parameters are accepted as by WebCrypto's importKey function, e.g. RsaHashedImportParams for a RSASSA-PKCS1-v1_5 key. For RSASSA-PKCS1-v1_5 keys, additionally the parameters { 'hash': { 'name': 'none' } } are supported. The sign function will then apply PKCS#1 v1.5 padding and but not hash the given data. - * @param callback The public and private CryptoKey of a certificate which can only be used with platformKeys.subtleCrypto. + * Passes the key pair of certificate for usage with platformKeys.subtleCrypto to callback. + * @param certificate The certificate of a Match returned by selectClientCertificates. + * @param parameters Determines signature/hash algorithm parameters additionally to the parameters fixed by the key itself. The same parameters are accepted as by WebCrypto's importKey function, e.g. RsaHashedImportParams for a RSASSA-PKCS1-v1_5 key. For RSASSA-PKCS1-v1_5 keys, additionally the parameters { 'hash': { 'name': 'none' } } are supported. The sign function will then apply PKCS#1 v1.5 padding and but not hash the given data. + * @param callback The public and private CryptoKey of a certificate which can only be used with platformKeys.subtleCrypto. * The callback parameter should be a function that looks like this: * function(object publicKey, object privateKey) {...}; - * Optional parameter privateKey: Might be null if this extension does not have access to it. + * Optional parameter privateKey: Might be null if this extension does not have access to it. */ export function getKeyPair(certificate: ArrayBuffer, parameters: Object, callback: (publicKey: CryptoKey, privateKey?: CryptoKey) => void): void; /** An implementation of WebCrypto's SubtleCrypto that allows crypto operations on keys of client certificates that are available to this extension. */ export function subtleCrypto(): SubtleCrypto; /** - * Checks whether details.serverCertificateChain can be trusted for details.hostname according to the trust settings of the platform. Note: The actual behavior of the trust verification is not fully specified and might change in the future. The API implementation verifies certificate expiration, validates the certification path and checks trust by a known CA. The implementation is supposed to respect the EKU serverAuth and to support subject alternative names. - * @param callback The callback parameter should be a function that looks like this: - * function(object result) {...}; + * Checks whether details.serverCertificateChain can be trusted for details.hostname according to the trust settings of the platform. Note: The actual behavior of the trust verification is not fully specified and might change in the future. The API implementation verifies certificate expiration, validates the certification path and checks trust by a known CA. The implementation is supposed to respect the EKU serverAuth and to support subject alternative names. + * @param callback The callback parameter should be a function that looks like this: + * function(object result) {...}; */ export function verifyTLSServerCertificate(details: ServerCertificateVerificationDetails, callback: (result: ServerCertificateVerificationResult) => void): void; } @@ -4648,8 +4648,8 @@ declare module chrome.platformKeys { // Power //////////////////// /** - * Use the chrome.power API to override the system's power management features. - * Permissions: "power" + * Use the chrome.power API to override the system's power management features. + * Permissions: "power" * @since Chrome 27. */ declare module chrome.power { @@ -4663,8 +4663,8 @@ declare module chrome.power { // Printer Provider //////////////////// /** - * The chrome.printerProvider API exposes events used by print manager to query printers controlled by extensions, to query their capabilities and to submit print jobs to these printers. - * Permissions: "printerProvider" + * The chrome.printerProvider API exposes events used by print manager to query printers controlled by extensions, to query their capabilities and to submit print jobs to these printers. + * Permissions: "printerProvider" * @since Chrome 44. */ declare module chrome.printerProvider { @@ -4702,11 +4702,11 @@ declare module chrome.printerProvider { interface CapabilityRequestedEvent extends chrome.events.Event<(printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void> {} interface PrintRequestedEvent extends chrome.events.Event<(printJob: PrintJob, resultCallback: (result: string) => void) => void> {} - + /** Event fired when print manager requests printers provided by extensions. */ export var onGetPrintersRequested: PrinterRequestedEvent; /** - * Event fired when print manager requests information about a USB device that may be a printer. + * Event fired when print manager requests information about a USB device that may be a printer. * Note: An application should not rely on this event being fired more than once per device. If a connected device is supported it should be returned in the onGetPrintersRequested event. * @since Chrome 45. */ @@ -4721,9 +4721,9 @@ declare module chrome.printerProvider { // Privacy //////////////////// /** - * Use the chrome.privacy API to control usage of the features in Chrome that can affect a user's privacy. This API relies on the ChromeSetting prototype of the type API for getting and setting Chrome's configuration. - * Permissions: "privacy" - * The Chrome Privacy Whitepaper gives background detail regarding the features which this API can control. + * Use the chrome.privacy API to control usage of the features in Chrome that can affect a user's privacy. This API relies on the ChromeSetting prototype of the type API for getting and setting Chrome's configuration. + * Permissions: "privacy" + * The Chrome Privacy Whitepaper gives background detail regarding the features which this API can control. * @since Chrome 18. */ declare module chrome.privacy { @@ -4773,7 +4773,7 @@ declare module chrome.privacy { //////////////////// /** * Use the chrome.proxy API to manage Chrome's proxy settings. This API relies on the ChromeSetting prototype of the type API for getting and setting the proxy configuration. - * Permissions: "proxy" + * Permissions: "proxy" * @since Chrome 13. */ declare module chrome.proxy { @@ -4793,12 +4793,12 @@ declare module chrome.proxy { rules?: ProxyRules; /** Optional. The proxy auto-config (PAC) script for this configuration. Use this for 'pac_script' mode. */ pacScript?: PacScript; - /** + /** * 'direct' = Never use a proxy * 'auto_detect' = Auto detect proxy settings * 'pac_script' = Use specified PAC script * 'fixed_servers' = Manually specify proxy servers - * 'system' = Use system proxy settings + * 'system' = Use system proxy settings */ mode: string; } @@ -4849,7 +4849,7 @@ declare module chrome.proxy { // Runtime //////////////////// /** - * Use the chrome.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. + * Use the chrome.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. * @since Chrome 22 */ declare module chrome.runtime { @@ -4869,18 +4869,18 @@ declare module chrome.runtime { interface InstalledDetails { /** - * The reason that this event is being dispatched. - * One of: "install", "update", "chrome_update", or "shared_module_update" + * The reason that this event is being dispatched. + * One of: "install", "update", "chrome_update", or "shared_module_update" */ reason: string; /** * Optional. - * Indicates the previous version of the extension, which has just been updated. This is present only if 'reason' is 'update'. + * Indicates the previous version of the extension, which has just been updated. This is present only if 'reason' is 'update'. */ previousVersion?: string; /** * Optional. - * Indicates the ID of the imported shared module extension which updated. This is present only if 'reason' is 'shared_module_update'. + * Indicates the ID of the imported shared module extension which updated. This is present only if 'reason' is 'shared_module_update'. * @since Chrome 29. */ id?: string; @@ -4901,17 +4901,17 @@ declare module chrome.runtime { /** The 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. */ tab?: chrome.tabs.Tab; /** - * The frame that opened the connection. 0 for top-level frames, positive for child frames. This will only be set when tab is set. + * The frame that opened the connection. 0 for top-level frames, positive for child frames. This will only be set when tab is set. * @since Chrome 41. */ frameId?: number; /** - * 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. + * 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. * @since Chrome 28. */ url?: string; /** - * The TLS channel ID of the page or frame that opened the connection, if requested by the extension or app, and if available. + * The TLS channel ID of the page or frame that opened the connection, if requested by the extension or app, and if available. * @since Chrome 32. */ tlsChannelId?: string; @@ -4922,19 +4922,19 @@ declare module chrome.runtime { * @since Chrome 36. */ interface PlatformInfo { - /** + /** * The operating system chrome is running on. - * One of: "mac", "win", "android", "cros", "linux", or "openbsd" + * One of: "mac", "win", "android", "cros", "linux", or "openbsd" */ os: string; /** - * The machine's processor architecture. - * One of: "arm", "x86-32", or "x86-64" + * The machine's processor architecture. + * One of: "arm", "x86-32", or "x86-64" */ arch: string; /** - * The native client architecture. This may be different from arch on some platforms. - * One of: "arm", "x86-32", or "x86-64" + * The native client architecture. This may be different from arch on some platforms. + * One of: "arm", "x86-32", or "x86-64" */ nacl_arch: string; } @@ -4948,7 +4948,7 @@ declare module chrome.runtime { disconnect: () => void; /** * Optional. - * This property will only be present on ports passed to onConnect/onConnectExternal listeners. + * This property will only be present on ports passed to onConnect/onConnectExternal listeners. */ sender?: MessageSender; /** An object which allows the addition and removal of listeners for a Chrome event. */ @@ -5190,109 +5190,109 @@ declare module chrome.runtime { } /** - * 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 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 tabs.connect. + * 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 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 tabs.connect. * @since Chrome 26. */ export function connect(connectInfo?: ConnectInfo): Port; /** - * 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 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 tabs.connect. + * 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 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 tabs.connect. * @since Chrome 26. * @param extensionId Optional. - * 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 web messaging. + * 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 web messaging. */ export function connect(extensionId: string, connectInfo?: ConnectInfo): Port; /** - * Connects to a native application in the host machine. + * Connects to a native application in the host machine. * @since Chrome 28. - * @param application The name of the registered application to connect to. + * @param application The name of the registered application to connect to. */ export function connectNative(application: string): Port; /** 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. */ export function getBackgroundPage(callback: (backgroundPage?: Window) => void): void; /** - * Returns details about the app or extension from the manifest. The object returned is a serialization of the full manifest file. + * Returns details about the app or extension from the manifest. The object returned is a serialization of the full manifest file. * @returns The manifest details. */ export function getManifest(): Manifest; /** - * Returns a DirectoryEntry for the package directory. + * Returns a DirectoryEntry for the package directory. * @since Chrome 29. */ export function getPackageDirectoryEntry(callback: (directoryEntry: DirectoryEntry) => void): void; /** - * Returns information about the current platform. + * Returns information about the current platform. * @since Chrome 29. - * @param callback Called with results + * @param callback Called with results */ export function getPlatformInfo(callback: (platformInfo: PlatformInfo) => void): void; /** - * Converts a relative path within an app/extension install directory to a fully-qualified URL. - * @param path A path to a resource within an app/extension expressed relative to its install directory. + * Converts a relative path within an app/extension install directory to a fully-qualified URL. + * @param path A path to a resource within an app/extension expressed relative to its install directory. */ export function getURL(path: string): string; /** - * Reloads the app or extension. + * Reloads the app or extension. * @since Chrome 25. */ export function reload(): void; /** - * Requests an update check for this app/extension. + * Requests an update check for this app/extension. * @since Chrome 25. * @param callback - * Parameter status: Result of the update check. One of: "throttled", "no_update", or "update_available" - * Optional parameter details: If an update is available, this contains more information about the available update. + * Parameter status: Result of the update check. One of: "throttled", "no_update", or "update_available" + * Optional parameter details: If an update is available, this contains more information about the available update. */ export function requestUpdateCheck(callback: (status: string, details?: UpdateCheckDetails) => void): void; /** - * Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's no-op. + * Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's no-op. * @since Chrome 32. */ export function restart(): void; /** - * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or 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 tabs.sendMessage. + * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or 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 tabs.sendMessage. * @since Chrome 26. * @param responseCallback Optional - * Parameter response: 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 runtime.lastError will be set to the error message. + * Parameter response: 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 runtime.lastError will be set to the error message. */ export function sendMessage(message: any, responseCallback?: (response: any) => void): void; /** - * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or 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 tabs.sendMessage. + * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or 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 tabs.sendMessage. * @since Chrome 32. * @param responseCallback Optional - * Parameter response: 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 runtime.lastError will be set to the error message. + * Parameter response: 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 runtime.lastError will be set to the error message. */ export function sendMessage(message: any, options: MessageOptions, responseCallback?: (response: any) => void): void; /** - * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or 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 tabs.sendMessage. + * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or 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 tabs.sendMessage. * @since Chrome 26. * @param 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 web messaging. * @param responseCallback Optional - * Parameter response: 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 runtime.lastError will be set to the error message. + * Parameter response: 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 runtime.lastError will be set to the error message. */ export function sendMessage(extensionId: string, message: any, responseCallback?: (response: any) => void): void; /** - * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or 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 tabs.sendMessage. + * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or 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 tabs.sendMessage. * @since Chrome 32. * @param 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 web messaging. * @param responseCallback Optional - * Parameter response: 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 runtime.lastError will be set to the error message. + * Parameter response: 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 runtime.lastError will be set to the error message. */ export function sendMessage(extensionId: string, message: any, options: MessageOptions, responseCallback?: (response: any) => void): void; /** - * Send a single message to a native application. + * Send a single message to a native application. * @since Chrome 28. * @param application The of the native messaging host. - * @param message The message that will be passed to the native messaging host. + * @param message The message that will be passed to the native messaging host. * @param responseCallback Optional. - * Parameter response: 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 runtime.lastError will be set to the error message. + * Parameter response: 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 runtime.lastError will be set to the error message. */ export function sendNativeMessage(application: string, message: Object, responseCallback?: (response: any) => void): void; /** - * 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. + * 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. * @since Chrome 41. * @param url Since Chrome 34. - * 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 callback Called when the uninstall URL is set. If the given URL is invalid, runtime.lastError will be set. + * 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 callback Called when the uninstall URL is set. If the given URL is invalid, runtime.lastError will be set. */ export function setUninstallURL(url: string, callback?: () => void): void; /** @@ -5304,19 +5304,19 @@ declare module chrome.runtime { export function openOptionsPage(callback?: () => void): void; /** - * Fired when a connection is made from either an extension process or a content script. + * Fired when a connection is made from either an extension process or a content script. * @since Chrome 26. */ var onConnect: ExtensionConnectEvent; /** - * Fired when a connection is made from another extension. + * Fired when a connection is made from another extension. * @since Chrome 26. */ var onConnectExternal: RuntimeEvent; /** 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. */ var onSuspend: RuntimeEvent; /** - * 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. + * 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. * @since Chrome 23. */ var onStartup: RuntimeEvent; @@ -5325,28 +5325,28 @@ declare module chrome.runtime { /** Sent after onSuspend to indicate that the app won't be unloaded after all. */ var onSuspendCanceled: RuntimeEvent; /** - * Fired when a message is sent from either an extension process or a content script. + * Fired when a message is sent from either an extension process or a content script. * @since Chrome 26. */ var onMessage: ExtensionMessageEvent; /** - * Fired when a message is sent from another extension/app. Cannot be used in a content script. + * Fired when a message is sent from another extension/app. Cannot be used in a content script. * @since Chrome 26. */ var onMessageExternal: ExtensionMessageEvent; /** - * 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. + * 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. * @since Chrome 29. */ var onRestartRequired: RuntimeRestartRequiredEvent; /** - * 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. + * 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. * @since Chrome 25. */ var onUpdateAvailable: RuntimeUpdateAvailableEvent; /** * @deprecated since Chrome 33. Please use chrome.runtime.onRestartRequired. - * Fired when a Chrome update is available, but isn't installed immediately because a browser restart is required. + * Fired when a Chrome update is available, but isn't installed immediately because a browser restart is required. */ var onBrowserUpdateAvailable: RuntimeEvent; } @@ -5381,15 +5381,15 @@ declare module chrome.scriptBadge { // Sessions //////////////////// /** - * Use the chrome.sessions API to query and restore tabs and windows from a browsing session. - * Permissions: "sessions" + * Use the chrome.sessions API to query and restore tabs and windows from a browsing session. + * Permissions: "sessions" * @since Chrome 37. */ declare module chrome.sessions { interface Filter { /** * Optional. - * The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries (sessions.MAX_SESSION_RESULTS). + * The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries (sessions.MAX_SESSION_RESULTS). */ maxResults?: number; } @@ -5399,12 +5399,12 @@ declare module chrome.sessions { lastModified: number; /** * Optional. - * The tabs.Tab, if this entry describes a tab. Either this or sessions.Session.window will be set. + * The tabs.Tab, if this entry describes a tab. Either this or sessions.Session.window will be set. */ tab?: tabs.Tab; /** * Optional. - * The windows.Window, if this entry describes a window. Either this or sessions.Session.tab will be set. + * The windows.Window, if this entry describes a window. Either this or sessions.Session.tab will be set. */ window?: windows.Window; } @@ -5417,43 +5417,43 @@ declare module chrome.sessions { } interface SessionChangedEvent extends chrome.events.Event<() => void> {} - + /** The maximum number of sessions.Session that will be included in a requested list. */ export var MAX_SESSION_RESULTS: number; - + /** - * Gets the list of recently closed tabs and/or windows. - * @param callback - * Parameter sessions: 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. + * Gets the list of recently closed tabs and/or windows. + * @param callback + * Parameter sessions: 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. */ export function getRecentlyClosed(filter: Filter, callback: (sessions: Session[]) => void): void; /** - * Gets the list of recently closed tabs and/or windows. - * @param callback - * Parameter sessions: 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. + * Gets the list of recently closed tabs and/or windows. + * @param callback + * Parameter sessions: 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. */ export function getRecentlyClosed(callback: (sessions: Session[]) => void): void; /** - * Retrieves all devices with synced sessions. - * @param callback - * Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects. + * Retrieves all devices with synced sessions. + * @param callback + * Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects. */ export function getDevices(filter: Filter, callback: (devices: Device[]) => void): void; /** - * Retrieves all devices with synced sessions. - * @param callback - * Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects. + * Retrieves all devices with synced sessions. + * @param callback + * Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects. */ export function getDevices(callback: (devices: Device[]) => void): void; /** - * Reopens a windows.Window or tabs.Tab, with an optional callback to run when the entry has been restored. + * Reopens a windows.Window or tabs.Tab, with an optional callback to run when the entry has been restored. * @param sessionId Optional. - * The windows.Window.sessionId, or tabs.Tab.sessionId to restore. If this parameter is not specified, the most recently closed session is restored. + * The windows.Window.sessionId, or tabs.Tab.sessionId to restore. If this parameter is not specified, the most recently closed session is restored. * @param callback Optional. - * Parameter restoredSession: A sessions.Session containing the restored windows.Window or tabs.Tab object. + * Parameter restoredSession: A sessions.Session containing the restored windows.Window or tabs.Tab object. */ export function restore(sessionId?: string, callback?: (restoredSession: Session) => void): void; - + /** Fired when recently closed tabs and/or windows are changed. This event does not monitor synced sessions changes. */ export var onChanged: SessionChangedEvent; } @@ -5462,85 +5462,85 @@ declare module chrome.sessions { // Storage //////////////////// /** - * Use the chrome.storage API to store, retrieve, and track changes to user data. - * Permissions: "storage" + * Use the chrome.storage API to store, retrieve, and track changes to user data. + * Permissions: "storage" * @since Chrome 20. */ declare module chrome.storage { interface StorageArea { /** - * Gets the amount of space (in bytes) being used by one or more items. - * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). - * Parameter bytesInUse: Amount of space being used in storage, in bytes. + * Gets the amount of space (in bytes) being used by one or more items. + * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). + * Parameter bytesInUse: Amount of space being used in storage, in bytes. */ getBytesInUse(callback: (bytesInUse: number) => void): void; /** - * Gets the amount of space (in bytes) being used by one or more items. - * @param key A single key to get the total usage for. Pass in null to get the total usage of all of storage. - * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). - * Parameter bytesInUse: Amount of space being used in storage, in bytes. + * Gets the amount of space (in bytes) being used by one or more items. + * @param key A single key to get the total usage for. Pass in null to get the total usage of all of storage. + * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). + * Parameter bytesInUse: Amount of space being used in storage, in bytes. */ getBytesInUse(key: string, callback: (bytesInUse: number) => void): void; /** - * Gets the amount of space (in bytes) being used by one or more items. - * @param keys A 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. - * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). - * Parameter bytesInUse: Amount of space being used in storage, in bytes. + * Gets the amount of space (in bytes) being used by one or more items. + * @param keys A 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. + * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). + * Parameter bytesInUse: Amount of space being used in storage, in bytes. */ getBytesInUse(keys: string[], callback: (bytesInUse: number) => void): void; /** - * Removes all items from storage. + * Removes all items from storage. * @param callback Optional. * Callback on success, or on failure (in which case runtime.lastError will be set). */ clear(callback?: () => void): void; /** - * Sets multiple items. + * Sets multiple items. * @param items 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). * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). + * Callback on success, or on failure (in which case runtime.lastError will be set). */ set(items: Object, callback?: () => void): void; /** * Removes one item from storage. * @param key A single key for items to remove. * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). + * Callback on success, or on failure (in which case runtime.lastError will be set). */ remove(key: string, callback?: () => void): void; /** * Removes items from storage. * @param keys A list of keys for items to remove. * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). + * Callback on success, or on failure (in which case runtime.lastError will be set). */ remove(keys: string[], callback?: () => void): void; /** - * Gets one or more items from storage. - * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). - * Parameter items: Object with items in their key-value mappings. + * Gets one or more items from storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. */ get(callback: (items: { [key: string]: any }) => void): void; /** - * Gets one or more items from storage. - * @param key A single key to get. Pass in null to get the entire contents of storage. - * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). - * Parameter items: Object with items in their key-value mappings. + * Gets one or more items from storage. + * @param key A single key to get. Pass in null to get the entire contents of storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. */ get(key: string, callback: (items: { [key: string]: any }) => void): void; /** - * Gets one or more items from storage. - * @param keys A list of keys to get. An empty list or object will return an empty result object. Pass in null to get the entire contents of storage. - * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). - * Parameter items: Object with items in their key-value mappings. + * Gets one or more items from storage. + * @param keys A list of keys to get. An empty list or object will return an empty result object. Pass in null to get the entire contents of storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. */ get(keys: string[], callback: (items: { [key: string]: any }) => void): void; /** - * Gets one or more items from storage. - * @param keys A dictionary specifying default values. Pass in null to get the entire contents of storage. - * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). - * Parameter items: Object with items in their key-value mappings. + * Gets one or more items from storage. + * @param keys A dictionary specifying default values. Pass in null to get the entire contents of storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. */ get(keys: Object, callback: (items: { [key: string]: any }) => void): void; } @@ -5587,7 +5587,7 @@ declare module chrome.storage { var sync: SyncStorageArea; /** - * Items in the managed storage area are set by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error. + * Items in the managed storage area are set by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error. * @since Chrome 33. */ var managed: StorageArea; @@ -5661,7 +5661,7 @@ declare module chrome.socket { //////////////////// /** * Use the system.cpu API to query CPU metadata. - * Permissions: "system.cpu" + * Permissions: "system.cpu" * @since Chrome 32. */ declare module chrome.system.cpu { @@ -5688,15 +5688,15 @@ declare module chrome.system.cpu { archName: string; /** The model name of the processors. */ modelName: string; - /** - * A set of feature codes indicating some of the processor's capabilities. - * The currently supported codes are "mmx", "sse", "sse2", "sse3", "ssse3", "sse4_1", "sse4_2", and "avx". + /** + * A set of feature codes indicating some of the processor's capabilities. + * The currently supported codes are "mmx", "sse", "sse2", "sse3", "ssse3", "sse4_1", "sse4_2", and "avx". */ features: string[]; /** Information about each logical processor. */ processors: ProcessorInfo[]; } - + /** Queries basic CPU information of the system. */ export function getInfo(callback: (info: CpuInfo) => void): void; } @@ -5705,8 +5705,8 @@ declare module chrome.system.cpu { // System Memory //////////////////// /** - * The chrome.system.memory API. - * Permissions: "system.memory" + * The chrome.system.memory API. + * Permissions: "system.memory" * @since Chrome 32. */ declare module chrome.system.memory { @@ -5716,7 +5716,7 @@ declare module chrome.system.memory { /** The amount of available capacity, in bytes. */ availableCapacity: number; } - + /** Get physical memory information. */ export function getInfo(callback: (info: MemoryInfo) => void): void; } @@ -5725,8 +5725,8 @@ declare module chrome.system.memory { // System Storage //////////////////// /** - * Use the chrome.system.storage API to query storage device information and be notified when a removable storage device is attached and detached. - * Permissions: "system.storage" + * Use the chrome.system.storage API to query storage device information and be notified when a removable storage device is attached and detached. + * Permissions: "system.storage" * @since Chrome 30. */ declare module chrome.system.storage { @@ -5735,11 +5735,11 @@ declare module chrome.system.storage { id: string; /** The name of the storage unit. */ name: string; - /** + /** * The media type of the storage unit. - * fixed: The storage has fixed media, e.g. hard disk or SSD. - * removable: The storage is removable, e.g. USB flash drive. - * unknown: The storage type is unknown. + * fixed: The storage has fixed media, e.g. hard disk or SSD. + * removable: The storage is removable, e.g. USB flash drive. + * unknown: The storage type is unknown. */ type: string; /** The total amount of the storage space, in bytes. */ @@ -5756,21 +5756,21 @@ declare module chrome.system.storage { interface SystemStorageAttachedEvent extends chrome.events.Event<(info: StorageUnitInfo) => void> {} interface SystemStorageDetachedEvent extends chrome.events.Event<(id: string) => void> {} - + /** Get the storage information from the system. The argument passed to the callback is an array of StorageUnitInfo objects. */ export function getInfo(callback: (info: StorageUnitInfo[]) => void): void; /** - * Ejects a removable storage device. + * Ejects a removable storage device. * @param callback - * Parameter result: success: The ejection command is successful -- the application can prompt the user to remove the device; in_use: The device is in use by another application. The ejection did not succeed; the user should not remove the device until the other application is done with the device; no_such_device: There is no such device known. failure: The ejection command failed. + * Parameter result: success: The ejection command is successful -- the application can prompt the user to remove the device; in_use: The device is in use by another application. The ejection did not succeed; the user should not remove the device until the other application is done with the device; no_such_device: There is no such device known. failure: The ejection command failed. */ export function ejectDevice(id: string, callback: (result: string) => void): void; /** - * Get the available capacity of a specified |id| storage device. The |id| is the transient device ID from StorageUnitInfo. + * Get the available capacity of a specified |id| storage device. The |id| is the transient device ID from StorageUnitInfo. * @since Dev channel only. */ export function getAvailableCapacity(id: string, callback: (info: StorageCapacityInfo) => void): void; - + /** Fired when a new removable storage is attached to the system. */ export var onAttached: SystemStorageAttachedEvent; /** Fired when a removable storage is detached from the system. */ @@ -5781,8 +5781,8 @@ declare module chrome.system.storage { // TabCapture //////////////////// /** - * Use the chrome.tabCapture API to interact with tab media streams. - * Permissions: "tabCapture" + * Use the chrome.tabCapture API to interact with tab media streams. + * Permissions: "tabCapture" * @since Chrome 31. */ declare module chrome.tabCapture { @@ -5790,7 +5790,7 @@ declare module chrome.tabCapture { /** The id of the tab whose status changed. */ tabId: number; /** - * The new capture status of the tab. + * The new capture status of the tab. * One of: "pending", "active", "stopped", or "error" */ status: string; @@ -5812,17 +5812,17 @@ declare module chrome.tabCapture { interface CaptureStatusChangedEvent extends chrome.events.Event<(info: CaptureInfo) => void> {} /** - * Captures the visible area of the currently active tab. Capture can only be started on the currently active tab after the extension has been invoked. Capture is maintained across page navigations within the tab, and stops when the tab is closed, or the media stream is closed by the extension. - * @param options Configures the returned media stream. - * @param callback Callback with either the tab capture stream or null. + * Captures the visible area of the currently active tab. Capture can only be started on the currently active tab after the extension has been invoked. Capture is maintained across page navigations within the tab, and stops when the tab is closed, or the media stream is closed by the extension. + * @param options Configures the returned media stream. + * @param callback Callback with either the tab capture stream or null. */ export function capture(options: CaptureOptions, callback: (stream: MediaStream) => void): void; /** - * Returns a list of tabs that have requested capture or are being captured, i.e. status != stopped and status != error. This allows extensions to inform the user that there is an existing tab capture that would prevent a new tab capture from succeeding (or to prevent redundant requests for the same tab). - * @param callback Callback invoked with CaptureInfo[] for captured tabs. + * Returns a list of tabs that have requested capture or are being captured, i.e. status != stopped and status != error. This allows extensions to inform the user that there is an existing tab capture that would prevent a new tab capture from succeeding (or to prevent redundant requests for the same tab). + * @param callback Callback invoked with CaptureInfo[] for captured tabs. */ export function getCapturedTabs(callback: (result: CaptureInfo[]) => void): void; - + /** Event fired when the capture status of a tab changes. This allows extension authors to keep track of the capture status of tabs to keep UI elements like page actions in sync. */ var onStatusChanged: CaptureStatusChangedEvent; } @@ -5831,9 +5831,9 @@ declare module chrome.tabCapture { // Tabs //////////////////// /** - * Use the chrome.tabs API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser. + * Use the chrome.tabs API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser. * Permissions: The majority of the chrome.tabs API can be used without declaring any permission. However, the "tabs" permission is required in order to populate the url, title, and favIconUrl properties of Tab. - * @since Chrome 5. + * @since Chrome 5. */ declare module chrome.tabs { /** @@ -5846,14 +5846,14 @@ declare module chrome.tabs { /** * Optional. * The reason the tab was muted or unmuted. Not set if the tab's mute state has never been changed. - * "user": A user input action has set/overridden the muted state. - * "capture": Tab capture started, forcing a muted state change. - * "extension": An extension, identified by the extensionId field, set the muted state. + * "user": A user input action has set/overridden the muted state. + * "capture": Tab capture started, forcing a muted state change. + * "extension": An extension, identified by the extensionId field, set the muted state. */ reason?: string; /** * Optional. - * The ID of the extension that changed the muted state. Not set if an extension was not the reason the muted state last changed. + * The ID of the extension that changed the muted state. Not set if an extension was not the reason the muted state last changed. */ extensionId?: string; } @@ -5861,85 +5861,85 @@ declare module chrome.tabs { interface Tab { /** * Optional. - * Either loading or complete. + * Either loading or complete. */ status?: string; /** The zero-based index of the tab within its window. */ index: number; /** * Optional. - * The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists. + * The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists. * @since Chrome 18. */ openerTabId?: number; /** * Optional. - * The title of the tab. This property is only present if the extension's manifest includes the "tabs" permission. + * The title of the tab. This property is only present if the extension's manifest includes the "tabs" permission. */ title?: string; /** * Optional. - * The URL the tab is displaying. This property is only present if the extension's manifest includes the "tabs" permission. + * The URL the tab is displaying. This property is only present if the extension's manifest includes the "tabs" permission. */ url?: string; /** - * Whether the tab is pinned. + * Whether the tab is pinned. * @since Chrome 9. */ pinned: boolean; /** - * Whether the tab is highlighted. + * Whether the tab is highlighted. * @since Chrome 16. */ highlighted: boolean; /** The ID of the window the tab is contained within. */ windowId: number; /** - * Whether the tab is active in its window. (Does not necessarily mean the window is focused.) + * Whether the tab is active in its window. (Does not necessarily mean the window is focused.) * @since Chrome 16. */ active: boolean; /** * Optional. - * 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. + * 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. */ favIconUrl?: string; /** * Optional. - * 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 sessions API, in which case a session ID may be present. Tab ID can also be set to chrome.tabs.TAB_ID_NONE for apps and devtools windows. + * 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 sessions API, in which case a session ID may be present. Tab ID can also be set to chrome.tabs.TAB_ID_NONE for apps and devtools windows. */ id?: number; /** Whether the tab is in an incognito window. */ incognito: boolean; /** - * Whether the tab is selected. - * @deprecated since Chrome 33. Please use tabs.Tab.highlighted. + * Whether the tab is selected. + * @deprecated since Chrome 33. Please use tabs.Tab.highlighted. */ selected: boolean; /** * Optional. - * 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. + * 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. * @since Chrome 45. */ audible?: boolean; /** * Optional. - * Current tab muted state and the reason for the last state change. + * Current tab muted state and the reason for the last state change. * @since Chrome 46. Warning: this is the current Beta channel. */ mutedInfo?: MutedInfo; /** - * Optional. The width of the tab in pixels. + * Optional. The width of the tab in pixels. * @since Chrome 31. */ width?: number; /** - * Optional. The height of the tab in pixels. + * Optional. The height of the tab in pixels. * @since Chrome 31. */ height?: number; /** - * Optional. The session ID used to uniquely identify a Tab obtained from the sessions API. + * Optional. The session ID used to uniquely identify a Tab obtained from the sessions API. * @since Chrome 31. */ sessionId?: string; @@ -5952,22 +5952,22 @@ declare module chrome.tabs { interface ZoomSettings { /** * Optional. - * Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to "automatic". - * "automatic": Zoom changes are handled automatically by the browser. - * "manual": 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. - * "disabled": Disables all zooming in the tab. The tab will revert to the default zoom level, and all attempted zoom changes will be ignored. + * Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to "automatic". + * "automatic": Zoom changes are handled automatically by the browser. + * "manual": 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. + * "disabled": Disables all zooming in the tab. The tab will revert to the default zoom level, and all attempted zoom changes will be ignored. */ mode?: string; /** * Optional. - * 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. - * "per-origin": 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. - * "per-tab": 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. + * 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. + * "per-origin": 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. + * "per-tab": 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. */ scope?: string; /** * Optional. - * Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings. + * Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings. * @since Chrome 43. */ defaultZoomFactor?: number; @@ -5976,16 +5976,16 @@ declare module chrome.tabs { interface InjectDetails { /** * Optional. - * 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. + * 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. */ allFrames?: boolean; /** * Optional. JavaScript or CSS code to inject. - * Warning: Be careful using the code parameter. Incorrect use of it may open your extension to cross site scripting attacks. + * Warning: Be careful using the code parameter. Incorrect use of it may open your extension to cross site scripting attacks. */ code?: string; /** - * Optional. The soonest that the JavaScript or CSS will be injected into the tab. + * Optional. The soonest that the JavaScript or CSS will be injected into the tab. * One of: "document_start", "document_end", or "document_idle" * @since Chrome 20. */ @@ -5995,7 +5995,7 @@ declare module chrome.tabs { /** * Optional. * 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. - * @since Chrome 39. + * @since Chrome 39. */ matchAboutBlank?: boolean; } @@ -6005,17 +6005,17 @@ declare module chrome.tabs { index?: number; /** * Optional. - * 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. + * 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. * @since Chrome 18. */ openerTabId?: number; /** * Optional. - * 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. + * 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. */ url?: string; /** - * Optional. Whether the tab should be pinned. Defaults to false + * Optional. Whether the tab should be pinned. Defaults to false * @since Chrome 9. */ pinned?: boolean; @@ -6023,13 +6023,13 @@ declare module chrome.tabs { windowId?: number; /** * Optional. - * Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see windows.update). Defaults to true. + * Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see windows.update). Defaults to true. * @since Chrome 16. */ active?: boolean; /** * Optional. Whether the tab should become the selected tab in the window. Defaults to true - * @deprecated since Chrome 33. Please use active. + * @deprecated since Chrome 33. Please use active. */ selected?: boolean; } @@ -6042,35 +6042,35 @@ declare module chrome.tabs { } interface UpdateProperties { - /** - * Optional. Whether the tab should be pinned. + /** + * Optional. Whether the tab should be pinned. * @since Chrome 9. */ pinned?: boolean; /** - * Optional. The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab. + * Optional. The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab. * @since Chrome 18. */ openerTabId?: number; /** Optional. A URL to navigate the tab to. */ url?: string; /** - * Optional. Adds or removes the tab from the current selection. + * Optional. Adds or removes the tab from the current selection. * @since Chrome 16. */ highlighted?: boolean; /** - * Optional. Whether the tab should be active. Does not affect whether the window is focused (see windows.update). + * Optional. Whether the tab should be active. Does not affect whether the window is focused (see windows.update). * @since Chrome 16. */ active?: boolean; /** - * Optional. Whether the tab should be selected. - * @deprecated since Chrome 33. Please use highlighted. + * Optional. Whether the tab should be selected. + * @deprecated since Chrome 33. Please use highlighted. */ selected?: boolean; /** - * Optional. Whether the tab should be muted. + * Optional. Whether the tab should be muted. * @since Chrome 45. */ muted?: boolean; @@ -6079,11 +6079,11 @@ declare module chrome.tabs { interface CaptureVisibleTabOptions { /** * Optional. - * 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. + * 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. */ quality?: number; /** - * Optional. The format of an image. + * Optional. The format of an image. * One of: "jpeg", or "png" */ format?: string; @@ -6098,7 +6098,7 @@ declare module chrome.tabs { /** Optional. Will be passed into onConnect for content scripts that are listening for the connection event. */ name?: string; /** - * Open a port to a specific frame identified by frameId instead of all frames in the tab. + * Open a port to a specific frame identified by frameId instead of all frames in the tab. * @since Chrome 41. */ frameId?: number; @@ -6119,25 +6119,25 @@ declare module chrome.tabs { interface QueryInfo { /** * Optional. Whether the tabs have completed loading. - * One of: "loading", or "complete" + * One of: "loading", or "complete" */ status?: string; /** - * Optional. Whether the tabs are in the last focused window. + * Optional. Whether the tabs are in the last focused window. * @since Chrome 19. */ lastFocusedWindow?: boolean; /** Optional. The ID of the parent window, or windows.WINDOW_ID_CURRENT for the current window. */ windowId?: number; /** - * Optional. The type of window the tabs are in. - * One of: "normal", "popup", "panel", "app", or "devtools" + * Optional. The type of window the tabs are in. + * One of: "normal", "popup", "panel", "app", or "devtools" */ windowType?: string; /** Optional. Whether the tabs are active in their windows. */ active?: boolean; /** - * Optional. The position of the tabs within their windows. + * Optional. The position of the tabs within their windows. * @since Chrome 18. */ index?: number; @@ -6146,7 +6146,7 @@ declare module chrome.tabs { /** Optional. Match tabs against one or more URL patterns. Note that fragment identifiers are not matched. */ url?: string | string[]; /** - * Optional. Whether the tabs are in the current window. + * Optional. Whether the tabs are in the current window. * @since Chrome 19. */ currentWindow?: boolean; @@ -6155,12 +6155,12 @@ declare module chrome.tabs { /** Optional. Whether the tabs are pinned. */ pinned?: boolean; /** - * Optional. Whether the tabs are audible. + * Optional. Whether the tabs are audible. * @since Chrome 45. */ audible?: boolean; /** - * Optional. Whether the tabs are muted. + * Optional. Whether the tabs are muted. * @since Chrome 45. */ muted?: boolean; @@ -6173,7 +6173,7 @@ declare module chrome.tabs { interface TabRemoveInfo { /** - * The window whose tab is closed. + * The window whose tab is closed. * @since Chrome 25. */ windowId: number; @@ -6190,24 +6190,24 @@ declare module chrome.tabs { /** Optional. The status of the tab. Can be either loading or complete. */ status?: string; /** - * The tab's new pinned state. + * The tab's new pinned state. * @since Chrome 9. */ pinned?: boolean; /** Optional. The tab's URL if it has changed. */ url?: string; /** - * The tab's new audible state. + * The tab's new audible state. * @since Chrome 45. */ audible?: boolean; /** - * The tab's new muted state and the reason for the change. + * The tab's new muted state and the reason for the change. * @since Chrome 46. Warning: this is the current Beta channel. */ mutedInfo?: MutedInfo; /** - * The tab's new favicon URL. + * The tab's new favicon URL. * @since Chrome 27. */ faviconUrl?: string; @@ -6266,121 +6266,121 @@ declare module chrome.tabs { interface TabZoomChangeEvent extends chrome.events.Event<(ZoomChangeInfo: ZoomChangeInfo) => void> {} /** - * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc. - * @param details 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. + * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc. + * @param details 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. * @param callback Optional. Called after all the JavaScript has been executed. - * Parameter result: The result of the script in every injected frame. + * Parameter result: The result of the script in every injected frame. */ export function executeScript(details: InjectDetails, callback?: (result: any[]) => void): void; /** - * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc. - * @param tabId Optional. The ID of the tab in which to run the script; defaults to the active tab of the current window. - * @param details 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. + * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc. + * @param tabId Optional. The ID of the tab in which to run the script; defaults to the active tab of the current window. + * @param details 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. * @param callback Optional. Called after all the JavaScript has been executed. - * Parameter result: The result of the script in every injected frame. + * Parameter result: The result of the script in every injected frame. */ export function executeScript(tabId: number, details: InjectDetails, callback?: (result: any[]) => void): void; /** Retrieves details about the specified tab. */ export function get(tabId: number, callback: (tab: Tab) => void): void; /** - * Gets details about all tabs in the specified window. + * Gets details about all tabs in the specified window. * @deprecated since Chrome 33. Please use tabs.query {windowId: windowId}. */ export function getAllInWindow(callback: (tab: Tab) => void): void; /** - * Gets details about all tabs in the specified window. + * Gets details about all tabs in the specified window. * @deprecated since Chrome 33. Please use tabs.query {windowId: windowId}. - * @param windowId Optional. Defaults to the current window. + * @param windowId Optional. Defaults to the current window. */ export function getAllInWindow(windowId: number, callback: (tab: Tab) => void): void; /** 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). */ export function getCurrent(callback: (tab?: Tab) => void): void; /** - * Gets the tab that is selected in the specified window. + * Gets the tab that is selected in the specified window. * @deprecated since Chrome 33. Please use tabs.query {active: true}. */ export function getSelected(callback: (tab: Tab) => void): void; /** - * Gets the tab that is selected in the specified window. + * Gets the tab that is selected in the specified window. * @deprecated since Chrome 33. Please use tabs.query {active: true}. - * @param windowId Optional. Defaults to the current window. + * @param windowId Optional. Defaults to the current window. */ export function getSelected(windowId: number, callback: (tab: Tab) => void): void; /** - * Creates a new tab. + * Creates a new tab. * @param callback Optional. - * Parameter tab: Details about the created tab. Will contain the ID of the new tab. + * Parameter tab: Details about the created tab. Will contain the ID of the new tab. */ export function create(createProperties: CreateProperties, callback?: (tab: Tab) => void): void; /** - * 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. + * 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 tabId The tab to move. * @param callback Optional. * Parameter tab: Details about the moved tab. */ export function move(tabId: number, moveProperties: MoveProperties, callback?: (tab: Tab) => void): void; /** - * 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. + * 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 tabIds The tabs to move. * @param callback Optional. * Parameter tabs: Details about the moved tabs. */ export function move(tabIds: number[], moveProperties: MoveProperties, callback?: (tabs: Tab[]) => void): void; /** - * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified. + * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified. * @param callback Optional. - * Optional parameter tab: Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested. + * Optional parameter tab: Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested. */ export function update(updateProperties: UpdateProperties, callback?: (tab?: Tab) => void): void; /** - * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified. - * @param tabId Defaults to the selected tab of the current window. + * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified. + * @param tabId Defaults to the selected tab of the current window. * @param callback Optional. - * Optional parameter tab: Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested. + * Optional parameter tab: Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested. */ export function update(tabId: number, updateProperties: UpdateProperties, callback?: (tab?: Tab) => void): void; /** * Closes a tab. - * @param tabId The tab to close. + * @param tabId The tab to close. */ export function remove(tabId: number, callback?: Function): void; /** * Closes several tabs. - * @param tabIds The list of tabs to close. + * @param tabIds The list of tabs to close. */ export function remove(tabIds: number[], callback?: Function): void; /** - * Captures the visible area of the currently active tab in the specified window. You must have permission to use this method. - * @param callback - * Parameter dataUrl: 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. + * Captures the visible area of the currently active tab in the specified window. You must have permission to use this method. + * @param callback + * Parameter dataUrl: 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. */ export function captureVisibleTab(callback: (dataUrl: string) => void): void; /** - * Captures the visible area of the currently active tab in the specified window. You must have permission to use this method. + * Captures the visible area of the currently active tab in the specified window. You must have permission to use this method. * @param windowId Optional. The target window. Defaults to the current window. - * @param callback - * Parameter dataUrl: 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. + * @param callback + * Parameter dataUrl: 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. */ export function captureVisibleTab(windowId: number, callback: (dataUrl: string) => void): void; /** - * Captures the visible area of the currently active tab in the specified window. You must have permission to use this method. - * @param options Optional. Details about the format and quality of an image. - * @param callback - * Parameter dataUrl: 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. + * Captures the visible area of the currently active tab in the specified window. You must have permission to use this method. + * @param options Optional. Details about the format and quality of an image. + * @param callback + * Parameter dataUrl: 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. */ export function captureVisibleTab(options: CaptureVisibleTabOptions, callback: (dataUrl: string) => void): void; /** - * Captures the visible area of the currently active tab in the specified window. You must have permission to use this method. + * Captures the visible area of the currently active tab in the specified window. You must have permission to use this method. * @param windowId Optional. The target window. Defaults to the current window. - * @param options Optional. Details about the format and quality of an image. - * @param callback - * Parameter dataUrl: 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. + * @param options Optional. Details about the format and quality of an image. + * @param callback + * Parameter dataUrl: 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. */ export function captureVisibleTab(windowId: number, options: CaptureVisibleTabOptions, callback: (dataUrl: string) => void): void; /** * Reload a tab. * @since Chrome 16. - * @param tabId The ID of the tab to reload; defaults to the selected tab of the current window. + * @param tabId The ID of the tab to reload; defaults to the selected tab of the current window. */ export function reload(tabId: number, reloadProperties?: ReloadProperties, callback?: () => void): void; /** @@ -6394,28 +6394,28 @@ declare module chrome.tabs { */ export function reload(callback?: () => void): void; /** - * Duplicates a tab. + * Duplicates a tab. * @since Chrome 23. - * @param tabId The ID of the tab which is to be duplicated. + * @param tabId The ID of the tab which is to be duplicated. * @param callback Optional. - * Optional parameter tab: Details about the duplicated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested. + * Optional parameter tab: Details about the duplicated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested. */ export function duplicate(tabId: number, callback?: (tab?: Tab) => void): void; /** * 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 runtime.onMessage event is fired in each content script running in the specified tab for the current extension. - * @since Chrome 20. + * @since Chrome 20. */ export function sendMessage(tabId: number, message: any, responseCallback?: (response: any) => void): void; /** * 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 runtime.onMessage event is fired in each content script running in the specified tab for the current extension. - * @since Chrome 41. + * @since Chrome 41. * @param responseCallback Optional. - * Parameter response: 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 runtime.lastError will be set to the error message. + * Parameter response: 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 runtime.lastError will be set to the error message. */ export function sendMessage(tabId: number, message: any, options: MessageSendOptions, responseCallback?: (response: any) => void): void; /** - * 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 extension.onRequest event is fired in each content script running in the specified tab for the current extension. - * @deprecated since Chrome 33. Please use runtime.sendMessage. + * 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 extension.onRequest event is fired in each content script running in the specified tab for the current extension. + * @deprecated since Chrome 33. Please use runtime.sendMessage. * @param responseCallback Optional. * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and runtime.lastError will be set to the error message. */ @@ -6424,105 +6424,105 @@ declare module chrome.tabs { export function connect(tabId: number, connectInfo?: ConnectInfo): runtime.Port; /** * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc. - * @param details 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. - * @param callback Optional. Called when all the CSS has been inserted. + * @param details 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. + * @param callback Optional. Called when all the CSS has been inserted. */ export function insertCSS(details: InjectDetails, callback?: Function): void; /** * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc. - * @param tabId Optional. The ID of the tab in which to insert the CSS; defaults to the active tab of the current window. - * @param details 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. - * @param callback Optional. Called when all the CSS has been inserted. + * @param tabId Optional. The ID of the tab in which to insert the CSS; defaults to the active tab of the current window. + * @param details 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. + * @param callback Optional. Called when all the CSS has been inserted. */ export function insertCSS(tabId: number, details: InjectDetails, callback?: Function): void; /** - * Highlights the given tabs. + * Highlights the given tabs. * @since Chrome 16. * @param callback Optional. - * Parameter window: Contains details about the window whose tabs were highlighted. + * Parameter window: Contains details about the window whose tabs were highlighted. */ export function highlight(highlightInfo: HighlightInfo, callback: (window: chrome.windows.Window) => void): void; /** - * Gets all tabs that have the specified properties, or all tabs if no properties are specified. + * Gets all tabs that have the specified properties, or all tabs if no properties are specified. * @since Chrome 16. */ export function query(queryInfo: QueryInfo, callback: (result: Tab[]) => void): void; /** - * Detects the primary language of the content in a tab. - * @param callback - * Parameter language: 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. + * Detects the primary language of the content in a tab. + * @param callback + * Parameter language: 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. */ export function detectLanguage(callback: (language: string) => void): void; /** * Detects the primary language of the content in a tab. - * @param tabId Optional. Defaults to the active tab of the current window. - * @param callback - * Parameter language: 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. + * @param tabId Optional. Defaults to the active tab of the current window. + * @param callback + * Parameter language: 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. */ export function detectLanguage(tabId: number, callback: (language: string) => void): void; /** * Zooms a specified tab. * @since Chrome 42. - * @param zoomFactor 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. - * @param callback Optional. Called after the zoom factor has been changed. + * @param zoomFactor 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. + * @param callback Optional. Called after the zoom factor has been changed. */ export function setZoom(zoomFactor: number, callback?: () => void): void; /** * Zooms a specified tab. * @since Chrome 42. * @param tabId Optional. The ID of the tab to zoom; defaults to the active tab of the current window. - * @param zoomFactor 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. - * @param callback Optional. Called after the zoom factor has been changed. + * @param zoomFactor 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. + * @param callback Optional. Called after the zoom factor has been changed. */ export function setZoom(tabId: number, zoomFactor: number, callback?: () => void): void; /** - * Gets the current zoom factor of a specified tab. + * Gets the current zoom factor of a specified tab. * @since Chrome 42. - * @param callback Called with the tab's current zoom factor after it has been fetched. - * Parameter zoomFactor: The tab's current zoom factor. + * @param callback Called with the tab's current zoom factor after it has been fetched. + * Parameter zoomFactor: The tab's current zoom factor. */ export function getZoom(callback: (zoomFactor: number) => void): void; /** - * Gets the current zoom factor of a specified tab. + * Gets the current zoom factor of a specified tab. * @since Chrome 42. - * @param tabId Optional. The ID of the tab to get the current zoom factor from; defaults to the active tab of the current window. - * @param callback Called with the tab's current zoom factor after it has been fetched. - * Parameter zoomFactor: The tab's current zoom factor. + * @param tabId Optional. The ID of the tab to get the current zoom factor from; defaults to the active tab of the current window. + * @param callback Called with the tab's current zoom factor after it has been fetched. + * Parameter zoomFactor: The tab's current zoom factor. */ export function getZoom(tabId: number, callback: (zoomFactor: number) => void): void; /** - * 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. + * 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. * @since Chrome 42. - * @param zoomSettings Defines how zoom changes are handled and at what scope. - * @param callback Optional. Called after the zoom settings have been changed. + * @param zoomSettings Defines how zoom changes are handled and at what scope. + * @param callback Optional. Called after the zoom settings have been changed. */ export function setZoomSettings(zoomSettings: ZoomSettings, callback?: () => void): void; /** - * 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. + * 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. * @since Chrome 42. - * @param tabId Optional. The ID of the tab to change the zoom settings for; defaults to the active tab of the current window. - * @param zoomSettings Defines how zoom changes are handled and at what scope. - * @param callback Optional. Called after the zoom settings have been changed. + * @param tabId Optional. The ID of the tab to change the zoom settings for; defaults to the active tab of the current window. + * @param zoomSettings Defines how zoom changes are handled and at what scope. + * @param callback Optional. Called after the zoom settings have been changed. */ export function setZoomSettings(tabId: number, zoomSettings: ZoomSettings, callback?: () => void): void; /** - * Gets the current zoom settings of a specified tab. + * Gets the current zoom settings of a specified tab. * @since Chrome 42. - * @param callback Called with the tab's current zoom settings. - * Paramater zoomSettings: The tab's current zoom settings. + * @param callback Called with the tab's current zoom settings. + * Paramater zoomSettings: The tab's current zoom settings. */ export function getZoomSettings(callback: (zoomSettings: ZoomSettings) => void): void; /** - * Gets the current zoom settings of a specified tab. + * Gets the current zoom settings of a specified tab. * @since Chrome 42. - * @param tabId Optional. The ID of the tab to get the current zoom settings from; defaults to the active tab of the current window. - * @param callback Called with the tab's current zoom settings. - * Paramater zoomSettings: The tab's current zoom settings. + * @param tabId Optional. The ID of the tab to get the current zoom settings from; defaults to the active tab of the current window. + * @param callback Called with the tab's current zoom settings. + * Paramater zoomSettings: The tab's current zoom settings. */ export function getZoomSettings(tabId: number, callback: (zoomSettings: ZoomSettings) => void): void; /** - * Fired when the highlighted or selected tabs in a window changes. + * Fired when the highlighted or selected tabs in a window changes. * @since Chrome 18. */ var onHighlighted: TabHighlightedEvent; @@ -6533,7 +6533,7 @@ declare module chrome.tabs { /** Fired when a tab is attached to a window, for example because it was moved between windows. */ var onAttached: TabAttachedEvent; /** - * 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 tabs.onDetached. + * 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 tabs.onDetached. */ var onMoved: TabMovedEvent; /** Fired when a tab is detached from a window, for example because it is being moved between windows. */ @@ -6541,32 +6541,32 @@ declare module chrome.tabs { /** 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. */ var onCreated: TabCreatedEvent; /** - * 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. + * 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. * @since Chrome 18. */ var onActivated: TabActivatedEvent; /** - * Fired when a tab is replaced with another tab due to prerendering or instant. + * Fired when a tab is replaced with another tab due to prerendering or instant. * @since Chrome 26. */ var onReplaced: TabReplacedEvent; /** * @deprecated since Chrome 33. Please use tabs.onActivated. - * Fires when the selected tab in a window changes. + * Fires when the selected tab in a window changes. */ var onSelectionChanged: TabSelectedEvent; /** * @deprecated since Chrome 33. Please use tabs.onActivated. - * 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 tabs.onUpdated events to be notified when a URL is set. + * 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 tabs.onUpdated events to be notified when a URL is set. */ var onActiveChanged: TabSelectedEvent; /** - * @deprecated since Chrome 33. Please use tabs.onHighlighted. - * Fired when the highlighted or selected tabs in a window changes. + * @deprecated since Chrome 33. Please use tabs.onHighlighted. + * Fired when the highlighted or selected tabs in a window changes. */ var onHighlightChanged: TabHighlightedEvent; /** - * Fired when a tab is zoomed. + * Fired when a tab is zoomed. * @since Chrome 38. */ var onZoomChange: TabZoomChangeEvent; @@ -6576,8 +6576,8 @@ declare module chrome.tabs { // Top Sites //////////////////// /** - * Use the chrome.topSites API to access the top sites that are displayed on the new tab page. - * Permissions: "topSites" + * Use the chrome.topSites API to access the top sites that are displayed on the new tab page. + * Permissions: "topSites" * @since Chrome 19. */ declare module chrome.topSites { @@ -6597,8 +6597,8 @@ declare module chrome.topSites { // Text to Speech //////////////////// /** - * Use the chrome.tts API to play synthesized text-to-speech (TTS). See also the related ttsEngine API, which allows an extension to implement a speech engine. - * Permissions: "tts" + * Use the chrome.tts API to play synthesized text-to-speech (TTS). See also the related ttsEngine API, which allows an extension to implement a speech engine. + * Permissions: "tts" * @since Chrome 14. */ declare module chrome.tts { @@ -6609,7 +6609,7 @@ declare module chrome.tts { /** Optional. The error description, if the event type is 'error'. */ errorMessage?: string; /** - * The type can be 'start' as soon as speech has started, 'word' when a word boundary is reached, 'sentence' when a sentence boundary is reached, 'marker' when an SSML mark element is reached, 'end' when the end of the utterance is reached, 'interrupted' when the utterance is stopped or interrupted before reaching the end, 'cancelled' when it's removed from the queue before ever being synthesized, or 'error' when any other error occurs. When pausing speech, a 'pause' event is fired if a particular utterance is paused in the middle, and 'resume' if an utterance resumes speech. Note that pause and resume events may not fire if speech is paused in-between utterances. + * The type can be 'start' as soon as speech has started, 'word' when a word boundary is reached, 'sentence' when a sentence boundary is reached, 'marker' when an SSML mark element is reached, 'end' when the end of the utterance is reached, 'interrupted' when the utterance is stopped or interrupted before reaching the end, 'cancelled' when it's removed from the queue before ever being synthesized, or 'error' when any other error occurs. When pausing speech, a 'pause' event is fired if a particular utterance is paused in the middle, and 'resume' if an utterance resumes speech. Note that pause and resume events may not fire if speech is paused in-between utterances. * One of: "start", "end", "word", "sentence", "marker", "interrupted", "cancelled", "error", "pause", or "resume" */ type: string; @@ -6619,9 +6619,9 @@ declare module chrome.tts { interface TtsVoice { /** Optional. The language that this voice supports, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ lang?: string; - /** + /** * Optional. This voice's gender. - * One of: "male", or "female" + * One of: "male", or "female" */ gender?: string; /** Optional. The name of the voice. */ @@ -6631,7 +6631,7 @@ declare module chrome.tts { /** All of the callback event types that this voice is capable of sending. */ eventTypes?: string[]; /** - * If true, the synthesis engine is a remote network resource. It may be higher latency and may incur bandwidth costs. + * If true, the synthesis engine is a remote network resource. It may be higher latency and may incur bandwidth costs. * @since Chrome 33. */ remote?: boolean; @@ -6642,22 +6642,22 @@ declare module chrome.tts { volume?: number; /** * Optional. - * If true, enqueues this utterance if TTS is already in progress. If false (the default), interrupts any current speech and flushes the speech queue before speaking this new utterance. + * If true, enqueues this utterance if TTS is already in progress. If false (the default), interrupts any current speech and flushes the speech queue before speaking this new utterance. */ enqueue?: boolean; /** * Optional. - * Speaking rate relative to the default rate for this voice. 1.0 is the default rate, normally around 180 to 220 words per minute. 2.0 is twice as fast, and 0.5 is half as fast. Values below 0.1 or above 10.0 are strictly disallowed, but many voices will constrain the minimum and maximum rates further—for example a particular voice may not actually speak faster than 3 times normal even if you specify a value larger than 3.0. + * Speaking rate relative to the default rate for this voice. 1.0 is the default rate, normally around 180 to 220 words per minute. 2.0 is twice as fast, and 0.5 is half as fast. Values below 0.1 or above 10.0 are strictly disallowed, but many voices will constrain the minimum and maximum rates further—for example a particular voice may not actually speak faster than 3 times normal even if you specify a value larger than 3.0. */ rate?: number; - /** + /** * Optional. This function is called with events that occur in the process of speaking the utterance. - * @param event The update event from the text-to-speech engine indicating the status of this utterance. + * @param event The update event from the text-to-speech engine indicating the status of this utterance. */ onEvent?: (event: TtsEvent) => void; /** * Optional. - * Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being highest. 1.0 corresponds to a voice's default pitch. + * Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being highest. 1.0 corresponds to a voice's default pitch. */ pitch?: number; /** Optional. The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ @@ -6667,8 +6667,8 @@ declare module chrome.tts { /** Optional. The extension ID of the speech engine to use, if known. */ extensionId?: string; /** - * Optional. Gender of voice for synthesized speech. - * One of: "male", or "female" + * Optional. Gender of voice for synthesized speech. + * One of: "male", or "female" */ gender?: string; /** Optional. The TTS event types the voice must support. */ @@ -6684,25 +6684,25 @@ declare module chrome.tts { /** Gets an array of all available voices. */ export function getVoices(callback?: (voices: TtsVoice[]) => void): void; /** - * Speaks text using a text-to-speech engine. - * @param utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters. - * @param callback Optional. Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback. + * Speaks text using a text-to-speech engine. + * @param utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters. + * @param callback Optional. Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback. */ export function speak(utterance: string, callback?: Function): void; /** - * Speaks text using a text-to-speech engine. - * @param utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters. - * @param options Optional. The speech options. - * @param callback Optional. Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback. + * Speaks text using a text-to-speech engine. + * @param utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters. + * @param options Optional. The speech options. + * @param callback Optional. Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback. */ export function speak(utterance: string, options: SpeakOptions, callback?: Function): void; /** - * Pauses speech synthesis, potentially in the middle of an utterance. A call to resume or stop will un-pause speech. + * Pauses speech synthesis, potentially in the middle of an utterance. A call to resume or stop will un-pause speech. * @since Chrome 29. */ export function pause(): void; /** - * If speech was paused, resumes speaking where it left off. + * If speech was paused, resumes speaking where it left off. * @since Chrome 29. */ export function resume(): void; @@ -6712,8 +6712,8 @@ declare module chrome.tts { // Text to Speech Engine //////////////////// /** - * Use the chrome.ttsEngine API to implement a text-to-speech(TTS) engine using an extension. If your extension registers using this API, it will receive events containing an utterance to be spoken and other parameters when any extension or Chrome App uses the tts API to generate speech. Your extension can then use any available web technology to synthesize and output the speech, and send events back to the calling function to report the status. - * Permissions: "ttsEngine" + * Use the chrome.ttsEngine API to implement a text-to-speech(TTS) engine using an extension. If your extension registers using this API, it will receive events containing an utterance to be spoken and other parameters when any extension or Chrome App uses the tts API to generate speech. Your extension can then use any available web technology to synthesize and output the speech, and send events back to the calling function to report the status. + * Permissions: "ttsEngine" * @since Chrome 14. */ declare module chrome.ttsEngine { @@ -6723,7 +6723,7 @@ declare module chrome.ttsEngine { /** Optional. The name of the voice to use for synthesis. */ voiceName?: string; /** - * Optional. Gender of voice for synthesized speech. + * Optional. Gender of voice for synthesized speech. * One of: "male", or "female" */ gender?: string; @@ -6731,7 +6731,7 @@ declare module chrome.ttsEngine { volume?: number; /** * Optional. - * Speaking rate relative to the default rate for this voice. 1.0 is the default rate, normally around 180 to 220 words per minute. 2.0 is twice as fast, and 0.5 is half as fast. This value is guaranteed to be between 0.1 and 10.0, inclusive. When a voice does not support this full range of rates, don't return an error. Instead, clip the rate to the range the voice supports. + * Speaking rate relative to the default rate for this voice. 1.0 is the default rate, normally around 180 to 220 words per minute. 2.0 is twice as fast, and 0.5 is half as fast. This value is guaranteed to be between 0.1 and 10.0, inclusive. When a voice does not support this full range of rates, don't return an error. Instead, clip the rate to the range the voice supports. */ rate?: number; /** Optional. Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being highest. 1.0 corresponds to this voice's default pitch. */ @@ -6745,12 +6745,12 @@ declare module chrome.ttsEngine { /** Fired when a call is made to tts.stop and this extension may be in the middle of speaking. If an extension receives a call to onStop and speech is already stopped, it should do nothing (not raise an error). If speech is in the paused state, this should cancel the paused state. */ var onStop: chrome.events.Event<() => void>; /** - * Optional: if an engine supports the pause event, it should pause the current utterance being spoken, if any, until it receives a resume event or stop event. Note that a stop event should also clear the paused state. + * Optional: if an engine supports the pause event, it should pause the current utterance being spoken, if any, until it receives a resume event or stop event. Note that a stop event should also clear the paused state. * @since Chrome 29. */ var onPause: chrome.events.Event<() => void>; /** - * Optional: if an engine supports the pause event, it should also support the resume event, to continue speaking the current utterance, if any. Note that a stop event should also clear the paused state. + * Optional: if an engine supports the pause event, it should also support the resume event, to continue speaking the current utterance, if any. Note that a stop event should also clear the paused state. * @since Chrome 29. */ var onResume: chrome.events.Event<() => void>; @@ -6760,7 +6760,7 @@ declare module chrome.ttsEngine { // Types //////////////////// /** - * The chrome.types API contains type declarations for Chrome. + * The chrome.types API contains type declarations for Chrome. * @since Chrome 13. */ declare module chrome.types { @@ -6778,8 +6778,8 @@ declare module chrome.types { interface ChromeSettingSetDetails extends ChromeSettingClearDetails { /** - * 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. + * 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. */ value: any; /** @@ -6799,7 +6799,7 @@ declare module chrome.types { } /** - * @param details Details of the currently effective value. + * @param details Details of the currently effective value. */ type DetailsCallback = (details: ChromeSettingGetResultDetails) => void; @@ -6817,7 +6817,7 @@ declare module chrome.types { /** * Optional. * 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. + * This property will only be present if the incognito property in the details parameter of get() was true. */ incognitoSpecific?: boolean; } @@ -6827,20 +6827,20 @@ declare module chrome.types { /** An interface that allows access to a Chrome browser setting. See accessibilityFeatures for an example. */ interface ChromeSetting { /** - * Sets the value of a setting. - * @param details Which setting to change. - * @param callback Optional. Called at the completion of the set operation. + * Sets the value of a setting. + * @param details Which setting to change. + * @param callback Optional. Called at the completion of the set operation. */ set(details: ChromeSettingSetDetails, callback?: Function): void; /** - * Gets the value of a setting. - * @param details Which setting to consider. + * Gets the value of a setting. + * @param details Which setting to consider. */ get(details: ChromeSettingGetDetails, callback?: DetailsCallback): void; /** - * Clears the setting, restoring any default value. + * Clears the setting, restoring any default value. * @param details Which setting to clear. - * @param callback Optional. Called at the completion of the clear operation. + * @param callback Optional. Called at the completion of the clear operation. */ clear(details: ChromeSettingClearDetails, callback?: Function): void; /** Fired after the setting changes. */ @@ -6852,9 +6852,9 @@ declare module chrome.types { // VPN Provider //////////////////// /** - * Use the chrome.vpnProvider API to implement a VPN client. - * Permissions: "vpnProvider" - * Important: This API works only on Chrome OS. + * Use the chrome.vpnProvider API to implement a VPN client. + * Permissions: "vpnProvider" + * Important: This API works only on Chrome OS. * @since Chrome 43. */ declare module chrome.vpnProvider { @@ -6866,11 +6866,11 @@ declare module chrome.vpnProvider { /** Optional. MTU setting for the VPN interface. (default: 1500 bytes) */ mtu?: string; /** - * Exclude network traffic to the list of IP blocks in CIDR notation from the tunnel. This can be used to bypass traffic to and from the VPN server. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined. + * Exclude network traffic to the list of IP blocks in CIDR notation from the tunnel. This can be used to bypass traffic to and from the VPN server. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined. */ exclusionList: string[]; /** - * Include network traffic to the list of IP blocks in CIDR notation to the tunnel. This parameter can be used to set up a split tunnel. By default no traffic is directed to the tunnel. Adding the entry "0.0.0.0/0" to this list gets all the user traffic redirected to the tunnel. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined. + * Include network traffic to the list of IP blocks in CIDR notation to the tunnel. This parameter can be used to set up a split tunnel. By default no traffic is directed to the tunnel. Adding the entry "0.0.0.0/0" to this list gets all the user traffic redirected to the tunnel. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined. */ inclusionList: string[]; /** Optional. A list of search domains. (default: no search domain) */ @@ -6888,41 +6888,41 @@ declare module chrome.vpnProvider { interface VpnConfigCreationEvent extends chrome.events.Event<(id: string, name: string, data: Object) => void> {} interface VpnUiEvent extends chrome.events.Event<(event: string, id?: string) => void> {} - + /** - * Creates a new VPN configuration that persists across multiple login sessions of the user. - * @param name The name of the VPN configuration. - * @param callback Called when the configuration is created or if there is an error. - * Parameter id: A unique ID for the created configuration, empty string on failure. + * Creates a new VPN configuration that persists across multiple login sessions of the user. + * @param name The name of the VPN configuration. + * @param callback Called when the configuration is created or if there is an error. + * Parameter id: A unique ID for the created configuration, empty string on failure. */ export function createConfig(name: string, callback: (id: string) => void): void; /** - * Destroys a VPN configuration created by the extension. - * @param id ID of the VPN configuration to destroy. - * @param callback Optional. Called when the configuration is destroyed or if there is an error. + * Destroys a VPN configuration created by the extension. + * @param id ID of the VPN configuration to destroy. + * @param callback Optional. Called when the configuration is destroyed or if there is an error. */ export function destroyConfig(id: string, callback?: Function): void; /** - * Sets the parameters for the VPN session. This should be called immediately after "connected" is received from the platform. This will succeed only when the VPN session is owned by the extension. - * @param parameters The parameters for the VPN session. - * @param callback Called when the parameters are set or if there is an error. + * Sets the parameters for the VPN session. This should be called immediately after "connected" is received from the platform. This will succeed only when the VPN session is owned by the extension. + * @param parameters The parameters for the VPN session. + * @param callback Called when the parameters are set or if there is an error. */ export function setParameters(parameters: VpnSessionParameters, callback: Function): void; /** - * Sends an IP packet through the tunnel created for the VPN session. This will succeed only when the VPN session is owned by the extension. - * @param data The IP packet to be sent to the platform. - * @param callback Optional. Called when the packet is sent or if there is an error. + * Sends an IP packet through the tunnel created for the VPN session. This will succeed only when the VPN session is owned by the extension. + * @param data The IP packet to be sent to the platform. + * @param callback Optional. Called when the packet is sent or if there is an error. */ export function sendPacket(data: ArrayBuffer, callback?: Function): void; /** - * Notifies the VPN session state to the platform. This will succeed only when the VPN session is owned by the extension. - * @param state The VPN session state of the VPN client. - * connected: VPN connection was successful. + * Notifies the VPN session state to the platform. This will succeed only when the VPN session is owned by the extension. + * @param state The VPN session state of the VPN client. + * connected: VPN connection was successful. * failure: VPN connection failed. - * @param callback Optional. Called when the notification is complete or if there is an error. + * @param callback Optional. Called when the notification is complete or if there is an error. */ export function notifyConnectionStateChanged(state: string, callback?: Function): void; - + /** Triggered when a message is received from the platform for a VPN configuration owned by the extension. */ var onPlatformMessage: VpnPlatformMessageEvent; /** Triggered when an IP packet is received via the tunnel for the VPN session owned by the extension. */ @@ -6939,9 +6939,9 @@ declare module chrome.vpnProvider { // Wallpaper //////////////////// /** - * Use the chrome.wallpaper API to change the ChromeOS wallpaper. + * Use the chrome.wallpaper API to change the ChromeOS wallpaper. * Permissions: "wallpaper" - * Important: This API works only on Chrome OS. + * Important: This API works only on Chrome OS. * @since Chrome 43. */ declare module chrome.wallpaper { @@ -6951,8 +6951,8 @@ declare module chrome.wallpaper { /** Optional. The URL of the wallpaper to be set. */ url?: string; /** - * The supported wallpaper layouts. - * One of: "STRETCH", "CENTER", or "CENTER_CROPPED" + * The supported wallpaper layouts. + * One of: "STRETCH", "CENTER", or "CENTER_CROPPED" */ layout: string; /** The file name of the saved wallpaper. */ @@ -6962,9 +6962,9 @@ declare module chrome.wallpaper { } /** - * Sets wallpaper to the image at url or wallpaperData with the specified layout + * Sets wallpaper to the image at url or wallpaperData with the specified layout * @param callback - * Optional parameter thumbnail: The jpeg encoded wallpaper thumbnail. It is generated by resizing the wallpaper to 128x60. + * Optional parameter thumbnail: The jpeg encoded wallpaper thumbnail. It is generated by resizing the wallpaper to 128x60. */ export function setWallpaper(details: WallpaperDetails, callback: (thumbnail: any) => void): void; } @@ -6973,14 +6973,14 @@ declare module chrome.wallpaper { // Web Navigation //////////////////// /** - * Use the chrome.webNavigation API to receive notifications about the status of navigation requests in-flight. - * Permissions: "webNavigation" + * Use the chrome.webNavigation API to receive notifications about the status of navigation requests in-flight. + * Permissions: "webNavigation" * @since Chrome 16. */ declare module chrome.webNavigation { interface GetFrameDetails { /** - * The ID of the process runs the renderer for this tab. + * The ID of the process runs the renderer for this tab. * @since Chrome 22. */ processId: number; @@ -7031,7 +7031,7 @@ declare module chrome.webNavigation { /** 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. */ frameId: number; /** - * The ID of the process runs the renderer for this tab. + * The ID of the process runs the renderer for this tab. * @since Chrome 22. */ processId: number; @@ -7046,7 +7046,7 @@ declare module chrome.webNavigation { /** The ID of the tab in which the navigation is triggered. */ sourceTabId: number; /** - * The ID of the process runs the renderer for the source tab. + * The ID of the process runs the renderer for the source tab. * @since Chrome 22. */ sourceProcessId: number; @@ -7056,7 +7056,7 @@ declare module chrome.webNavigation { interface WebNavigationParentedCallbackDetails extends WebNavigationFramedCallbackDetails { /** - * ID of frame that wraps the frame. Set to -1 of no parent frame exists. + * ID of frame that wraps the frame. Set to -1 of no parent frame exists. * @since Chrome 24. */ parentFrameId: number; @@ -7064,13 +7064,13 @@ declare module chrome.webNavigation { interface WebNavigationTransitionCallbackDetails extends WebNavigationFramedCallbackDetails { /** - * Cause of the navigation. - * One of: "link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", or "keyword_generated" + * Cause of the navigation. + * One of: "link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", or "keyword_generated" */ transitionType: string; /** - * A list of transition qualifiers. - * Each element one of: "client_redirect", "server_redirect", "forward_back", or "from_address_bar" + * A list of transition qualifiers. + * Each element one of: "client_redirect", "server_redirect", "forward_back", or "from_address_bar" */ transitionQualifiers: string[]; } @@ -7083,7 +7083,7 @@ declare module chrome.webNavigation { interface WebNavigationEvent extends chrome.events.Event<(details: T) => void> { addListener(callback: (details: T) => void, filters?: WebNavigationEventFilter): void; } - + interface WebNavigationFramedEvent extends WebNavigationEvent {} interface WebNavigationFramedErrorEvent extends WebNavigationEvent {} @@ -7097,17 +7097,17 @@ declare module chrome.webNavigation { interface WebNavigationReplacementEvent extends WebNavigationEvent {} /** - * Retrieves information about the given frame. A frame refers to an