summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/docs/overview.html
blob: 3ebad1b92c9808e00ee1c093180276c0ec01f4e7 (plain)
1
<!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc. Note: 1) The <head> information in this page is significant, should be uniform across api docs and should be edited only with knowledge of the templating mechanism. 2) The <body> tag *must* retain id="body" 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a browser, it will be re-generated from the template, json schema and authored overview content. 4) The <body>.innerHTML is also generated by an offline step so that this page may easily be indexed by search engines. TODO(rafaelw): Abstract this into a "pageshell" that becomes the single version of page template shell and the "instance" pages (bookmarks.html, etc...) can be generated with a build step. --><!-- <html> must retain id="template --><html xmlns="http://www.w3.org/1999/xhtml" jstcache="0"><!-- <head> data is significant and loads the needed libraries and styles --><head jstcache="0"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" jstcache="0"> <title jscontent="getPageTitle()" jstcache="1">Overview</title> <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css" jstcache="0"> <script type="text/javascript" src="../../../third_party/jstemplate/jstemplate_compiled.js" jstcache="0"> </script> <script type="text/javascript" src="js/api_page_generator.js" jstcache="0"></script> <script type="text/javascript" src="js/bootstrap.js" jstcache="0"></script> </head><!-- <body> content is completely generated. Do not edit, as it will be and rewritten. --><body jstcache="0"> <div id="container" jstcache="0"> <a name="top" jstcache="0"> </a> <!-- API HEADER --> <div id="pageHeader" jstcache="0"> <div id="searchbox" jstcache="0"> <form action="http://www.google.com/cse" id="cse-search-box" jstcache="0"> <div jstcache="0"> <input type="hidden" name="cx" value="002967670403910741006:61_cvzfqtno" jstcache="0"> <input type="hidden" name="ie" value="UTF-8" jstcache="0"> <input type="text" name="q" size="31" jstcache="0"> <input type="submit" name="sa" value="Search" jstcache="0"> </div> </form> <script type="text/javascript" src="http://www.google.com/jsapi" jstcache="0"></script> <script type="text/javascript" jstcache="0">google.load("elements", "1", {packages: "transliteration"});</script> <script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse-search-box&amp;t13n_langs=en" jstcache="0"></script> <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en" jstcache="0"></script> </div> <div id="pageTitle" jstcache="0"> <h1 jscontent="getPageTitle()" jstcache="1">Overview</h1> </div> </div> <!-- /pageHeader --> <div id="pageContent" jstcache="0"> <!-- SIDENAV --> <div id="leftNav" jstcache="0"> <ul jstcache="0"> <li jstcache="0"> <a href="index.html" jstcache="0">Home</a></li> <li jstcache="0"> <a href="getstarted.html" jstcache="0">Getting Started</a></li> <li jstcache="0" class="leftNavSelected">Overview </li> <li jstcache="0"> <a href="devguide.html" jstcache="0"><div jstcache="0">Developer's Guide</div></a> <ul jstcache="0"> <li jstcache="0"><a href="toolstrip.html" jstcache="0">Toolstrips</a></li> <li jstcache="0"><a href="pageActions.html" jstcache="0">Page Actions</a></li> <li jstcache="0"><a href="background_pages.html" jstcache="0">Background Pages</a></li> <li jstcache="0"><a href="content_scripts.html" jstcache="0">Content Scripts</a></li> <li jstcache="0">Events</li> <li jstcache="0"><a href="tabs.html" jstcache="0">Tabs</a></li> <li jstcache="0"><a href="windows.html" jstcache="0">Windows</a></li> <li jstcache="0"><a href="bookmarks.html" jstcache="0">Bookmarks</a></li> <li jstcache="0">Themes</li> <li jstcache="0"><a href="npapi.html" jstcache="0">NPAPI Plugins</a></li> <li jstcache="0"><a href="packaging.html" jstcache="0">Packaging</a></li> <li jstcache="0">Autoupdate</li> </ul> </li> <li jstcache="0"><a href="tutorials.html" jstcache="0"><div jstcache="0">Tutorials</div></a> <ul jstcache="0"> <li jstcache="0"><a href="tut_debugging.html" jstcache="0">Debugging</a></li> </ul> </li> <li jstcache="0">Reference <ul jstcache="0"> <li jstcache="0"> Formats <ul jstcache="0"> <li jstcache="0"><a href="manifest.html" jstcache="0">Manifest Files</a></li> <li jstcache="0">Match Patterns</li> <li jstcache="0">Packages (.crx)</li> </ul> </li> <li jstcache="0"> <a href="api_index.html" jstcache="0">chrome.* APIs</a> </li> <li jstcache="0"> <a href="api_other.html" jstcache="0">Other APIs</a> </li> </ul> </li> <li jstcache="0"><a href="http://dev.chromium.org/developers/design-documents/extensions/samples" jstcache="0">Samples</a></li> </ul> </div> <div id="mainColumn" jstcache="0"> <!-- TABLE OF CONTENTS --> <div id="toc" jsdisplay="showPageTOC()" jstcache="2"> <p jstcache="0">Contents</p> <ol jstcache="0"> <li jsselect="getStaticTOC()" jstcache="9" jsinstance="0"> <a jscontent="name" jsvalues=".href:'#' + href" jstcache="14" href="#H2-0">The basics</a> <ol jstcache="0"> <li jsselect="$this.children" jstcache="22" jsinstance="*0" style="display: none; "> <a jscontent="name" jsvalues=".href:'#' + href" jstcache="14">h3Name</a> </li> </ol> </li><li jsselect="getStaticTOC()" jstcache="9" jsinstance="1"> <a jscontent="name" jsvalues=".href:'#' + href" jstcache="14" href="#H2-1">Files</a> <ol jstcache="0"> <li jsselect="$this.children" jstcache="22" jsinstance="0"> <a jscontent="name" jsvalues=".href:'#' + href" jstcache="14" href="#H3-2">Referring to files</a> </li><li jsselect="$this.children" jstcache="22" jsinstance="*1"> <a jscontent="name" jsvalues=".href:'#' + href" jstcache="14" href="#H3-3">The manifest file</a> </li> </ol> </li><li jsselect="getStaticTOC()" jstcache="9" jsinstance="2"> <a jscontent="name" jsvalues=".href:'#' + href" jstcache="14" href="#H2-4">Architecture</a> <ol jstcache="0"> <li jsselect="$this.children" jstcache="22" jsinstance="0"> <a jscontent="name" jsvalues=".href:'#' + href" jstcache="14" href="#H3-5">The background page</a> </li><li jsselect="$this.children" jstcache="22" jsinstance="*1"> <a jscontent="name" jsvalues=".href:'#' + href" jstcache="14" href="#H3-6">Content scripts</a> </li> </ol> </li><li jsselect="getStaticTOC()" jstcache="9" jsinstance="3"> <a jscontent="name" jsvalues=".href:'#' + href" jstcache="14" href="#H2-7">Communication </a> <ol jstcache="0"> <li jsselect="$this.children" jstcache="22" jsinstance="*0" style="display: none; "> <a jscontent="name" jsvalues=".href:'#' + href" jstcache="14">h3Name</a> </li> </ol> </li><li jsselect="getStaticTOC()" jstcache="9" jsinstance="*4"> <a jscontent="name" jsvalues=".href:'#' + href" jstcache="14" href="#H2-8"> Summary </a> <ol jstcache="0"> <li jsselect="$this.children" jstcache="22" jsinstance="*0" style="display: none; "> <a jscontent="name" jsvalues=".href:'#' + href" jstcache="14">h3Name</a> </li> </ol> </li> <div jsselect="apiDefinition" jstcache="3" style="display: none; "> <li jstcache="0"> <a href="#apiReference" jscontent="'API reference: ' + getModuleName()" jstcache="4">API reference</a> <ol jstcache="0"> <li jsdisplay="$this.properties" jstcache="5"> <a href="#properties" jstcache="0">Properties</a> <ol jstcache="0"> <li jsselect="getPropertyListFromObject($this)" jstcache="10"> <a jscontent="name" jsvalues=".href:'#property-' + name" href="#property-anchor" jstcache="41">propertyName</a> </li> </ol> </li> <li jsdisplay="functions &amp;&amp; functions.length &gt; 0" jstcache="6"> <a href="#methods" jstcache="0">Methods</a> <ol jstcache="0"> <li jsselect="functions" jstcache="11"> <a jscontent="name" jsvalues=".href:'#method-' + name" href="#method-anchor" jstcache="42">methodName</a> </li> </ol> </li> <li jsdisplay="events &amp;&amp; events.length &gt; 0" jstcache="7"> <a href="#events" jstcache="0">Events</a> <ol jstcache="0"> <li jsselect="events" jstcache="12"> <a jscontent="name" jsvalues=".href:'#event-' + name" href="#event-anchor" jstcache="43">eventName</a> </li> </ol> </li> <li jsdisplay="types &amp;&amp; types.length &gt; 0" jstcache="8"> <a href="#types" jstcache="0">Types</a> <ol jstcache="0"> <li jsselect="types" jstcache="13"> <a jscontent="id" jsvalues=".href:'#type-' + id" href="#id-anchor" jstcache="44">id</a> </li> </ol> </li> </ol> </li> </div> </ol> </div> <!-- /TABLE OF CONTENTS --> <!-- STATIC CONTENT PLACEHOLDER --> <div id="static" jstcache="0"><div id="pageData-title" class="pageData" jstcache="0">Overview</div> <div id="pageData-showTOC" class="pageData" jstcache="0">true</div> <p jstcache="0"> Please read this page; it has vital information about the extension architecture. If you get bored or restless, take a break! We suggest bouncing between this page and tutorials such as <a href="getstarted.html" jstcache="0">Getting Started</a> and <a href="tut_debugging.html" jstcache="0">Debugging</a>. </p> <a name="H2-0" jstcache="0"></a><h2 id="what" jstcache="0">The basics</h2> <p jstcache="0"> An extension is a zipped bundle of files — HTML, CSS, JavaScript, images, and anything else you need — that adds functionality to the Google Chrome browser. Because an extension is just a special kind of web page, it can use all the APIs that the browser provides to web pages and apps, from XMLHttpRequest to JSON to localStorage. </p> <p jstcache="0"> Extensions can add UI to Google Chrome, in the form of <a href="toolstrip.html" jstcache="0">toolstrips</a> (toolbar additions) and <a href="pageActions.html" jstcache="0">page actions</a> (clickable badges in the address bar). Extensions can also interact programmatically with browser features such as <a href="bookmarks.html" jstcache="0">bookmarks</a> and <a href="tabs.html" jstcache="0">tabs</a>. </p> <p jstcache="0"> To find a complete list of extension features, with implementation details for each one, see the <a href="devguide.html" jstcache="0">Developer's Guide</a>. </p> <a name="H2-1" jstcache="0"></a><h2 id="files" jstcache="0">Files</h2> <p jstcache="0"> Each extension has the following files: <!-- PENDING: This could use a picture --> </p> <ul jstcache="0"> <li jstcache="0">A <b jstcache="0">manifest file</b></li> <li jstcache="0">One or more <b jstcache="0">HTML files</b> (unless the extension is a theme)</li> <li jstcache="0"><em jstcache="0">Optional:</em> One or more <b jstcache="0">JavaScript files</b></li> <li jstcache="0"><em jstcache="0">Optional:</em> Any other files your extension needs — for example, image files</li> </ul> <p jstcache="0"> While you're working on your extension, you put all these files into a single folder. When you distribute your extension, the contents of the folder are packaged into a special zipfile that has a <code jstcache="0">.crx</code> suffix, as described in <a href="packaging.html" jstcache="0">Packaging</a>. </p> <a name="H3-2" jstcache="0"></a><h3 jstcache="0">Referring to files</h3> <p jstcache="0"> You can put any file you like into an extension, but how do you use it? Usually, you can refer to the file using a relative URL, just as you would in an ordinary HTML page. Here's an example of referring to a file named <code jstcache="0">myimage.png</code> that's in a subdirectory named <code jstcache="0">images</code>. </p> <pre jstcache="0">&lt;img <b jstcache="0">src="images/myimage.png"</b> style="width:auto; height:auto"&gt; </pre> <p jstcache="0"> As you might notice while you use the Google Chrome debugger, every file in an extension is also accessible by an absolute URL like this: </p> <blockquote jstcache="0"> <b jstcache="0">chrome-extension://</b><em jstcache="0">&lt;extensionID&gt;</em><b jstcache="0">/</b><em jstcache="0">&lt;pathToFile&gt;</em> </blockquote> <p jstcache="0"> In that URL, the <em jstcache="0">&lt;extensionID&gt;</em> is a unique identifier that the extension system generates for each extension. You can see the IDs for all your loaded extensions by going to the URL <b jstcache="0">chrome://extensions/</b>. The <em jstcache="0">&lt;pathToFile&gt;</em> is the location of the file under the extension's top directory; it's the same as the relative URL. </p> <p class="comment" jstcache="0"> [QUESTION TO REVIEWERS: Is this section too big/detailed? It seems a little weird to mention absolute URLs with mentioning getURL and when you'd need it. What's the motivation for covering absolute URLs? Is the debugger the place you're most likely to see them?] </p> <p jstcache="0"> For example, assume your extension has the ID <b jstcache="0">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</b> and the files shown in the following figure: </p> <pre jstcache="0"><span class="comment" jstcache="0">[PENDING: convert this into a figure]</span> toolstrip.html styles.css images: myimage.png ... other: more.html morestyles.css ... </pre> <p jstcache="0"> Here's a table that shows the relative and absolute URLs of these files. Keep in mind that the relative URL is the same no matter where you're using it — the relative URL of <code jstcache="0">myimage.png</code> is <b jstcache="0">images/myimage.png</b>, no matter whether it's being used by <code jstcache="0">toolstrip.html</code> or <code jstcache="0">other/more.html</code>. </p> <table jstcache="0"> <tbody jstcache="0"><tr jstcache="0"> <th jstcache="0"> File </th> <th jstcache="0"> Relative URL </th> <th jstcache="0"> Absolute URL </th> </tr> <tr jstcache="0"> <td jstcache="0"> toolstrip.html </td> <td jstcache="0"> toolstrip.html </td> <td jstcache="0"> chrome-extension://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/toolstrip.html </td> </tr> <tr jstcache="0"> <td jstcache="0"> styles.css </td> <td jstcache="0"> styles.css </td> <td jstcache="0"> chrome-extension://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/styles.css </td> </tr> <tr jstcache="0"> <td jstcache="0"> myimage.png </td> <td jstcache="0"> images/myimage.png </td> <td jstcache="0"> chrome-extension://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/images/myimage.png </td> </tr> <tr jstcache="0"> <td jstcache="0"> more.html </td> <td jstcache="0"> other/more.html </td> <td jstcache="0"> chrome-extension://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/other/more.html </td> </tr> <tr jstcache="0"> <td jstcache="0"> morestyles.css </td> <td jstcache="0"> other/morestyles.css </td> <td jstcache="0"> chrome-extension://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/other/morestyles.css </td> </tr> </tbody></table> <p class="comment" jstcache="0"> [PENDING: Mention/reflect/link to <a href="http://dev.chromium.org/developers/design-documents/extensions/i18n" jstcache="0">internationalization</a>] </p> <a name="H3-3" jstcache="0"></a><h3 jstcache="0">The manifest file</h3> <p jstcache="0"> The manifest file, called <code jstcache="0">manifest.json</code>, gives information about the extension, such as the most important files and the capabilities that the extension might use. Here's a typical manifest file for a toolstrip that uses information from google.com: </p> <pre jstcache="0">{ "name": "My Extension", "version": "2.1", "description": "Gets information from Google.", "update_url": "http://example.com/mytestextension/updates.xml", "permissions": ["http://*.google.com/", "https://*.google.com/"], "toolstrips": ["my_toolstrip.html"] }</pre> <p jstcache="0"> For details, see <a href="manifest.html" jstcache="0">Manifest Files</a>. </p> <a name="H2-4" jstcache="0"></a><h2 id="arch" jstcache="0">Architecture</h2> <p jstcache="0"> The following pictures shows the web pages associated with a typical extension (in this case, a simple toolstrip). The first figure shows what an extension might look like when there's a single browser window. </p> <p class="comment" jstcache="0"> [PENDING: image goes here] </p> <p jstcache="0"> The next figure shows that all the code in the extension's main HTML file is duplicated each time you create a new window. In other words, each window has its own widgets for the extension, which means each window adds another web page for that extension. </p> <p class="comment" jstcache="0"> [PENDING: image goes here] </p> <p jstcache="0"> To more easily coordinate all these web pages and to avoid duplication, you should design your extension so that most of the code — especially the state of the extension — is in a <em jstcache="0">background page</em>, as shown in the following figure. </p> <p class="comment" jstcache="0"> [PENDING: image goes here.] </p> <a name="H3-5" jstcache="0"></a><h3 id="background" jstcache="0">The background page</h3> <p jstcache="0"> Any non-trivial extension can (and probably should) have a background page. The background page is an invisible page where you put the main logic of the extension. The extension's other pages should have only the code that's necessary to show the state of the extension and to get input from the user.</p> <p jstcache="0"> An extension's background page exists before any of the extension's other pages exist. It continues to exist as long as the browser is running and the extension is installed, even if other pages and windows go away. </p> <p jstcache="0"> Your extension's UI — its toolstrips, page actions, and so on — should be dumb views. When the view needs some state, it should request it from the background page. When the background page notices some state change, it should update all the views. </p> <p jstcache="0"> For more information, see <a href="background_pages.html" jstcache="0">Background Pages</a>. </p> <a name="H3-6" jstcache="0"></a><h3 id="contentScripts" jstcache="0">Content scripts</h3> <p jstcache="0"> If you want your extension to interact with web pages, you need a content script. Content scripts are JavaScript files that run in the context of web pages. By using the standard Document Object Model (DOM), they can read details of the web pages the browser visits, and they can make changes to the pages. </p> <p class="comment" jstcache="0"> [PENDING: add an architectural figure here, showing the extension's pages, a web page, and the content script interacting with the web page. explain the figure.] </p> <p jstcache="0"> For more information, see <a href="content_scripts.html" jstcache="0">Content Scripts</a>. </p> <a name="H2-7" jstcache="0"></a><h2 jstcache="0">Communication </h2> <p jstcache="0"> Two kinds of communication happen within an extension: </p> <ul jstcache="0"> <li jstcache="0"> Communication <b jstcache="0">between pages</b> in the extension. <br jstcache="0"> For example, sometimes the background page needs to update all the UI pages to reflect a change in the extension's state. </li> <li jstcache="0"> Communication <b jstcache="0">between content scripts and the extension</b>. <br jstcache="0"> For example, <span class="comment" jstcache="0">[PENDING: example goes here]</span>. See <a href="content_scripts.html" jstcache="0">Content Scripts</a> for information about this type of communication. </li> </ul> <p jstcache="0"> Here are some keys to communication between an extension's pages: </p> <ul jstcache="0"> <li jstcache="0"> All the extension's pages execute in same process, on the same thread. </li> <li jstcache="0"> Extension pages can use <a href="extension.html" jstcache="0"><code jstcache="0">chrome.extension</code></a> methods such as <code jstcache="0">getViews()</code>, <code jstcache="0">getBackgroundPage()</code>, and <code jstcache="0">getToolstrips()</code> to get access to the extension's pages. </li> <li jstcache="0"> Once you have references to an extension's pages, you can manipulate the DOM for each page. </li> <li jstcache="0"> You can also make direct function calls to the pages, as shown in the following example. </li> </ul> <p jstcache="0"> Here's an example of communication between toolstrips and the background page. </p> <pre jstcache="0">//In background_page.html: function updateUI(checked) { var toolstrips = chrome.extension.getToolstrips(); for (var i in toolstrips) { if (toolstrips[i].enableCheckbox) toolstrips[i].enableCheckbox(checked); } } //In toolstrip.html: function enableCheckbox(checked) { var cb = document.getElementById('checkbox'); cb.checked = checked; } </pre> <p jstcache="0"> A good summary of communication mechanisms is at <a href="http://www.chromeplugins.org/google/plugins-development/communication-7883.html" jstcache="0">http://www.chromeplugins.org/google/plugins-development/communication-7883.html</a>. </p> <a name="H2-8" jstcache="0"></a><h2 jstcache="0"> Summary </h2> <p jstcache="0"> [ PENDING: wrap it up. suggest where to go next. Probably: <a href="getstarted.html" jstcache="0">Getting Started</a>, <a href="tut_debugging.html" jstcache="0">Debugging</a>, <a href="devguide.html" jstcache="0">Developer's Guide</a>. ] </p> </div> <!-- API PAGE --> <div class="apiPage" jsselect="apiDefinition" jstcache="3" style="display: none; "> <a name="apiReference" jstcache="0"></a> <h2 jscontent="'API reference: ' + getModuleName()" jstcache="4">API reference: chrome.apiname </h2> <!-- PROPERTIES --> <div jsdisplay="$this.properties" class="apiGroup" jstcache="5"> <a name="properties" jstcache="0"></a> <h3 id="properties" jstcache="0">Properties</h3> <div jsselect="getPropertyListFromObject($this)" jstcache="10"> <a jsvalues=".name:'property-' + name" jstcache="15"></a> <h4 jscontent="name" jstcache="16">getLastError</h4> <div class="summary" jstcache="0"> <!-- Note: intentionally longer 80 columns --> <span jscontent="getModuleName() + '.'" jstcache="23">chrome.extension</span><span jscontent="$this.name" jstcache="24">lastError</span> </div> <div transclude="valueTemplate" jstcache="17"> </div> </div> </div> <!-- /apiGroup --> <!-- METHODS --> <div jsdisplay="functions &amp;&amp; functions.length &gt; 0" class="apiGroup" id="methods" jstcache="6"> <a name="methods" jstcache="0"></a> <h3 jstcache="0">Methods</h3> <!-- iterates over all functions --> <div class="apiItem" jsselect="functions" jstcache="11"> <a jsvalues=".name:'method-' + name" jstcache="18"></a> <!-- method-anchor --> <h4 jscontent="name" jstcache="16">method name</h4> <div class="summary" jstcache="0"><span jsdisplay="returns" jscontent="getTypeName(returns)" jstcache="25">void</span> <!-- Note: intentionally longer 80 columns --> <span jscontent="getFullyQualifiedFunctionName($this)" jstcache="26">chrome.module.methodName</span>(<span jsselect="parameters" jsvalues="class:optional ? 'optional' : ''" jstcache="27"><span jsdisplay="$index" jstcache="33">, </span><span jscontent="getTypeName($this)" jstcache="34"></span> <var jstcache="0"><span jscontent="name" jstcache="16"></span></var></span>)</div> <div class="description" jstcache="0"> <p class="todo" jsdisplay="!description" jstcache="28">Undocumented.</p> <p jsdisplay="description" jsvalues=".innerHTML:description" jstcache="29"> A description from the json schema def of the function goes here. </p> <!-- PARAMETERS --> <h4 jstcache="0">Parameters</h4> <dl jstcache="0"> <div jsselect="parameters" jstcache="35"> <!-- VALUE: This is a subtemplate that is used elsewhere via jsTemplate *transclude* --> <div id="valueTemplate" jstcache="0"> <dt jstcache="0"> <var jsdisplay="$this.name" jscontent="$this.name" jstcache="45">paramName</var> <em jstcache="0"> <!-- TYPE --> <div style="display:inline" jstcache="0"> ( <span class="optional" jsdisplay="optional" jstcache="46">optional</span> <span id="typeTemplate" jstcache="0"> <span jsdisplay="getTypeRef($this)" jstcache="47"> <a jsvalues=".href: getTypeRefPage($this) + '#type-' + getTypeRef($this)" jscontent="getTypeRef($this)" jstcache="49"> Type</a> </span> <span jsdisplay="!getTypeRef($this)" jstcache="48"> <span jsdisplay="isArray($this)" jstcache="50"> array of <span jsselect="items" jstcache="52"><span transclude="typeTemplate" jstcache="53"></span></span> </span> <span jsdisplay="!isArray($this)" jscontent="getTypeName($this)" jstcache="51">paramType</span> </span> </span> ) </div> </em> </dt> <dd class="todo" jsdisplay="!$this.description" jstcache="38"> Undocumented. </dd> <dd jsdisplay="$this.description" jsvalues=".innerHTML:$this.description" jstcache="39"> Description of this parameter from the json schema. </dd> <!-- OBJECT PROPERTIES --> <dd jsdisplay="shouldExpandObject($this)" jstcache="40"> <dl jstcache="0"> <div jsselect="getPropertyListFromObject($this)" jstcache="10"> <div transclude="valueTemplate" jstcache="17"> </div> </div> </dl> </dd> </div> <!-- /VALUE --> </div> </dl> <!-- RETURNS --> <h4 jsdisplay="returns" jstcache="30">Returns</h4> <dl jstcache="0"> <div jsselect="returns" jstcache="36"> <div transclude="valueTemplate" jstcache="17"> </div> </div> </dl> <!-- CALLBACK -->	 <div jsdisplay="hasCallback(parameters)" jstcache="31"> <div jsselect="getCallbackParameters(parameters)" jstcache="37"> <h4 jstcache="0">Callback function</h4> <p jstcache="0"> If you specify the <em jstcache="0">callback</em> parameter, it should specify a function that looks like this: </p> <!-- Note: intentionally longer 80 columns --> <pre jstcache="0">function(<span jscontent="getSignatureString(parameters)" jstcache="32">Type param1, Type param2</span>) <span class="subdued" jstcache="0">{...}</span>);</pre> <dl jstcache="0"> <div jsselect="parameters" jstcache="35"> <div transclude="valueTemplate" jstcache="17"> </div> </div> </dl> </div> </div> </div> <!-- /description --> </div> <!-- /apiItem --> </div> <!-- /apiGroup --> <!-- EVENTS --> <div jsdisplay="events &amp;&amp; events.length &gt; 0" class="apiGroup" jstcache="7"> <a name="events" jstcache="0"></a> <h3 id="events" jstcache="0">Events</h3> <!-- iterates over all events --> <div jsselect="events" class="apiItem" jstcache="12"> <a jsvalues=".name:'event-' + name" jstcache="19"></a> <h4 jscontent="name" jstcache="16">event name</h4> <div class="summary" jstcache="0"> <!-- Note: intentionally longer 80 columns --> <span jscontent="getModuleName() + '.'" class="subdued" jstcache="23">chrome.bookmarks</span><span jscontent="name" jstcache="16">onEvent</span><span class="subdued" jstcache="0">.addListener</span>(function(<span jscontent="getSignatureString(parameters)" jstcache="32">Type param1, Type param2</span>) <span class="subdued" jstcache="0">{...}</span>); </div> <div class="description" jstcache="0"> <p class="todo" jsdisplay="!description" jstcache="28">Undocumented.</p> <p jsdisplay="description" jsvalues=".innerHTML:description" jstcache="29"> A description from the json schema def of the event goes here. </p> <!-- PARAMETERS --> <h4 jstcache="0">Parameters</h4> <dl jstcache="0"> <div jsselect="parameters" jstcache="35"> <div transclude="valueTemplate" jstcache="17"> </div> </div> </dl> </div> <!-- /decription --> </div> <!-- /apiItem --> </div> <!-- /apiGroup --> <!-- TYPES --> <div jsdisplay="types &amp;&amp; types.length &gt; 0" class="apiGroup" jstcache="8"> <a name="types" jstcache="0"></a> <h3 id="types" jstcache="0">Types</h3> <!-- iterates over all types --> <div jsselect="types" class="apiItem" jstcache="13"> <a jsvalues=".name:'type-' + id" jstcache="20"></a> <h4 jscontent="id" jstcache="21">type name</h4> <div transclude="valueTemplate" jstcache="17"> </div> </div> <!-- /apiItem --> </div> <!-- /apiGroup --> </div> <!-- /apiPage --> </div> <!-- /mainColumn --> </div> <!-- /pageContent --> <div id="pageFooter" --="" jstcache="0"> Copyright 2009. For terms of use, see the Chromium <a href="http://src.chromium.org/viewvc/chrome/trunk/src/LICENSE" jstcache="0">license</a>. </div> <!-- /pageFooter --> </div> <!-- /container --> </body></html>