sinon-chrome
Version:
Mock of chrome extensions API for unit testing under nodejs
2 lines • 1.11 MB
JavaScript
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.chrome=n():e.chrome=n()}(this,function(){return function(e){function n(t){if(l[t])return l[t].exports;var i=l[t]={exports:{},id:t,loaded:!1};return e[t].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var l={};return n.m=e,n.c=l,n.p="",n(0)}([function(e,n,l){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var i=l(1),r=t(i),o=l(2),u=t(o);n.default=new u.default(r.default).create(),e.exports=n.default},function(e,n){e.exports=[{types:[{id:"Alarm",type:"object",properties:{name:{type:"string"},scheduledTime:{type:"number"},periodInMinutes:{type:"number",nullable:!0}}},{id:"AlarmCreateInfo",type:"object",properties:{when:{type:"number",nullable:!0},delayInMinutes:{type:"number",nullable:!0},periodInMinutes:{type:"number",nullable:!0}}}],functions:[{name:"create",type:"function",parameters:[{type:"string",optional:!0,name:"name"},{$ref:"AlarmCreateInfo",optional:!1,name:"alarmInfo"}],static:!0},{name:"get",type:"function",parameters:[{type:"string",optional:!0,name:"name"},{optional:!1,name:"callback",type:"function",parameters:[{$ref:"Alarm",optional:!0,name:"alarm"}]}],static:!0},{name:"getAll",type:"function",parameters:[{optional:!1,name:"callback",type:"function",parameters:[{type:"array",items:{$ref:"Alarm"},optional:!1,name:"alarms"}]}],static:!0},{name:"clear",type:"function",parameters:[{type:"string",optional:!0,name:"name"},{optional:!0,name:"callback",type:"function",parameters:[{type:"boolean",optional:!1,name:"wasCleared"}]}],static:!0},{name:"clearAll",type:"function",parameters:[{optional:!0,name:"callback",type:"function",parameters:[{type:"boolean",optional:!1,name:"wasCleared"}]}],static:!0}],events:[{name:"onAlarm",type:"function",parameters:[{$ref:"Alarm",optional:!1,name:"alarm"}]}],namespace:"alarms",dependencies:["permission:alarms"]},{namespace:"bookmarks",description:"Use the <code>chrome.bookmarks</code> API to create, organize, and otherwise manipulate bookmarks. Also see <a href='override'>Override Pages</a>, which you can use to create a custom Bookmark Manager page.",properties:{MAX_WRITE_OPERATIONS_PER_HOUR:{value:1e6,deprecated:"Bookmark write operations are no longer limited by Chrome.",description:""},MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE:{value:1e6,deprecated:"Bookmark write operations are no longer limited by Chrome.",description:""}},types:[{id:"BookmarkTreeNodeUnmodifiable",type:"string",enum:["managed"],description:"Indicates the reason why this node is unmodifiable. The <var>managed</var> value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default)."},{id:"BookmarkTreeNode",type:"object",description:"A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder.",properties:{id:{type:"string",minimum:0,description:"The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the browser is restarted."},parentId:{type:"string",minimum:0,optional:!0,description:"The <code>id</code> of the parent folder. Omitted for the root node."},index:{type:"integer",optional:!0,description:"The 0-based position of this node within its parent folder."},url:{type:"string",optional:!0,description:"The URL navigated to when a user clicks the bookmark. Omitted for folders."},title:{type:"string",description:"The text displayed for the node."},dateAdded:{type:"number",optional:!0,description:"When this node was created, in milliseconds since the epoch (<code>new Date(dateAdded)</code>)."},dateGroupModified:{type:"number",optional:!0,description:"When the contents of this folder last changed, in milliseconds since the epoch."},unmodifiable:{$ref:"BookmarkTreeNodeUnmodifiable",optional:!0,description:"Indicates the reason why this node is unmodifiable. The <var>managed</var> 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)."},children:{type:"array",optional:!0,items:{$ref:"BookmarkTreeNode"},description:"An ordered list of children of this node."}}},{id:"CreateDetails",description:"Object passed to the create() function.",inline_doc:!0,type:"object",properties:{parentId:{type:"string",serialized_type:"int64",optional:!0,description:"Defaults to the Other Bookmarks folder."},index:{type:"integer",minimum:0,optional:!0},title:{type:"string",optional:!0},url:{type:"string",optional:!0}}}],functions:[{name:"get",type:"function",description:"Retrieves the specified BookmarkTreeNode(s).",parameters:[{name:"idOrIdList",description:"A single string-valued id, or an array of string-valued ids",choices:[{type:"string",serialized_type:"int64"},{type:"array",items:{type:"string",serialized_type:"int64"},minItems:1}]},{type:"function",name:"callback",parameters:[{name:"results",type:"array",items:{$ref:"BookmarkTreeNode"}}]}]},{name:"getChildren",type:"function",description:"Retrieves the children of the specified BookmarkTreeNode id.",parameters:[{type:"string",serialized_type:"int64",name:"id"},{type:"function",name:"callback",parameters:[{name:"results",type:"array",items:{$ref:"BookmarkTreeNode"}}]}]},{name:"getRecent",type:"function",description:"Retrieves the recently added bookmarks.",parameters:[{type:"integer",minimum:1,name:"numberOfItems",description:"The maximum number of items to return."},{type:"function",name:"callback",parameters:[{name:"results",type:"array",items:{$ref:"BookmarkTreeNode"}}]}]},{name:"getTree",type:"function",description:"Retrieves the entire Bookmarks hierarchy.",parameters:[{type:"function",name:"callback",parameters:[{name:"results",type:"array",items:{$ref:"BookmarkTreeNode"}}]}]},{name:"getSubTree",type:"function",description:"Retrieves part of the Bookmarks hierarchy, starting at the specified node.",parameters:[{type:"string",serialized_type:"int64",name:"id",description:"The ID of the root of the subtree to retrieve."},{type:"function",name:"callback",parameters:[{name:"results",type:"array",items:{$ref:"BookmarkTreeNode"}}]}]},{name:"search",type:"function",description:"Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.",parameters:[{name:"query",description:"Either a string of words and quoted phrases that are matched against bookmark URLs and titles, or an object. If an object, the properties <code>query</code>, <code>url</code>, and <code>title</code> may be specified and bookmarks matching all specified properties will be produced.",choices:[{type:"string",description:"A string of words and quoted phrases that are matched against bookmark URLs and titles."},{type:"object",description:"An object specifying properties and values to match when searching. Produces bookmarks matching all properties.",properties:{query:{type:"string",optional:!0,description:"A string of words and quoted phrases that are matched against bookmark URLs and titles."},url:{type:"string",optional:!0,description:"The URL of the bookmark; matches verbatim. Note that folders have no URL."},title:{type:"string",optional:!0,description:"The title of the bookmark; matches verbatim."}}}]},{type:"function",name:"callback",parameters:[{name:"results",type:"array",items:{$ref:"BookmarkTreeNode"}}]}]},{name:"create",type:"function",description:"Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder.",parameters:[{$ref:"CreateDetails",name:"bookmark"},{type:"function",name:"callback",optional:!0,parameters:[{name:"result",$ref:"BookmarkTreeNode"}]}]},{name:"move",type:"function",description:"Moves the specified BookmarkTreeNode to the provided location.",parameters:[{type:"string",serialized_type:"int64",name:"id"},{type:"object",name:"destination",properties:{parentId:{type:"string",optional:!0},index:{type:"integer",minimum:0,optional:!0}}},{type:"function",name:"callback",optional:!0,parameters:[{name:"result",$ref:"BookmarkTreeNode"}]}]},{name:"update",type:"function",description:"Updates the properties of a bookmark or folder. Specify only the properties that you want to change; unspecified properties will be left unchanged. <b>Note:</b> Currently, only 'title' and 'url' are supported.",parameters:[{type:"string",serialized_type:"int64",name:"id"},{type:"object",name:"changes",properties:{title:{type:"string",optional:!0},url:{type:"string",optional:!0}}},{type:"function",name:"callback",optional:!0,parameters:[{name:"result",$ref:"BookmarkTreeNode"}]}]},{name:"remove",type:"function",description:"Removes a bookmark or an empty bookmark folder.",parameters:[{type:"string",serialized_type:"int64",name:"id"},{type:"function",name:"callback",optional:!0,parameters:[]}]},{name:"removeTree",type:"function",description:"Recursively removes a bookmark folder.",parameters:[{type:"string",serialized_type:"int64",name:"id"},{type:"function",name:"callback",optional:!0,parameters:[]}]},{name:"import",type:"function",description:"Imports bookmarks from a chrome html bookmark file",nodoc:"true",parameters:[{type:"function",name:"callback",optional:!0,parameters:[]}]},{name:"export",type:"function",description:"Exports bookmarks to a chrome html bookmark file",nodoc:"true",parameters:[{type:"function",name:"callback",optional:!0,parameters:[]}]}],events:[{name:"onCreated",type:"function",description:"Fired when a bookmark or folder is created.",parameters:[{type:"string",name:"id"},{$ref:"BookmarkTreeNode",name:"bookmark"}]},{name:"onRemoved",type:"function",description:"Fired when a bookmark or folder is removed. When a folder is removed recursively, a single notification is fired for the folder, and none for its contents.",parameters:[{type:"string",name:"id"},{type:"object",name:"removeInfo",properties:{parentId:{type:"string"},index:{type:"integer"},node:{$ref:"BookmarkTreeNode"}}}]},{name:"onChanged",type:"function",description:"Fired when a bookmark or folder changes. <b>Note:</b> Currently, only title and url changes trigger this.",parameters:[{type:"string",name:"id"},{type:"object",name:"changeInfo",properties:{title:{type:"string"},url:{type:"string",optional:!0}}}]},{name:"onMoved",type:"function",description:"Fired when a bookmark or folder is moved to a different parent folder.",parameters:[{type:"string",name:"id"},{type:"object",name:"moveInfo",properties:{parentId:{type:"string"},index:{type:"integer"},oldParentId:{type:"string"},oldIndex:{type:"integer"}}}]},{name:"onChildrenReordered",type:"function",description:"Fired when the children of a folder have changed their order due to the order being sorted in the UI. This is not called as a result of a move().",parameters:[{type:"string",name:"id"},{type:"object",name:"reorderInfo",properties:{childIds:{type:"array",items:{type:"string"}}}}]},{name:"onImportBegan",type:"function",description:"Fired when a bookmark import session is begun. Expensive observers should ignore onCreated updates until onImportEnded is fired. Observers should still handle other notifications immediately.",parameters:[]},{name:"onImportEnded",type:"function",description:"Fired when a bookmark import session is ended.",parameters:[]}],dependencies:["permission:bookmarks"]},{namespace:"browserAction",description:"Use browser actions to put icons in the main Google Chrome toolbar, to the right of the address bar. In addition to its <a href='browserAction#icon'>icon</a>, a browser action can also have a <a href='browserAction#tooltip'>tooltip</a>, a <a href='browserAction#badge'>badge</a>, and a <a href='browserAction#popups'>popup</a>.",types:[{id:"ColorArray",type:"array",items:{type:"integer",minimum:0,maximum:255},minItems:4,maxItems:4},{id:"ImageDataType",type:"object",isInstanceOf:"ImageData",additionalProperties:{type:"any"},description:"Pixel data for an image. Must be an ImageData object (for example, from a <code>canvas</code> element)."}],functions:[{name:"setTitle",type:"function",description:"Sets the title of the browser action. This shows up in the tooltip.",parameters:[{name:"details",type:"object",properties:{title:{type:"string",description:"The string the browser action should display when moused over."},tabId:{type:"integer",optional:!0,description:"Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."}}}]},{name:"getTitle",type:"function",description:"Gets the title of the browser action.",parameters:[{name:"details",type:"object",properties:{tabId:{type:"integer",optional:!0,description:"Specify the tab to get the title from. If no tab is specified, the non-tab-specific title is returned."}}},{type:"function",name:"callback",parameters:[{name:"result",type:"string"}]}]},{name:"setIcon",type:"function",description:"Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the <b>path</b> or the <b>imageData</b> property must be specified.",parameters:[{name:"details",type:"object",properties:{imageData:{choices:[{$ref:"ImageDataType"},{type:"object",additionalProperties:{type:"any"}}],optional:!0,description:"Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * n will be selected, where n is the size of the icon in the UI. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'16': foo}'"},path:{choices:[{type:"string"},{type:"object",additionalProperties:{type:"any"}}],optional:!0,description:"Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * n will be selected, where n is the size of the icon in the UI. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.path = {'16': foo}'"},tabId:{type:"integer",optional:!0,description:"Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."}}},{type:"function",name:"callback",optional:!0,parameters:[]}]},{name:"setPopup",type:"function",description:"Sets the html document to be opened as a popup when the user clicks on the browser action's icon.",parameters:[{name:"details",type:"object",properties:{tabId:{type:"integer",optional:!0,minimum:0,description:"Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."},popup:{type:"string",description:"The html file to show in a popup. If set to the empty string (''), no popup is shown."}}}]},{name:"getPopup",type:"function",description:"Gets the html document set as the popup for this browser action.",parameters:[{name:"details",type:"object",properties:{tabId:{type:"integer",optional:!0,description:"Specify the tab to get the popup from. If no tab is specified, the non-tab-specific popup is returned."}}},{type:"function",name:"callback",parameters:[{name:"result",type:"string"}]}]},{name:"setBadgeText",type:"function",description:"Sets the badge text for the browser action. The badge is displayed on top of the icon.",parameters:[{name:"details",type:"object",properties:{text:{type:"string",description:"Any number of characters can be passed, but only about four can fit in the space."},tabId:{type:"integer",optional:!0,description:"Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."}}}]},{name:"getBadgeText",type:"function",description:"Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned.",parameters:[{name:"details",type:"object",properties:{tabId:{type:"integer",optional:!0,description:"Specify the tab to get the badge text from. If no tab is specified, the non-tab-specific badge text is returned."}}},{type:"function",name:"callback",parameters:[{name:"result",type:"string"}]}]},{name:"setBadgeBackgroundColor",type:"function",description:"Sets the background color for the badge.",parameters:[{name:"details",type:"object",properties:{color:{description:"An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is <code>[255, 0, 0, 255]</code>. Can also be a string with a CSS value, with opaque red being <code>#FF0000</code> or <code>#F00</code>.",choices:[{type:"string"},{$ref:"ColorArray"}]},tabId:{type:"integer",optional:!0,description:"Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."}}}]},{name:"getBadgeBackgroundColor",type:"function",description:"Gets the background color of the browser action.",parameters:[{name:"details",type:"object",properties:{tabId:{type:"integer",optional:!0,description:"Specify the tab to get the badge background color from. If no tab is specified, the non-tab-specific badge background color is returned."}}},{type:"function",name:"callback",parameters:[{name:"result",$ref:"ColorArray"}]}]},{name:"enable",type:"function",description:"Enables the browser action for a tab. By default, browser actions are enabled.",parameters:[{type:"integer",optional:!0,name:"tabId",minimum:0,description:"The id of the tab for which you want to modify the browser action."}]},{name:"disable",type:"function",description:"Disables the browser action for a tab.",parameters:[{type:"integer",optional:!0,name:"tabId",minimum:0,description:"The id of the tab for which you want to modify the browser action."}]},{name:"openPopup",type:"function",description:"Opens the extension popup window in the active window but does not grant tab permissions.",nodoc:!0,parameters:[{type:"function",name:"callback",parameters:[{name:"popupView",type:"object",optional:!0,description:"JavaScript 'window' object for the popup window if it was succesfully opened.",additionalProperties:{type:"any"}}]}]}],events:[{name:"onClicked",type:"function",description:"Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup.",parameters:[{name:"tab",$ref:"tabs.Tab"}]}],dependencies:["manifest:browser_action"]},{namespace:"browsingData",description:"Use the <code>chrome.browsingData</code> API to remove browsing data from a user's local profile.",types:[{id:"RemovalOptions",type:"object",description:"Options that determine exactly what data will be removed.",properties:{since:{type:"number",optional:!0,description:"Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the <code>getTime</code> method of the JavaScript <code>Date</code> object). If absent, defaults to 0 (which would remove all browsing data)."},originTypes:{type:"object",optional:!0,description:"An object whose properties specify which origin types ought to be cleared. If this object isn't specified, it defaults to clearing only \"unprotected\" origins. Please ensure that you <em>really</em> want to remove application data before adding 'protectedWeb' or 'extensions'.",properties:{unprotectedWeb:{type:"boolean",optional:!0,description:"Normal websites."},protectedWeb:{type:"boolean",optional:!0,description:"Websites that have been installed as hosted applications (be careful!)."},extension:{type:"boolean",optional:!0,description:"Extensions and packaged applications a user has installed (be _really_ careful!)."}}}}},{id:"DataTypeSet",type:"object",description:"A set of data types. Missing data types are interpreted as <code>false</code>.",properties:{appcache:{type:"boolean",optional:!0,description:"Websites' appcaches."},cache:{type:"boolean",optional:!0,description:"The browser's cache. Note: when removing data, this clears the <em>entire</em> cache: it is not limited to the range you specify."},cookies:{type:"boolean",optional:!0,description:"The browser's cookies."},downloads:{type:"boolean",optional:!0,description:"The browser's download list."},fileSystems:{type:"boolean",optional:!0,description:"Websites' file systems."},formData:{type:"boolean",optional:!0,description:"The browser's stored form data."},history:{type:"boolean",optional:!0,description:"The browser's history."},indexedDB:{type:"boolean",optional:!0,description:"Websites' IndexedDB data."},localStorage:{type:"boolean",optional:!0,description:"Websites' local storage data."},serverBoundCertificates:{type:"boolean",optional:!0,description:"Server-bound certificates."},passwords:{type:"boolean",optional:!0,description:"Stored passwords."},pluginData:{type:"boolean",optional:!0,description:"Plugins' data."},serviceWorkers:{type:"boolean",optional:!0,description:"Service Workers."},webSQL:{type:"boolean",optional:!0,description:"Websites' WebSQL data."}}}],functions:[{name:"settings",description:"Reports which types of data are currently selected in the 'Clear browsing data' settings UI. Note: some of the data types included in this API are not available in the settings UI, and some UI settings control more than one data type listed here.",type:"function",parameters:[{name:"callback",type:"function",parameters:[{name:"result",type:"object",properties:{options:{$ref:"RemovalOptions"},dataToRemove:{$ref:"DataTypeSet",description:"All of the types will be present in the result, with values of <code>true</code> if they are both selected to be removed and permitted to be removed, otherwise <code>false</code>."},dataRemovalPermitted:{$ref:"DataTypeSet",description:"All of the types will be present in the result, with values of <code>true</code> if they are permitted to be removed (e.g., by enterprise policy) and <code>false</code> if not."}}}]}]},{name:"remove",description:"Clears various types of browsing data stored in a user's profile.",type:"function",parameters:[{$ref:"RemovalOptions",name:"options"},{name:"dataToRemove",$ref:"DataTypeSet",description:"The set of data types to remove."},{name:"callback",type:"function",description:"Called when deletion has completed.",optional:!0,parameters:[]}]},{name:"removeAppcache",description:"Clears websites' appcache data.",type:"function",parameters:[{$ref:"RemovalOptions",name:"options"},{name:"callback",type:"function",description:"Called when websites' appcache data has been cleared.",optional:!0,parameters:[]}]},{name:"removeCache",description:"Clears the browser's cache.",type:"function",parameters:[{$ref:"RemovalOptions",name:"options"},{name:"callback",type:"function",description:"Called when the browser's cache has been cleared.",optional:!0,parameters:[]}]},{name:"removeCookies",description:"Clears the browser's cookies and server-bound certificates modified within a particular timeframe.",type:"function",parameters:[{$ref:"RemovalOptions",name:"options"},{name:"callback",type:"function",description:"Called when the browser's cookies and server-bound certificates have been cleared.",optional:!0,parameters:[]}]},{name:"removeDownloads",description:"Clears the browser's list of downloaded files (<em>not</em> the downloaded files themselves).",type:"function",parameters:[{$ref:"RemovalOptions",name:"options"},{name:"callback",type:"function",description:"Called when the browser's list of downloaded files has been cleared.",optional:!0,parameters:[]}]},{name:"removeFileSystems",description:"Clears websites' file system data.",type:"function",parameters:[{$ref:"RemovalOptions",name:"options"},{name:"callback",type:"function",description:"Called when websites' file systems have been cleared.",optional:!0,parameters:[]}]},{name:"removeFormData",description:"Clears the browser's stored form data (autofill).",type:"function",parameters:[{$ref:"RemovalOptions",name:"options"},{name:"callback",type:"function",description:"Called when the browser's form data has been cleared.",optional:!0,parameters:[]}]},{name:"removeHistory",description:"Clears the browser's history.",type:"function",parameters:[{$ref:"RemovalOptions",name:"options"},{name:"callback",type:"function",description:"Called when the browser's history has cleared.",optional:!0,parameters:[]}]},{name:"removeIndexedDB",description:"Clears websites' IndexedDB data.",type:"function",parameters:[{$ref:"RemovalOptions",name:"options"},{name:"callback",type:"function",description:"Called when websites' IndexedDB data has been cleared.",optional:!0,parameters:[]}]},{name:"removeLocalStorage",description:"Clears websites' local storage data.",type:"function",parameters:[{$ref:"RemovalOptions",name:"options"},{name:"callback",type:"function",description:"Called when websites' local storage has been cleared.",optional:!0,parameters:[]}]},{name:"removePluginData",description:"Clears plugins' data.",type:"function",parameters:[{$ref:"RemovalOptions",name:"options"},{name:"callback",type:"function",description:"Called when plugins' data has been cleared.",optional:!0,parameters:[]}]},{name:"removePasswords",description:"Clears the browser's stored passwords.",type:"function",parameters:[{$ref:"RemovalOptions",name:"options"},{name:"callback",type:"function",description:"Called when the browser's passwords have been cleared.",optional:!0,parameters:[]}]},{name:"removeWebSQL",description:"Clears websites' WebSQL data.",type:"function",parameters:[{$ref:"RemovalOptions",name:"options"},{name:"callback",type:"function",description:"Called when websites' WebSQL databases have been cleared.",optional:!0,parameters:[]}]}],dependencies:["permission:browsingData"]},{namespace:"commands",description:"Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the extension.",types:[{id:"Command",type:"object",properties:{name:{type:"string",optional:!0,description:"The name of the Extension Command"},description:{type:"string",optional:!0,description:"The Extension Command description"},shortcut:{type:"string",optional:!0,description:"The shortcut active for this command, or blank if not active."}}}],events:[{name:"onCommand",description:"Fired when a registered command is activated using a keyboard shortcut.",type:"function",parameters:[{name:"command",type:"string"}]}],functions:[{name:"getAll",type:"function",description:"Returns all the registered extension commands for this extension and their shortcut (if active).",parameters:[{type:"function",name:"callback",optional:!0,parameters:[{name:"commands",type:"array",items:{$ref:"Command"}}],description:"Called to return the registered commands."}]}],dependencies:["manifest:commands"]},{namespace:"contentSettings",description:"Use the <code>chrome.contentSettings</code> 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.",compiler_options:{generate_type_functions:!0},types:[{id:"ResourceIdentifier",type:"object",properties:{id:{type:"string",description:"The resource identifier for the given content type."},description:{type:"string",optional:!0,description:"A human readable description of the resource."}},description:'The only content type using resource identifiers is $(ref:contentSettings.plugins). For more information, see <a href="contentSettings#resource-identifiers">Resource Identifiers</a>.'},{id:"Scope",type:"string",enum:["regular","incognito_session_only"],description:"The scope of the ContentSetting. One of<br><var>regular</var>: setting for regular profile (which is inherited by the incognito profile if not overridden elsewhere),<br><var>incognito_session_only</var>: setting for incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular settings)."},{id:"ContentSetting",js_module:"ContentSetting",type:"object",functions:[{name:"clear",type:"function",description:"Clear all content setting rules set by this extension.",parameters:[{name:"details",type:"object",properties:{scope:{$ref:"Scope",optional:!0,description:"Where to clear the setting (default: regular)."}}},{type:"function",name:"callback",optional:!0,parameters:[]}]},{name:"get",type:"function",description:"Gets the current content setting for a given pair of URLs.",parameters:[{name:"details",type:"object",properties:{primaryUrl:{type:"string",description:"The primary URL for which the content setting should be retrieved. Note that the meaning of a primary URL depends on the content type."},secondaryUrl:{type:"string",description:"The secondary URL for which the content setting should be retrieved. Defaults to the primary URL. Note that the meaning of a secondary URL depends on the content type, and not all content types use secondary URLs.",optional:!0},resourceIdentifier:{$ref:"ResourceIdentifier",optional:!0,description:"A more specific identifier of the type of content for which the settings should be retrieved."},incognito:{type:"boolean",optional:!0,description:"Whether to check the content settings for an incognito session. (default false)"}}},{type:"function",name:"callback",parameters:[{name:"details",type:"object",properties:{setting:{type:"any",description:"The content setting. See the description of the individual ContentSetting objects for the possible values."}}}]}]},{name:"set",type:"function",description:"Applies a new content setting rule.",parameters:[{name:"details",type:"object",properties:{primaryPattern:{type:"string",description:"The pattern for the primary URL. For details on the format of a pattern, see <a href='contentSettings#patterns'>Content Setting Patterns</a>."},secondaryPattern:{type:"string",description:"The pattern for the secondary URL. Defaults to matching all URLs. For details on the format of a pattern, see <a href='contentSettings#patterns'>Content Setting Patterns</a>.",optional:!0},resourceIdentifier:{$ref:"ResourceIdentifier",optional:!0,description:"The resource identifier for the content type."},setting:{type:"any",description:"The setting applied by this rule. See the description of the individual ContentSetting objects for the possible values."},scope:{$ref:"Scope",optional:!0,description:"Where to set the setting (default: regular)."}}},{type:"function",name:"callback",optional:!0,parameters:[]}]},{name:"getResourceIdentifiers",type:"function",description:"",parameters:[{name:"callback",type:"function",parameters:[{name:"resourceIdentifiers",type:"array",description:"A list of resource identifiers for this content type, or <var>undefined</var> if this content type does not use resource identifiers.",optional:!0,items:{$ref:"ResourceIdentifier"}}]}]}]},{id:"CookiesContentSetting",type:"string",enum:["allow","block","session_only"]},{id:"ImagesContentSetting",type:"string",enum:["allow","block"]},{id:"JavascriptContentSetting",type:"string",enum:["allow","block"]},{id:"LocationContentSetting",type:"string",enum:["allow","block","ask"]},{id:"PluginsContentSetting",type:"string",enum:["allow","block","detect_important_content"]},{id:"PopupsContentSetting",type:"string",enum:["allow","block"]},{id:"NotificationsContentSetting",type:"string",enum:["allow","block","ask"]},{id:"FullscreenContentSetting",type:"string",enum:["allow","ask"]
},{id:"MouselockContentSetting",type:"string",enum:["allow","block","ask"]},{id:"MicrophoneContentSetting",type:"string",enum:["allow","block","ask"]},{id:"CameraContentSetting",type:"string",enum:["allow","block","ask"]},{id:"PpapiBrokerContentSetting",type:"string",enum:["allow","block","ask"]},{id:"MultipleAutomaticDownloadsContentSetting",type:"string",enum:["allow","block","ask"]}],properties:{cookies:{$ref:"ContentSetting",description:"Whether to allow cookies and other local data to be set by websites. One of<br><var>allow</var>: Accept cookies,<br><var>block</var>: Block cookies,<br><var>session_only</var>: Accept cookies only for the current session. <br>Default is <var>allow</var>.<br>The primary URL is the URL representing the cookie origin. The secondary URL is the URL of the top-level frame.",value:["cookies",{$ref:"CookiesContentSetting"}]},images:{$ref:"ContentSetting",description:"Whether to show images. One of<br><var>allow</var>: Show images,<br><var>block</var>: Don't show images. <br>Default is <var>allow</var>.<br>The primary URL is the URL of the top-level frame. The secondary URL is the URL of the image.",value:["images",{$ref:"ImagesContentSetting"}]},javascript:{$ref:"ContentSetting",description:"Whether to run JavaScript. One of<br><var>allow</var>: Run JavaScript,<br><var>block</var>: Don't run JavaScript. <br>Default is <var>allow</var>.<br>The primary URL is the URL of the top-level frame. The secondary URL is not used.",value:["javascript",{$ref:"JavascriptContentSetting"}]},location:{$ref:"ContentSetting",description:"Whether to allow Geolocation. One of <br><var>allow</var>: Allow sites to track your physical location,<br><var>block</var>: Don't allow sites to track your physical location,<br><var>ask</var>: Ask before allowing sites to track your physical location. <br>Default is <var>ask</var>.<br>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).",value:["geolocation",{$ref:"LocationContentSetting"}]},plugins:{$ref:"ContentSetting",description:"Whether to run plugins. One of<br><var>allow</var>: Run plugins automatically,<br><var>block</var>: Don't run plugins automatically,<br><var>detect_important_content</var>: Only run automatically those plugins that are detected as the website's main content.<br>The primary URL is the URL of the top-level frame. The secondary URL is not used.",value:["plugins",{$ref:"PluginsContentSetting"}]},popups:{$ref:"ContentSetting",description:"Whether to allow sites to show pop-ups. One of<br><var>allow</var>: Allow sites to show pop-ups,<br><var>block</var>: Don't allow sites to show pop-ups. <br>Default is <var>block</var>.<br>The primary URL is the URL of the top-level frame. The secondary URL is not used.",value:["popups",{$ref:"PopupsContentSetting"}]},notifications:{$ref:"ContentSetting",description:"Whether to allow sites to show desktop notifications. One of<br><var>allow</var>: Allow sites to show desktop notifications,<br><var>block</var>: Don't allow sites to show desktop notifications,<br><var>ask</var>: Ask when a site wants to show desktop notifications. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the document which wants to show the notification. The secondary URL is not used.",value:["notifications",{$ref:"NotificationsContentSetting"}]},fullscreen:{$ref:"ContentSetting",description:"Whether to allow sites to toggle the fullscreen mode. One of<br><var>allow</var>: Allow sites to toggle the fullscreen mode,<br><var>ask</var>: Ask when a site wants to toggle the fullscreen mode. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the document which requested to toggle the fullscreen mode. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL).",value:["fullscreen",{$ref:"FullscreenContentSetting"}]},mouselock:{$ref:"ContentSetting",description:"Whether to allow sites to disable the mouse cursor. One of <br><var>allow</var>: Allow sites to disable the mouse cursor,<br><var>block</var>: Don't allow sites to disable the mouse cursor,<br><var>ask</var>: Ask when a site wants to disable the mouse cursor. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the top-level frame. The secondary URL is not used.",value:["mouselock",{$ref:"MouselockContentSetting"}]},microphone:{$ref:"ContentSetting",description:"Whether to allow sites to access the microphone. One of <br><var>allow</var>: Allow sites to access the microphone,<br><var>block</var>: Don't allow sites to access the microphone,<br><var>ask</var>: Ask when a site wants to access the microphone. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the document which requested microphone access. The secondary URL is not used.<br>NOTE: The 'allow' setting is not valid if both patterns are '<all_urls>'.",value:["media-stream-mic",{$ref:"MicrophoneContentSetting"}]},camera:{$ref:"ContentSetting",description:"Whether to allow sites to access the camera. One of <br><var>allow</var>: Allow sites to access the camera,<br><var>block</var>: Don't allow sites to access the camera,<br><var>ask</var>: Ask when a site wants to access the camera. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the document which requested camera access. The secondary URL is not used.<br>NOTE: The 'allow' setting is not valid if both patterns are '<all_urls>'.",value:["media-stream-camera",{$ref:"CameraContentSetting"}]},unsandboxedPlugins:{$ref:"ContentSetting",description:"Whether to allow sites to run plugins unsandboxed. One of <br><var>allow</var>: Allow sites to run plugins unsandboxed,<br><var>block</var>: Don't allow sites to run plugins unsandboxed,<br><var>ask</var>: Ask when a site wants to run a plugin unsandboxed. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the top-level frame. The secondary URL is not used.",value:["ppapi-broker",{$ref:"PpapiBrokerContentSetting"}]},automaticDownloads:{$ref:"ContentSetting",description:"Whether to allow sites to download multiple files automatically. One of <br><var>allow</var>: Allow sites to download multiple files automatically,<br><var>block</var>: Don't allow sites to download multiple files automatically,<br><var>ask</var>: Ask when a site wants to download files automatically after the first file. <br>Default is <var>ask</var>.<br>The primary URL is the URL of the top-level frame. The secondary URL is not used.",value:["automatic-downloads",{$ref:"MultipleAutomaticDownloadsContentSetting"}]}},dependencies:["permission:contentSettings"]},{namespace:"contextMenus",description:"Use the <code>chrome.contextMenus</code> 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.",properties:{ACTION_MENU_TOP_LEVEL_LIMIT:{value:6,description:"The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored."}},types:[{id:"ContextType",type:"string",enum:["all","page","frame","selection","link","editable","image","video","audio","launcher","browser_action","page_action"],description:"The different contexts a menu can appear in. Specifying 'all' is equivalent to the combination of all other contexts except for 'launcher'. The 'launcher' context is only supported by apps and is used to add menu items to the context menu that appears when clicking on the app icon in the launcher/taskbar/dock/etc. Different platforms might put limitations on what is actually supported in a launcher context menu."},{id:"ItemType",type:"string",enum:["normal","checkbox","radio","separator"],description:"The type of menu item."}],functions:[{name:"create",type:"function",description:"Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.runtime.lastError).",returns:{choices:[{type:"integer"},{type:"string"}],description:"The ID of the newly created item."},parameters:[{type:"object",name:"createProperties",properties:{type:{$ref:"ItemType",optional:!0,description:"The type of menu item. Defaults to 'normal' if not specified."},id:{type:"string",optional:!0,description:"The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension."},title:{type:"string",optional:!0,description:"The text to be displayed in the item; this is <em>required</em> unless <code>type</code> is 'separator'. When the context is 'selection', you can use <code>%s</code> within the string to show the selected text. For example, if this parameter's value is \"Translate '%s' to Pig Latin\" and the user selects the word \"cool\", the context menu item for the selection is \"Translate 'cool' to Pig Latin\"."},checked:{type:"boolean",optional:!0,description:"The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items."},contexts:{type:"array",items:{$ref:"ContextType"},minItems:1,optional:!0,description:"List of contexts this menu item will appear in. Defaults to ['page'] if not specified."},onclick:{type:"function",optional:!0,description:"A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, they should register a listener for chrome.contextMenus.onClicked.",parameters:[{name:"info",$ref:"contextMenusInternal.OnClickData",description:"Information about the item clicked and the context where the click happened."},{name:"tab",$ref:"tabs.Tab",description:"The details of the tab where the click took place. Note: this parameter only present for extensions."}]},parentId:{choices:[{type:"integer"},{type:"string"}],optional:!0,description:"The ID of a parent menu item; this makes the item a child of a previously added item."},documentUrlPatterns:{type:"array",items:{type:"string"},optional:!0,description:"Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see <a href='match_patterns'>Match Patterns</a>."},targetUrlPatterns:{type:"array",items:{type:"string"},optional:!0,description:"Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags."},enabled:{type:"boolean",optional:!0,description:"Whether this context menu item is enabled or disabled. Defaults to true."}}},{type:"function",name:"callback",optional:!0,description:"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.",parameters:[]}]},{name:"update",type:"function",description:"Updates a previously created context menu item.",parameters:[{choices:[{type:"integer"},{type:"string"}],name:"id",description:"The ID of the item to update."},{type:"object",name:"updateProperties",description:"The properties to update. Accepts the same values as the create function.",properties:{type:{$ref:"ItemType",optional:!0},title:{type:"string",optional:!0},checked:{type:"boolean",optional:!0},contexts:{type:"array",items:{$ref:"ContextType"},minItems:1,optional:!0},onclick:{type:"function",optional:!0,parameters:[{name:"info",$ref:"contextMenusInternal.OnClickData"},{name:"tab",$ref:"tabs.Tab",description:"The details of the tab where the click took place. Note: this parameter only present for extensions."}]},parentId:{choices:[{type:"integer"},{type:"string"}],optional:!0,description:"Note: You cannot change an item to be a child of one of its own descendants."},documentUrlPatterns:{type:"array",items:{type:"string"},optional:!0},targetUrlPatterns:{type:"array",items:{type:"string"},optional:!0},enabled:{type:"boolean",optional:!0}}},{type:"function",name:"callback",optional:!0,parameters:[],description:"Called when the context menu has been updated."}]},{name:"remove",type:"function",description:"Removes a context menu item.",parameters:[{choices:[{type:"integer"},{type:"string"}],name:"menuItemId",description:"The ID of the context menu item to remove."},{type:"function",name:"callback",optional:!0,parameters:[],description:"Called when the context menu has been removed."}]},{name:"removeAll",type:"function",description:"Removes all context menu items added by this extension.",parameters:[{type:"function",name:"callback",optional:!0,parameters:[],description:"Called when removal is complete."}]}],events:[{name:"onClicked",type:"function",$ref:"contextMenusInternal.onClicked"}],dependencies:["permission:contextMenus"]},{namespace:"cookies",description:"Use the <code>chrome.cookies</code> API to query and modify cookies, and to be notified when they change.",types:[{id:"SameSiteStatus",type:"string",enum:["no_restriction","lax","strict"],description:"A cookie's 'SameSite' state (https://tools.ietf.org/html/draft-west-first-party-cookies). 'no_restriction' corresponds to a cookie set without a 'SameSite' attribute, 'lax' to 'SameSite=Lax', and 'strict' to 'SameSite=Strict'."},{id:"Cookie",type:"object",description:"Represents information about an HTTP cookie.",properties:{name:{type:"string",description:"The name of the cookie."},value:{type:"string",description:"The value of the cookie."},domain:{type:"string",description:'The domain of the cookie (e.g. "www.google.com", "example.com").'},hostOnly:{type:"boolean",description:"True if the cookie is a host-only cookie (i.e. a request's host must exactly match the domain of the cookie)."},path:{type:"string",description:"The path of the cookie."},secure:{type:"boolean",description:"True if the cookie is marked as Secure (i.e. its scope is limited to secure channels, typically HTTPS)."},httpOnly:{type:"boolean",description:"True if the cookie is marked as HttpOnly (i.e. the cookie is inaccessible to client-side scripts)."},sameSite:{$ref:"SameSiteStatus",description:"The cookie's same-site status (i.e. whether the cookie is sent with cross-site requests)."},session:{type:"boolean",description:"True if the cookie is a session cookie, as opposed to a persistent cookie with an expiration date."},expirationDate:{type:"number",optional:!0,description:"The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies."},storeId:{type:"string",description:"The ID of the cookie store containing this cookie, as provided in getAllCookieStores()."}}},{id:"CookieStore",type:"object",description:"Represents a cookie store in the browser. An incognito mode window, for instance, uses a separate cookie store from a non-incognito window.",properties:{id:{type:"string",description:"The unique identifier for the cookie store."},tabIds:{type:"array",items:{type:"integer"},description:"Identifiers of all the browser tabs that share this cookie store."}}},{id:"OnChangedCause",type:"string",enum:["evicted","expired","explicit","expired_overwrite","overwrite"],description:'The underlying reason behind the cookie\'s change. If a cookie was inserted, or removed via an explicit call to "chrome.cookies.remove", "cause" will be "explicit". If a cookie was automatically removed due to expiry, "cause" will be "expired". If a cookie was removed due to being overwritten with an already-expired expiration date, "cause" will be set to "expired_overwrite". If a cookie was automatically removed due to garbage collection, "cause" will be "evicted". If a cookie was automatically removed due to a "set" call that overwrote it, "cause" will be "overwrite". Plan your response accordingly.'}],functions:[{name:"get",type:"function",description:"Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, the one with the longest path will be returned. For cookies with the same path length, the cookie with the earliest creation time will be returned.",parameters:[{type:"object",name:"details",description:"Details to identify the cookie being retrieved.",properties:{url:{type:"string",description:"The URL with which the cookie to retrieve is associated. This argument may be a full URL, in which case any data following the URL path (e.g. the query string) is simply ignored. If host permissions for this URL are not specified in the manifest file, the API call will fail."},name:{type:"string",description:"The name of the cookie to retrieve."},storeId:{type:"string",optional:!0,description:"The ID of the cookie store in which to look for the cookie. By default, the current execution context's cookie store will be used."}}},{type:"function",name:"callback",parameters:[{name:"cookie",$ref:"Cookie",optional:!0,description:"Contains details about the cookie. This parameter is null if no such cookie was found."}]}]},{name:"getAll",type:"function",description:"Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first.",parameters:[{type:"object",name:"details",description:"Information to filter the cookies being retrieved.",properties:{url:{type:"string",optional:!0,description:"Restricts the retrieved cookies to those that would match the given URL."},name:{type:"string",optional:!0,description:"Filters the cookies by name."},domain:{type:"string",optional:!0,description:"Restricts the retrieved cookies to those whose domains match or are subdomains of this one."},path:{type:"string",optional:!0,description:"Restricts the retrieved cookies to those whose path exactly matches this string."},secure:{type:"boolean",optional:!0,description:"Filters the cookies by their Secure p