| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc.
Note: | |
| 2 1) The <head> information in this page is significant, should be uniform | |
| 3 across api docs and should be edited only with knowledge of the | |
| 4 templating mechanism. | |
| 5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a | |
| 6 browser, it will be re-generated from the template, json schema and | |
| 7 authored overview content. | |
| 8 4) The <body>.innerHTML is also generated by an offline step so that this | |
| 9 page may easily be indexed by search engines. | |
| 10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> | |
| 11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
| 12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> | |
| 13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> | |
| 14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla
te_compiled.js"> | |
| 15 </script> | |
| 16 <script type="text/javascript" src="../../../../third_party/json_minify/mini
fy-sans-regexp.js"> | |
| 17 </script> | |
| 18 <script type="text/javascript" src="js/api_page_generator.js"></script> | |
| 19 <script type="text/javascript" src="js/bootstrap.js"></script> | |
| 20 <script type="text/javascript" src="js/sidebar.js"></script> | |
| 21 <meta name="description" content="Documentation for the chrome.browserAction m
odule, which is part of the Google Chrome extension APIs."><title>Browser Actio
ns - Google Chrome Extensions - Google Code</title></head> | |
| 22 <body> <div id="devModeWarning" class="displayModeWarning"> | |
| 23 You are viewing extension docs in chrome via the 'file:' scheme: are you exp
ecting to see local changes when you refresh? You'll need run chrome with --allo
w-file-access-from-files. | |
| 24 </div> | |
| 25 <div id="branchWarning" class="displayModeWarning"> | |
| 26 <span>WARNING: This is the <span id="branchName">BETA</span> documentation. | |
| 27 It may not work with the stable release of Chrome.</span> | |
| 28 <select id="branchChooser"> | |
| 29 <option>Choose a different version... | |
| 30 </option><option value="">Stable | |
| 31 </option><option value="beta">Beta | |
| 32 </option><option value="dev">Dev | |
| 33 </option><option value="trunk">Trunk | |
| 34 </option></select> | |
| 35 </div> | |
| 36 <div id="unofficialWarning" class="displayModeWarning"> | |
| 37 <span>WARNING: This is unofficial documentation. It may not work with the | |
| 38 current release of Chrome.</span> | |
| 39 <button id="goToOfficialDocs">Go to the official docs</button> | |
| 40 </div> | |
| 41 <div id="gc-container" class="labs"> | |
| 42 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> | |
| 43 <!-- In particular, sub-templates that recurse, must be used by allowing | |
| 44 jstemplate to make a copy of the template in this section which | |
| 45 are not operated on by way of the jsskip="true" --> | |
| 46 <!-- /SUBTEMPLATES --> | |
| 47 <a id="top"></a> | |
| 48 <div id="skipto"> | |
| 49 <a href="#gc-pagecontent">Skip to page content</a> | |
| 50 <a href="#gc-toc">Skip to main navigation</a> | |
| 51 </div> | |
| 52 <!-- API HEADER --> | |
| 53 <table id="header" width="100%" cellspacing="0" border="0"> | |
| 54 <tbody><tr> | |
| 55 <td valign="middle"><a href="http://code.google.com/"><img src="images/c
ode_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border:
0; margin:0;"></a></td> | |
| 56 <td valign="middle" width="100%" style="padding-left:0.6em;"> | |
| 57 <form action="http://www.google.com/cse" id="cse" style="margin-top:0.
5em"> | |
| 58 <div id="gsc-search-box"> | |
| 59 <input type="hidden" name="cx" value="002967670403910741006:61_cvz
fqtno"> | |
| 60 <input type="hidden" name="ie" value="UTF-8"> | |
| 61 <input type="text" name="q" value="" size="55"> | |
| 62 <input class="gsc-search-button" type="submit" name="sa" value="Se
arch"> | |
| 63 <br> | |
| 64 <span class="greytext">e.g. "page action" or "tabs"</span> | |
| 65 </div> | |
| 66 </form> | |
| 67 <script type="text/javascript" src="https://www.google.com/jsapi"></sc
ript> | |
| 68 <script type="text/javascript">google.load("elements", "1", {packages:
"transliteration"});</script> | |
| 69 <script type="text/javascript" src="https://www.google.com/coop/cse/t1
3n?form=cse&t13n_langs=en"></script> | |
| 70 <script type="text/javascript" src="https://www.google.com/coop/cse/br
and?form=cse&lang=en"></script> | |
| 71 </td> | |
| 72 </tr> | |
| 73 </tbody></table> | |
| 74 <div id="codesiteContent" class=""> | |
| 75 <a id="gc-topnav-anchor"></a> | |
| 76 <div id="gc-topnav"> | |
| 77 <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Lab
s</a>)</h1> | |
| 78 <ul id="home" class="gc-topnav-tabs"> | |
| 79 <li id="home_link"> | |
| 80 <a href="index.html" title="Google Chrome Extensions home page">Home
</a> | |
| 81 </li> | |
| 82 <li id="docs_link"> | |
| 83 <a href="docs.html" title="Official Google Chrome Extensions documen
tation">Docs</a> | |
| 84 </li> | |
| 85 <li id="faq_link"> | |
| 86 <a href="faq.html" title="Answers to frequently asked questions abou
t Google Chrome Extensions">FAQ</a> | |
| 87 </li> | |
| 88 <li id="samples_link"> | |
| 89 <a href="samples.html" title="Sample extensions (with source code)">
Samples</a> | |
| 90 </li> | |
| 91 <li id="group_link"> | |
| 92 <a href="http://groups.google.com/a/chromium.org/group/chromium-exte
nsions" title="Google Chrome Extensions developer forum">Group</a> | |
| 93 </li> | |
| 94 <li id="so_link"> | |
| 95 <a href="http://stackoverflow.com/questions/tagged/google-chrome-ext
ension" title="[google-chrome-extension] tag on Stack Overflow">Questions?</a> | |
| 96 </li> | |
| 97 </ul> | |
| 98 </div> <!-- end gc-topnav --> | |
| 99 <div class="g-section g-tpl-170"> | |
| 100 <!-- SIDENAV --> | |
| 101 <div class="g-unit g-first" id="gc-toc"> | |
| 102 <ul> | |
| 103 <li><a href="getstarted.html">Getting Started</a></li> | |
| 104 <li><a href="overview.html">Overview</a></li> | |
| 105 <li><a href="whats_new.html">What's New?</a></li> | |
| 106 <li><h2><a href="devguide.html">Developer's Guide</a></h2> | |
| 107 <ul> | |
| 108 <li>Browser UI | |
| 109 <ul> | |
| 110 <li class="leftNavSelected">Browser Actions</li> | |
| 111 <li><a href="contextMenus.html">Context Menus</a></li> | |
| 112 <li><a href="notifications.html">Desktop Notifications</a></li
> | |
| 113 <li><a href="omnibox.html">Omnibox</a></li> | |
| 114 <li><a href="options.html">Options Pages</a></li> | |
| 115 <li><a href="override.html">Override Pages</a></li> | |
| 116 <li><a href="pageAction.html">Page Actions</a></li> | |
| 117 </ul> | |
| 118 </li> | |
| 119 <li>Browser Interaction | |
| 120 <ul> | |
| 121 <li><a href="bookmarks.html">Bookmarks</a></li> | |
| 122 <li><a href="cookies.html">Cookies</a></li> | |
| 123 <li><a href="devtools.html">Developer Tools</a></li> | |
| 124 <li><a href="events.html">Events</a></li> | |
| 125 <li><a href="history.html">History</a></li> | |
| 126 <li><a href="management.html">Management</a></li> | |
| 127 <li><a href="tabs.html">Tabs</a></li> | |
| 128 <li><a href="windows.html">Windows</a></li> | |
| 129 </ul> | |
| 130 </li> | |
| 131 <li>Implementation | |
| 132 <ul> | |
| 133 <li><a href="a11y.html">Accessibility</a></li> | |
| 134 <li><a href="background_pages.html">Background Pages</a></li> | |
| 135 <li><a href="content_scripts.html">Content Scripts</a></li> | |
| 136 <li><a href="xhr.html">Cross-Origin XHR</a></li> | |
| 137 <li><a href="i18n.html">Internationalization</a></li> | |
| 138 <li><a href="messaging.html">Message Passing</a></li> | |
| 139 <li><a href="permissions.html">Optional Permissions</a></li> | |
| 140 <li><a href="npapi.html">NPAPI Plugins</a></li> | |
| 141 </ul> | |
| 142 </li> | |
| 143 <li>Finishing | |
| 144 <ul> | |
| 145 <li><a href="hosting.html">Hosting</a></li> | |
| 146 <li><a href="external_extensions.html">Other Deployment Option
s</a></li> | |
| 147 </ul> | |
| 148 </li> | |
| 149 </ul> | |
| 150 </li> | |
| 151 <li><h2><a href="apps.html">Packaged Apps</a></h2></li> | |
| 152 <li><h2><a href="tutorials.html">Tutorials</a></h2> | |
| 153 <ul> | |
| 154 <li><a href="tut_debugging.html">Debugging</a></li> | |
| 155 <li><a href="tut_analytics.html">Google Analytics</a></li> | |
| 156 <li><a href="tut_oauth.html">OAuth</a></li> | |
| 157 </ul> | |
| 158 </li> | |
| 159 <li><h2>Reference</h2> | |
| 160 <ul> | |
| 161 <li>Formats | |
| 162 <ul> | |
| 163 <li><a href="manifest.html">Manifest Files</a></li> | |
| 164 <li><a href="match_patterns.html">Match Patterns</a></li> | |
| 165 </ul> | |
| 166 </li> | |
| 167 <li><a href="permission_warnings.html">Permission Warnings</a></li
> | |
| 168 <li><a href="api_index.html">chrome.* APIs</a></li> | |
| 169 <li><a href="api_other.html">Other APIs</a></li> | |
| 170 </ul> | |
| 171 </li> | |
| 172 <li><h2><a href="samples.html">Samples</a></h2></li> | |
| 173 <div class="line"> </div> | |
| 174 <li><h2>More</h2> | |
| 175 <ul> | |
| 176 <li><a href="http://code.google.com/chrome/webstore/docs/index.htm
l">Chrome Web Store</a></li> | |
| 177 <li><a href="http://code.google.com/chrome/apps/docs/developers_gu
ide.html">Hosted Apps</a></li> | |
| 178 <li><a href="themes.html">Themes</a></li> | |
| 179 </ul> | |
| 180 </li> | |
| 181 </ul> | |
| 182 </div> | |
| 183 <script> | |
| 184 initToggles(); | |
| 185 </script> | |
| 186 <div class="g-unit" id="gc-pagecontent"> | |
| 187 <div id="pageTitle"> | |
| 188 <h1 class="page_title">Browser Actions</h1> | |
| 189 </div> | |
| 190 <!-- TABLE OF CONTENTS --> | |
| 191 <div id="toc"> | |
| 192 <h2>Contents</h2> | |
| 193 <ol> | |
| 194 <li> | |
| 195 <a href="#manifest">Manifest</a> | |
| 196 <ol> | |
| 197 </ol> | |
| 198 </li><li> | |
| 199 <a href="#ui">Parts of the UI</a> | |
| 200 <ol> | |
| 201 <li> | |
| 202 <a href="#icon">Icon</a> | |
| 203 </li><li> | |
| 204 <a href="#tooltip">Tooltip</a> | |
| 205 </li><li> | |
| 206 <a href="#badge">Badge</a> | |
| 207 </li><li> | |
| 208 <a href="#popups">Popup</a> | |
| 209 </li> | |
| 210 </ol> | |
| 211 </li><li> | |
| 212 <a href="#H2-6">Tips</a> | |
| 213 <ol> | |
| 214 </ol> | |
| 215 </li><li> | |
| 216 <a href="#examples"> Examples </a> | |
| 217 <ol> | |
| 218 </ol> | |
| 219 </li> | |
| 220 <li> | |
| 221 <a href="#apiReference">API reference: chrome.browserAction</a> | |
| 222 <ol> | |
| 223 <li> | |
| 224 <a href="#global-methods">Methods</a> | |
| 225 <ol> | |
| 226 <li> | |
| 227 <a href="#method-getBadgeBackgroundColor">getBadgeBackgroundColo
r</a> | |
| 228 </li><li> | |
| 229 <a href="#method-getBadgeText">getBadgeText</a> | |
| 230 </li><li> | |
| 231 <a href="#method-getPopup">getPopup</a> | |
| 232 </li><li> | |
| 233 <a href="#method-getTitle">getTitle</a> | |
| 234 </li><li> | |
| 235 <a href="#method-setBadgeBackgroundColor">setBadgeBackgroundColo
r</a> | |
| 236 </li><li> | |
| 237 <a href="#method-setBadgeText">setBadgeText</a> | |
| 238 </li><li> | |
| 239 <a href="#method-setIcon">setIcon</a> | |
| 240 </li><li> | |
| 241 <a href="#method-setPopup">setPopup</a> | |
| 242 </li><li> | |
| 243 <a href="#method-setTitle">setTitle</a> | |
| 244 </li> | |
| 245 </ol> | |
| 246 </li> | |
| 247 <li> | |
| 248 <a href="#global-events">Events</a> | |
| 249 <ol> | |
| 250 <li> | |
| 251 <a href="#event-onClicked">onClicked</a> | |
| 252 </li> | |
| 253 </ol> | |
| 254 </li> | |
| 255 <li> | |
| 256 <a href="#types">Types</a> | |
| 257 <ol> | |
| 258 <li> | |
| 259 <a href="#type-ColorArray">ColorArray</a> | |
| 260 <ol> | |
| 261 </ol> | |
| 262 </li> | |
| 263 </ol> | |
| 264 </li> | |
| 265 </ol> | |
| 266 </li> | |
| 267 </ol> | |
| 268 </div> | |
| 269 <!-- /TABLE OF CONTENTS --> | |
| 270 <!-- Standard content lead-in for experimental API pages --> | |
| 271 <!-- STATIC CONTENT PLACEHOLDER --> | |
| 272 <div id="static"><div id="pageData-name" class="pageData">Browser Action
s</div> | |
| 273 <!-- BEGIN AUTHORED CONTENT --> | |
| 274 <p>Use browser actions to put icons | |
| 275 in the main Google Chrome toolbar, | |
| 276 to the right of the address bar. | |
| 277 In addition to its <a href="#icon">icon</a>, | |
| 278 a browser action can also have | |
| 279 a <a href="#tooltip">tooltip</a>, | |
| 280 a <a href="#badge">badge</a>, | |
| 281 and a <a href="#popups">popup</a>. | |
| 282 </p> | |
| 283 <p> | |
| 284 In the following figure, | |
| 285 the multicolored square | |
| 286 to the right of the address bar | |
| 287 is the icon for a browser action. | |
| 288 A popup is below the icon. | |
| 289 </p> | |
| 290 <img src="images/browser-action.png" width="363" height="226"> | |
| 291 <p> | |
| 292 If you want to create an icon that isn't always visible, | |
| 293 use a <a href="pageAction.html">page action</a> | |
| 294 instead of a browser action. | |
| 295 </p> | |
| 296 <p class="caution"> | |
| 297 <strong>Note:</strong> | |
| 298 Packaged apps cannot use browser actions. | |
| 299 </p> | |
| 300 <!-- [PENDING: We should show tooltips and badges, as well.] --> | |
| 301 <h2 id="manifest">Manifest</h2> | |
| 302 <p> | |
| 303 Register your browser action in the | |
| 304 <a href="manifest.html">extension manifest</a> | |
| 305 like this: | |
| 306 </p> | |
| 307 <pre>{ | |
| 308 "name": "My extension", | |
| 309 ... | |
| 310 <b>"browser_action": { | |
| 311 "default_icon": "images/icon19.png", <em>// optional</em> | |
| 312 "default_title": "Google Mail", <em>// optional; shown in tooltip</em> | |
| 313 "default_popup": "popup.html" <em>// optional</em> | |
| 314 }</b>, | |
| 315 ... | |
| 316 }</pre> | |
| 317 <h2 id="ui">Parts of the UI</h2> | |
| 318 <p> | |
| 319 A browser action can have an <a href="#icon">icon</a>, | |
| 320 a <a href="#tooltip">tooltip</a>, | |
| 321 a <a href="#badge">badge</a>, | |
| 322 and a <a href="#popups">popup</a>. | |
| 323 </p> | |
| 324 <h3 id="icon">Icon</h3> | |
| 325 <p>Browser action icons can be up to 19 pixels wide and high. | |
| 326 Larger icons are resized to fit, but for best results, | |
| 327 use a 19-pixel square icon.</p> | |
| 328 <p>You can set the icon in two ways: | |
| 329 using a static image or using the | |
| 330 HTML5 <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the
-canvas-element.html">canvas element</a>. | |
| 331 Using static images is easier for simple applications, | |
| 332 but you can create more dynamic UIs — | |
| 333 such as smooth animation — | |
| 334 using the canvas element. | |
| 335 </p> | |
| 336 <p>Static images can be in any format WebKit can display, | |
| 337 including BMP, GIF, ICO, JPEG, or PNG. | |
| 338 </p> | |
| 339 <p>To set the icon, | |
| 340 use the <b>default_icon</b> field of <b>browser_action</b> | |
| 341 in the <a href="#manifest">manifest</a>, | |
| 342 or call the <a href="#method-setIcon">setIcon()</a> method. | |
| 343 </p><h3 id="tooltip">Tooltip</h3> | |
| 344 <p> | |
| 345 To set the tooltip, | |
| 346 use the <b>default_title</b> field of <b>browser_action</b> | |
| 347 in the <a href="#manifest">manifest</a>, | |
| 348 or call the <a href="#method-setTitle">setTitle()</a> method. | |
| 349 You can specify locale-specific strings for the <b>default_title</b> field; | |
| 350 see <a href="i18n.html">Internationalization</a> for details. | |
| 351 </p> | |
| 352 <h3 id="badge">Badge</h3> | |
| 353 <p>Browser actions can optionally display a <em>badge</em> — | |
| 354 a bit of text that is layered over the icon. | |
| 355 Badges make it easy to update the browser action | |
| 356 to display a small amount of information | |
| 357 about the state of the extension.</p> | |
| 358 <p>Because the badge has limited space, | |
| 359 it should have 4 characters or less. | |
| 360 </p> | |
| 361 <p> | |
| 362 Set the text and color of the badge using | |
| 363 <a href="#method-setBadgeText">setBadgeText()</a> and | |
| 364 <a href="#method-setBadgeBackgroundColor">setBadgeBackgroundColor()</a>, | |
| 365 respectively. | |
| 366 <!-- [PENDING: if you have a color but no text, will anything display?] --> | |
| 367 </p> | |
| 368 <h3 id="popups">Popup</h3> | |
| 369 <p>If a browser action has a popup, | |
| 370 the popup appears when the user clicks the icon. | |
| 371 The popup can contain any HTML contents that you like, | |
| 372 and it's automatically sized to fit its contents. | |
| 373 </p> | |
| 374 <p> | |
| 375 To add a popup to your browser action, | |
| 376 create an HTML file with the popup's contents. | |
| 377 Specify the HTML file in the <b>default_popup</b> field of <b>browser_action</b> | |
| 378 in the <a href="#manifest">manifest</a>, or call the | |
| 379 <a href="#method-setPopup">setPopup()</a> method. | |
| 380 </p> | |
| 381 <a name="H2-6"></a><h2>Tips</h2> | |
| 382 <p>For the best visual impact, | |
| 383 follow these guidelines:</p> | |
| 384 <ul> | |
| 385 <li><b>Do</b> use browser actions for features | |
| 386 that make sense on most pages. | |
| 387 </li><li><b>Don't</b> use browser actions for features | |
| 388 that make sense for only a few pages. | |
| 389 Use <a href="pageAction.html">page actions</a> instead. | |
| 390 </li><li><b>Do</b> use big, colorful icons that make the most of | |
| 391 the 19x19-pixel space. | |
| 392 Browser action icons should seem a little bigger | |
| 393 and heavier than page action icons. | |
| 394 </li><li><b>Don't</b> attempt to mimic | |
| 395 Google Chrome's monochrome "wrench" icon. | |
| 396 That doesn't work well with themes, and anyway, | |
| 397 extensions should stand out a little. | |
| 398 </li><li><b>Do</b> use alpha transparency | |
| 399 to add soft edges to your icon. | |
| 400 Because many people use themes, | |
| 401 your icon should look nice | |
| 402 on a variety of background colors. | |
| 403 </li><li><b>Don't</b> constantly animate your icon. | |
| 404 That's just annoying. | |
| 405 </li></ul> | |
| 406 <h2 id="examples"> Examples </h2> | |
| 407 <p> | |
| 408 You can find simple examples of using browser actions in the | |
| 409 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension
s/docs/examples/api/browserAction/">examples/api/browserAction</a> | |
| 410 directory. | |
| 411 For other examples and for help in viewing the source code, see | |
| 412 <a href="samples.html">Samples</a>. | |
| 413 </p> | |
| 414 <!-- END AUTHORED CONTENT --> | |
| 415 </div> | |
| 416 <!-- API PAGE --> | |
| 417 <div class="apiPage"> | |
| 418 <a name="apiReference"></a> | |
| 419 <h2>API reference: chrome.browserAction</h2> | |
| 420 <!-- PROPERTIES --> | |
| 421 <!-- /apiGroup --> | |
| 422 <!-- METHODS --> | |
| 423 <div id="methodsTemplate" class="apiGroup"> | |
| 424 <a name="global-methods"></a> | |
| 425 <h3>Methods</h3> | |
| 426 <!-- iterates over all functions --> | |
| 427 <div class="apiItem"> | |
| 428 <a name="method-getBadgeBackgroundColor"></a> <!-- method-anchor -
-> | |
| 429 <h4>getBadgeBackgroundColor</h4> | |
| 430 <div class="summary"> | |
| 431 <!-- Note: intentionally longer 80 columns --> | |
| 432 <span>chrome.browserAction.getBadgeBackgroundColor</span>(<spa
n class="null"><span>object</span> | |
| 433 <var><span>details</span></var></span><span class="null"><
span>, </span><span>function</span> | |
| 434 <var><span>callback</span></var></span>)</div> | |
| 435 <div class="description"> | |
| 436 <p>Gets the background color of the browser action.</p> | |
| 437 <!-- PARAMETERS --> | |
| 438 <h4>Parameters</h4> | |
| 439 <dl> | |
| 440 <div> | |
| 441 <div> | |
| 442 <dt> | |
| 443 <var>details</var> | |
| 444 <em> | |
| 445 <!-- TYPE --> | |
| 446 <div style="display:inline"> | |
| 447 ( | |
| 448 <span id="typeTemplate"> | |
| 449 <span> | |
| 450 <span>object</span> | |
| 451 </span> | |
| 452 </span> | |
| 453 ) | |
| 454 </div> | |
| 455 </em> | |
| 456 </dt> | |
| 457 <dd class="todo"> | |
| 458 Undocumented. | |
| 459 </dd> | |
| 460 <!-- OBJECT PROPERTIES --> | |
| 461 <dd> | |
| 462 <dl> | |
| 463 <div> | |
| 464 <div> | |
| 465 <dt> | |
| 466 <var>tabId</var> | |
| 467 <em> | |
| 468 <!-- TYPE --> | |
| 469 <div style="display:inline"> | |
| 470 ( | |
| 471 <span class="optional">optional</span> | |
| 472 <span id="typeTemplate"> | |
| 473 <span> | |
| 474 <span>integer</span> | |
| 475 </span> | |
| 476 </span> | |
| 477 ) | |
| 478 </div> | |
| 479 </em> | |
| 480 </dt> | |
| 481 <dd>Specify the tab to get the badge background color from. If no tab
is specified, the non-tab-specific badge background color is returned.</dd> | |
| 482 <!-- OBJECT PROPERTIES --> | |
| 483 <!-- OBJECT METHODS --> | |
| 484 <!-- OBJECT EVENT FIELDS --> | |
| 485 <!-- FUNCTION PARAMETERS --> | |
| 486 </div> | |
| 487 </div> | |
| 488 </dl> | |
| 489 </dd> | |
| 490 <!-- OBJECT METHODS --> | |
| 491 <!-- OBJECT EVENT FIELDS --> | |
| 492 <!-- FUNCTION PARAMETERS --> | |
| 493 </div> | |
| 494 </div><div> | |
| 495 <div> | |
| 496 <dt> | |
| 497 <var>callback</var> | |
| 498 <em> | |
| 499 <!-- TYPE --> | |
| 500 <div style="display:inline"> | |
| 501 ( | |
| 502 <span id="typeTemplate"> | |
| 503 <span> | |
| 504 <span>function</span> | |
| 505 </span> | |
| 506 </span> | |
| 507 ) | |
| 508 </div> | |
| 509 </em> | |
| 510 </dt> | |
| 511 <dd class="todo"> | |
| 512 Undocumented. | |
| 513 </dd> | |
| 514 <!-- OBJECT PROPERTIES --> | |
| 515 <!-- OBJECT METHODS --> | |
| 516 <!-- OBJECT EVENT FIELDS --> | |
| 517 <!-- FUNCTION PARAMETERS --> | |
| 518 </div> | |
| 519 </div> | |
| 520 </dl> | |
| 521 <!-- RETURNS --> | |
| 522 <dl> | |
| 523 </dl> | |
| 524 <!-- CALLBACK --> | |
| 525 <div> | |
| 526 <div> | |
| 527 <h4>Callback function</h4> | |
| 528 <p> | |
| 529 The <em>callback</em> parameter should specify a function | |
| 530 that looks like this: | |
| 531 </p> | |
| 532 <!-- Note: intentionally longer 80 columns --> | |
| 533 <pre>function(<span>ColorArray result</span>) <span class="sub
dued">{...}</span>;</pre> | |
| 534 <dl> | |
| 535 <div> | |
| 536 <div> | |
| 537 <dt> | |
| 538 <var>result</var> | |
| 539 <em> | |
| 540 <!-- TYPE --> | |
| 541 <div style="display:inline"> | |
| 542 ( | |
| 543 <span id="typeTemplate"> | |
| 544 <span> | |
| 545 <a href="browserAction.html#type-ColorArray">ColorArray<
/a> | |
| 546 </span> | |
| 547 </span> | |
| 548 ) | |
| 549 </div> | |
| 550 </em> | |
| 551 </dt> | |
| 552 <dd class="todo"> | |
| 553 Undocumented. | |
| 554 </dd> | |
| 555 <!-- OBJECT PROPERTIES --> | |
| 556 <!-- OBJECT METHODS --> | |
| 557 <!-- OBJECT EVENT FIELDS --> | |
| 558 <!-- FUNCTION PARAMETERS --> | |
| 559 </div> | |
| 560 </div> | |
| 561 </dl> | |
| 562 </div> | |
| 563 </div> | |
| 564 <!-- MIN_VERSION --> | |
| 565 </div> <!-- /description --> | |
| 566 </div><div class="apiItem"> | |
| 567 <a name="method-getBadgeText"></a> <!-- method-anchor --> | |
| 568 <h4>getBadgeText</h4> | |
| 569 <div class="summary"> | |
| 570 <!-- Note: intentionally longer 80 columns --> | |
| 571 <span>chrome.browserAction.getBadgeText</span>(<span class="nu
ll"><span>object</span> | |
| 572 <var><span>details</span></var></span><span class="null"><
span>, </span><span>function</span> | |
| 573 <var><span>callback</span></var></span>)</div> | |
| 574 <div class="description"> | |
| 575 <p>Gets the badge text of the browser action. If no tab is speci
fied, the non-tab-specific badge text is returned.</p> | |
| 576 <!-- PARAMETERS --> | |
| 577 <h4>Parameters</h4> | |
| 578 <dl> | |
| 579 <div> | |
| 580 <div> | |
| 581 <dt> | |
| 582 <var>details</var> | |
| 583 <em> | |
| 584 <!-- TYPE --> | |
| 585 <div style="display:inline"> | |
| 586 ( | |
| 587 <span id="typeTemplate"> | |
| 588 <span> | |
| 589 <span>object</span> | |
| 590 </span> | |
| 591 </span> | |
| 592 ) | |
| 593 </div> | |
| 594 </em> | |
| 595 </dt> | |
| 596 <dd class="todo"> | |
| 597 Undocumented. | |
| 598 </dd> | |
| 599 <!-- OBJECT PROPERTIES --> | |
| 600 <dd> | |
| 601 <dl> | |
| 602 <div> | |
| 603 <div> | |
| 604 <dt> | |
| 605 <var>tabId</var> | |
| 606 <em> | |
| 607 <!-- TYPE --> | |
| 608 <div style="display:inline"> | |
| 609 ( | |
| 610 <span class="optional">optional</span> | |
| 611 <span id="typeTemplate"> | |
| 612 <span> | |
| 613 <span>integer</span> | |
| 614 </span> | |
| 615 </span> | |
| 616 ) | |
| 617 </div> | |
| 618 </em> | |
| 619 </dt> | |
| 620 <dd>Specify the tab to get the badge text from. If no tab is specified
, the non-tab-specific badge text is returned.</dd> | |
| 621 <!-- OBJECT PROPERTIES --> | |
| 622 <!-- OBJECT METHODS --> | |
| 623 <!-- OBJECT EVENT FIELDS --> | |
| 624 <!-- FUNCTION PARAMETERS --> | |
| 625 </div> | |
| 626 </div> | |
| 627 </dl> | |
| 628 </dd> | |
| 629 <!-- OBJECT METHODS --> | |
| 630 <!-- OBJECT EVENT FIELDS --> | |
| 631 <!-- FUNCTION PARAMETERS --> | |
| 632 </div> | |
| 633 </div><div> | |
| 634 <div> | |
| 635 <dt> | |
| 636 <var>callback</var> | |
| 637 <em> | |
| 638 <!-- TYPE --> | |
| 639 <div style="display:inline"> | |
| 640 ( | |
| 641 <span id="typeTemplate"> | |
| 642 <span> | |
| 643 <span>function</span> | |
| 644 </span> | |
| 645 </span> | |
| 646 ) | |
| 647 </div> | |
| 648 </em> | |
| 649 </dt> | |
| 650 <dd class="todo"> | |
| 651 Undocumented. | |
| 652 </dd> | |
| 653 <!-- OBJECT PROPERTIES --> | |
| 654 <!-- OBJECT METHODS --> | |
| 655 <!-- OBJECT EVENT FIELDS --> | |
| 656 <!-- FUNCTION PARAMETERS --> | |
| 657 </div> | |
| 658 </div> | |
| 659 </dl> | |
| 660 <!-- RETURNS --> | |
| 661 <dl> | |
| 662 </dl> | |
| 663 <!-- CALLBACK --> | |
| 664 <div> | |
| 665 <div> | |
| 666 <h4>Callback function</h4> | |
| 667 <p> | |
| 668 The <em>callback</em> parameter should specify a function | |
| 669 that looks like this: | |
| 670 </p> | |
| 671 <!-- Note: intentionally longer 80 columns --> | |
| 672 <pre>function(<span>string result</span>) <span class="subdued
">{...}</span>;</pre> | |
| 673 <dl> | |
| 674 <div> | |
| 675 <div> | |
| 676 <dt> | |
| 677 <var>result</var> | |
| 678 <em> | |
| 679 <!-- TYPE --> | |
| 680 <div style="display:inline"> | |
| 681 ( | |
| 682 <span id="typeTemplate"> | |
| 683 <span> | |
| 684 <span>string</span> | |
| 685 </span> | |
| 686 </span> | |
| 687 ) | |
| 688 </div> | |
| 689 </em> | |
| 690 </dt> | |
| 691 <dd class="todo"> | |
| 692 Undocumented. | |
| 693 </dd> | |
| 694 <!-- OBJECT PROPERTIES --> | |
| 695 <!-- OBJECT METHODS --> | |
| 696 <!-- OBJECT EVENT FIELDS --> | |
| 697 <!-- FUNCTION PARAMETERS --> | |
| 698 </div> | |
| 699 </div> | |
| 700 </dl> | |
| 701 </div> | |
| 702 </div> | |
| 703 <!-- MIN_VERSION --> | |
| 704 </div> <!-- /description --> | |
| 705 </div><div class="apiItem"> | |
| 706 <a name="method-getPopup"></a> <!-- method-anchor --> | |
| 707 <h4>getPopup</h4> | |
| 708 <div class="summary"> | |
| 709 <!-- Note: intentionally longer 80 columns --> | |
| 710 <span>chrome.browserAction.getPopup</span>(<span class="null">
<span>object</span> | |
| 711 <var><span>details</span></var></span><span class="null"><
span>, </span><span>function</span> | |
| 712 <var><span>callback</span></var></span>)</div> | |
| 713 <div class="description"> | |
| 714 <p>Gets the html document set as the popup for this browser acti
on.</p> | |
| 715 <!-- PARAMETERS --> | |
| 716 <h4>Parameters</h4> | |
| 717 <dl> | |
| 718 <div> | |
| 719 <div> | |
| 720 <dt> | |
| 721 <var>details</var> | |
| 722 <em> | |
| 723 <!-- TYPE --> | |
| 724 <div style="display:inline"> | |
| 725 ( | |
| 726 <span id="typeTemplate"> | |
| 727 <span> | |
| 728 <span>object</span> | |
| 729 </span> | |
| 730 </span> | |
| 731 ) | |
| 732 </div> | |
| 733 </em> | |
| 734 </dt> | |
| 735 <dd class="todo"> | |
| 736 Undocumented. | |
| 737 </dd> | |
| 738 <!-- OBJECT PROPERTIES --> | |
| 739 <dd> | |
| 740 <dl> | |
| 741 <div> | |
| 742 <div> | |
| 743 <dt> | |
| 744 <var>tabId</var> | |
| 745 <em> | |
| 746 <!-- TYPE --> | |
| 747 <div style="display:inline"> | |
| 748 ( | |
| 749 <span class="optional">optional</span> | |
| 750 <span id="typeTemplate"> | |
| 751 <span> | |
| 752 <span>integer</span> | |
| 753 </span> | |
| 754 </span> | |
| 755 ) | |
| 756 </div> | |
| 757 </em> | |
| 758 </dt> | |
| 759 <dd>Specify the tab to get the popup from. If no tab is specified, the
non-tab-specific popup is returned.</dd> | |
| 760 <!-- OBJECT PROPERTIES --> | |
| 761 <!-- OBJECT METHODS --> | |
| 762 <!-- OBJECT EVENT FIELDS --> | |
| 763 <!-- FUNCTION PARAMETERS --> | |
| 764 </div> | |
| 765 </div> | |
| 766 </dl> | |
| 767 </dd> | |
| 768 <!-- OBJECT METHODS --> | |
| 769 <!-- OBJECT EVENT FIELDS --> | |
| 770 <!-- FUNCTION PARAMETERS --> | |
| 771 </div> | |
| 772 </div><div> | |
| 773 <div> | |
| 774 <dt> | |
| 775 <var>callback</var> | |
| 776 <em> | |
| 777 <!-- TYPE --> | |
| 778 <div style="display:inline"> | |
| 779 ( | |
| 780 <span id="typeTemplate"> | |
| 781 <span> | |
| 782 <span>function</span> | |
| 783 </span> | |
| 784 </span> | |
| 785 ) | |
| 786 </div> | |
| 787 </em> | |
| 788 </dt> | |
| 789 <dd class="todo"> | |
| 790 Undocumented. | |
| 791 </dd> | |
| 792 <!-- OBJECT PROPERTIES --> | |
| 793 <!-- OBJECT METHODS --> | |
| 794 <!-- OBJECT EVENT FIELDS --> | |
| 795 <!-- FUNCTION PARAMETERS --> | |
| 796 </div> | |
| 797 </div> | |
| 798 </dl> | |
| 799 <!-- RETURNS --> | |
| 800 <dl> | |
| 801 </dl> | |
| 802 <!-- CALLBACK --> | |
| 803 <div> | |
| 804 <div> | |
| 805 <h4>Callback function</h4> | |
| 806 <p> | |
| 807 The <em>callback</em> parameter should specify a function | |
| 808 that looks like this: | |
| 809 </p> | |
| 810 <!-- Note: intentionally longer 80 columns --> | |
| 811 <pre>function(<span>string result</span>) <span class="subdued
">{...}</span>;</pre> | |
| 812 <dl> | |
| 813 <div> | |
| 814 <div> | |
| 815 <dt> | |
| 816 <var>result</var> | |
| 817 <em> | |
| 818 <!-- TYPE --> | |
| 819 <div style="display:inline"> | |
| 820 ( | |
| 821 <span id="typeTemplate"> | |
| 822 <span> | |
| 823 <span>string</span> | |
| 824 </span> | |
| 825 </span> | |
| 826 ) | |
| 827 </div> | |
| 828 </em> | |
| 829 </dt> | |
| 830 <dd class="todo"> | |
| 831 Undocumented. | |
| 832 </dd> | |
| 833 <!-- OBJECT PROPERTIES --> | |
| 834 <!-- OBJECT METHODS --> | |
| 835 <!-- OBJECT EVENT FIELDS --> | |
| 836 <!-- FUNCTION PARAMETERS --> | |
| 837 </div> | |
| 838 </div> | |
| 839 </dl> | |
| 840 </div> | |
| 841 </div> | |
| 842 <!-- MIN_VERSION --> | |
| 843 </div> <!-- /description --> | |
| 844 </div><div class="apiItem"> | |
| 845 <a name="method-getTitle"></a> <!-- method-anchor --> | |
| 846 <h4>getTitle</h4> | |
| 847 <div class="summary"> | |
| 848 <!-- Note: intentionally longer 80 columns --> | |
| 849 <span>chrome.browserAction.getTitle</span>(<span class="null">
<span>object</span> | |
| 850 <var><span>details</span></var></span><span class="null"><
span>, </span><span>function</span> | |
| 851 <var><span>callback</span></var></span>)</div> | |
| 852 <div class="description"> | |
| 853 <p>Gets the title of the browser action.</p> | |
| 854 <!-- PARAMETERS --> | |
| 855 <h4>Parameters</h4> | |
| 856 <dl> | |
| 857 <div> | |
| 858 <div> | |
| 859 <dt> | |
| 860 <var>details</var> | |
| 861 <em> | |
| 862 <!-- TYPE --> | |
| 863 <div style="display:inline"> | |
| 864 ( | |
| 865 <span id="typeTemplate"> | |
| 866 <span> | |
| 867 <span>object</span> | |
| 868 </span> | |
| 869 </span> | |
| 870 ) | |
| 871 </div> | |
| 872 </em> | |
| 873 </dt> | |
| 874 <dd class="todo"> | |
| 875 Undocumented. | |
| 876 </dd> | |
| 877 <!-- OBJECT PROPERTIES --> | |
| 878 <dd> | |
| 879 <dl> | |
| 880 <div> | |
| 881 <div> | |
| 882 <dt> | |
| 883 <var>tabId</var> | |
| 884 <em> | |
| 885 <!-- TYPE --> | |
| 886 <div style="display:inline"> | |
| 887 ( | |
| 888 <span class="optional">optional</span> | |
| 889 <span id="typeTemplate"> | |
| 890 <span> | |
| 891 <span>integer</span> | |
| 892 </span> | |
| 893 </span> | |
| 894 ) | |
| 895 </div> | |
| 896 </em> | |
| 897 </dt> | |
| 898 <dd>Specify the tab to get the title from. If no tab is specified, the
non-tab-specific title is returned.</dd> | |
| 899 <!-- OBJECT PROPERTIES --> | |
| 900 <!-- OBJECT METHODS --> | |
| 901 <!-- OBJECT EVENT FIELDS --> | |
| 902 <!-- FUNCTION PARAMETERS --> | |
| 903 </div> | |
| 904 </div> | |
| 905 </dl> | |
| 906 </dd> | |
| 907 <!-- OBJECT METHODS --> | |
| 908 <!-- OBJECT EVENT FIELDS --> | |
| 909 <!-- FUNCTION PARAMETERS --> | |
| 910 </div> | |
| 911 </div><div> | |
| 912 <div> | |
| 913 <dt> | |
| 914 <var>callback</var> | |
| 915 <em> | |
| 916 <!-- TYPE --> | |
| 917 <div style="display:inline"> | |
| 918 ( | |
| 919 <span id="typeTemplate"> | |
| 920 <span> | |
| 921 <span>function</span> | |
| 922 </span> | |
| 923 </span> | |
| 924 ) | |
| 925 </div> | |
| 926 </em> | |
| 927 </dt> | |
| 928 <dd class="todo"> | |
| 929 Undocumented. | |
| 930 </dd> | |
| 931 <!-- OBJECT PROPERTIES --> | |
| 932 <!-- OBJECT METHODS --> | |
| 933 <!-- OBJECT EVENT FIELDS --> | |
| 934 <!-- FUNCTION PARAMETERS --> | |
| 935 </div> | |
| 936 </div> | |
| 937 </dl> | |
| 938 <!-- RETURNS --> | |
| 939 <dl> | |
| 940 </dl> | |
| 941 <!-- CALLBACK --> | |
| 942 <div> | |
| 943 <div> | |
| 944 <h4>Callback function</h4> | |
| 945 <p> | |
| 946 The <em>callback</em> parameter should specify a function | |
| 947 that looks like this: | |
| 948 </p> | |
| 949 <!-- Note: intentionally longer 80 columns --> | |
| 950 <pre>function(<span>string result</span>) <span class="subdued
">{...}</span>;</pre> | |
| 951 <dl> | |
| 952 <div> | |
| 953 <div> | |
| 954 <dt> | |
| 955 <var>result</var> | |
| 956 <em> | |
| 957 <!-- TYPE --> | |
| 958 <div style="display:inline"> | |
| 959 ( | |
| 960 <span id="typeTemplate"> | |
| 961 <span> | |
| 962 <span>string</span> | |
| 963 </span> | |
| 964 </span> | |
| 965 ) | |
| 966 </div> | |
| 967 </em> | |
| 968 </dt> | |
| 969 <dd class="todo"> | |
| 970 Undocumented. | |
| 971 </dd> | |
| 972 <!-- OBJECT PROPERTIES --> | |
| 973 <!-- OBJECT METHODS --> | |
| 974 <!-- OBJECT EVENT FIELDS --> | |
| 975 <!-- FUNCTION PARAMETERS --> | |
| 976 </div> | |
| 977 </div> | |
| 978 </dl> | |
| 979 </div> | |
| 980 </div> | |
| 981 <!-- MIN_VERSION --> | |
| 982 </div> <!-- /description --> | |
| 983 </div><div class="apiItem"> | |
| 984 <a name="method-setBadgeBackgroundColor"></a> <!-- method-anchor -
-> | |
| 985 <h4>setBadgeBackgroundColor</h4> | |
| 986 <div class="summary"> | |
| 987 <!-- Note: intentionally longer 80 columns --> | |
| 988 <span>chrome.browserAction.setBadgeBackgroundColor</span>(<spa
n class="null"><span>object</span> | |
| 989 <var><span>details</span></var></span>)</div> | |
| 990 <div class="description"> | |
| 991 <p>Sets the background color for the badge.</p> | |
| 992 <!-- PARAMETERS --> | |
| 993 <h4>Parameters</h4> | |
| 994 <dl> | |
| 995 <div> | |
| 996 <div> | |
| 997 <dt> | |
| 998 <var>details</var> | |
| 999 <em> | |
| 1000 <!-- TYPE --> | |
| 1001 <div style="display:inline"> | |
| 1002 ( | |
| 1003 <span id="typeTemplate"> | |
| 1004 <span> | |
| 1005 <span>object</span> | |
| 1006 </span> | |
| 1007 </span> | |
| 1008 ) | |
| 1009 </div> | |
| 1010 </em> | |
| 1011 </dt> | |
| 1012 <dd class="todo"> | |
| 1013 Undocumented. | |
| 1014 </dd> | |
| 1015 <!-- OBJECT PROPERTIES --> | |
| 1016 <dd> | |
| 1017 <dl> | |
| 1018 <div> | |
| 1019 <div> | |
| 1020 <dt> | |
| 1021 <var>color</var> | |
| 1022 <em> | |
| 1023 <!-- TYPE --> | |
| 1024 <div style="display:inline"> | |
| 1025 ( | |
| 1026 <span id="typeTemplate"> | |
| 1027 <span> | |
| 1028 <span>string or ColorArray</span> | |
| 1029 </span> | |
| 1030 </span> | |
| 1031 ) | |
| 1032 </div> | |
| 1033 </em> | |
| 1034 </dt> | |
| 1035 <dd>An array of four integers in the range [0,255] that make up the RG
BA 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</cod
e> or <code>#F00</code>.</dd> | |
| 1036 <!-- OBJECT PROPERTIES --> | |
| 1037 <!-- OBJECT METHODS --> | |
| 1038 <!-- OBJECT EVENT FIELDS --> | |
| 1039 <!-- FUNCTION PARAMETERS --> | |
| 1040 </div> | |
| 1041 </div><div> | |
| 1042 <div> | |
| 1043 <dt> | |
| 1044 <var>tabId</var> | |
| 1045 <em> | |
| 1046 <!-- TYPE --> | |
| 1047 <div style="display:inline"> | |
| 1048 ( | |
| 1049 <span class="optional">optional</span> | |
| 1050 <span id="typeTemplate"> | |
| 1051 <span> | |
| 1052 <span>integer</span> | |
| 1053 </span> | |
| 1054 </span> | |
| 1055 ) | |
| 1056 </div> | |
| 1057 </em> | |
| 1058 </dt> | |
| 1059 <dd>Limits the change to when a particular tab is selected. Automatica
lly resets when the tab is closed.</dd> | |
| 1060 <!-- OBJECT PROPERTIES --> | |
| 1061 <!-- OBJECT METHODS --> | |
| 1062 <!-- OBJECT EVENT FIELDS --> | |
| 1063 <!-- FUNCTION PARAMETERS --> | |
| 1064 </div> | |
| 1065 </div> | |
| 1066 </dl> | |
| 1067 </dd> | |
| 1068 <!-- OBJECT METHODS --> | |
| 1069 <!-- OBJECT EVENT FIELDS --> | |
| 1070 <!-- FUNCTION PARAMETERS --> | |
| 1071 </div> | |
| 1072 </div> | |
| 1073 </dl> | |
| 1074 <!-- RETURNS --> | |
| 1075 <dl> | |
| 1076 </dl> | |
| 1077 <!-- CALLBACK --> | |
| 1078 <!-- MIN_VERSION --> | |
| 1079 </div> <!-- /description --> | |
| 1080 </div><div class="apiItem"> | |
| 1081 <a name="method-setBadgeText"></a> <!-- method-anchor --> | |
| 1082 <h4>setBadgeText</h4> | |
| 1083 <div class="summary"> | |
| 1084 <!-- Note: intentionally longer 80 columns --> | |
| 1085 <span>chrome.browserAction.setBadgeText</span>(<span class="nu
ll"><span>object</span> | |
| 1086 <var><span>details</span></var></span>)</div> | |
| 1087 <div class="description"> | |
| 1088 <p>Sets the badge text for the browser action. The badge is disp
layed on top of the icon.</p> | |
| 1089 <!-- PARAMETERS --> | |
| 1090 <h4>Parameters</h4> | |
| 1091 <dl> | |
| 1092 <div> | |
| 1093 <div> | |
| 1094 <dt> | |
| 1095 <var>details</var> | |
| 1096 <em> | |
| 1097 <!-- TYPE --> | |
| 1098 <div style="display:inline"> | |
| 1099 ( | |
| 1100 <span id="typeTemplate"> | |
| 1101 <span> | |
| 1102 <span>object</span> | |
| 1103 </span> | |
| 1104 </span> | |
| 1105 ) | |
| 1106 </div> | |
| 1107 </em> | |
| 1108 </dt> | |
| 1109 <dd class="todo"> | |
| 1110 Undocumented. | |
| 1111 </dd> | |
| 1112 <!-- OBJECT PROPERTIES --> | |
| 1113 <dd> | |
| 1114 <dl> | |
| 1115 <div> | |
| 1116 <div> | |
| 1117 <dt> | |
| 1118 <var>text</var> | |
| 1119 <em> | |
| 1120 <!-- TYPE --> | |
| 1121 <div style="display:inline"> | |
| 1122 ( | |
| 1123 <span id="typeTemplate"> | |
| 1124 <span> | |
| 1125 <span>string</span> | |
| 1126 </span> | |
| 1127 </span> | |
| 1128 ) | |
| 1129 </div> | |
| 1130 </em> | |
| 1131 </dt> | |
| 1132 <dd>Any number of characters can be passed, but only about four can fi
t in the space.</dd> | |
| 1133 <!-- OBJECT PROPERTIES --> | |
| 1134 <!-- OBJECT METHODS --> | |
| 1135 <!-- OBJECT EVENT FIELDS --> | |
| 1136 <!-- FUNCTION PARAMETERS --> | |
| 1137 </div> | |
| 1138 </div><div> | |
| 1139 <div> | |
| 1140 <dt> | |
| 1141 <var>tabId</var> | |
| 1142 <em> | |
| 1143 <!-- TYPE --> | |
| 1144 <div style="display:inline"> | |
| 1145 ( | |
| 1146 <span class="optional">optional</span> | |
| 1147 <span id="typeTemplate"> | |
| 1148 <span> | |
| 1149 <span>integer</span> | |
| 1150 </span> | |
| 1151 </span> | |
| 1152 ) | |
| 1153 </div> | |
| 1154 </em> | |
| 1155 </dt> | |
| 1156 <dd>Limits the change to when a particular tab is selected. Automatica
lly resets when the tab is closed.</dd> | |
| 1157 <!-- OBJECT PROPERTIES --> | |
| 1158 <!-- OBJECT METHODS --> | |
| 1159 <!-- OBJECT EVENT FIELDS --> | |
| 1160 <!-- FUNCTION PARAMETERS --> | |
| 1161 </div> | |
| 1162 </div> | |
| 1163 </dl> | |
| 1164 </dd> | |
| 1165 <!-- OBJECT METHODS --> | |
| 1166 <!-- OBJECT EVENT FIELDS --> | |
| 1167 <!-- FUNCTION PARAMETERS --> | |
| 1168 </div> | |
| 1169 </div> | |
| 1170 </dl> | |
| 1171 <!-- RETURNS --> | |
| 1172 <dl> | |
| 1173 </dl> | |
| 1174 <!-- CALLBACK --> | |
| 1175 <!-- MIN_VERSION --> | |
| 1176 </div> <!-- /description --> | |
| 1177 </div><div class="apiItem"> | |
| 1178 <a name="method-setIcon"></a> <!-- method-anchor --> | |
| 1179 <h4>setIcon</h4> | |
| 1180 <div class="summary"> | |
| 1181 <!-- Note: intentionally longer 80 columns --> | |
| 1182 <span>chrome.browserAction.setIcon</span>(<span class="null"><
span>object</span> | |
| 1183 <var><span>details</span></var></span><span class="optiona
l"><span>, </span><span>function</span> | |
| 1184 <var><span>callback</span></var></span>)</div> | |
| 1185 <div class="description"> | |
| 1186 <p>Sets the icon for the browser action. The icon can be specifi
ed either as the path to an image file or as the pixel data from a canvas elemen
t. Either the <b>path</b> or the <b>imageData</b> property must be specified.</p
> | |
| 1187 <!-- PARAMETERS --> | |
| 1188 <h4>Parameters</h4> | |
| 1189 <dl> | |
| 1190 <div> | |
| 1191 <div> | |
| 1192 <dt> | |
| 1193 <var>details</var> | |
| 1194 <em> | |
| 1195 <!-- TYPE --> | |
| 1196 <div style="display:inline"> | |
| 1197 ( | |
| 1198 <span id="typeTemplate"> | |
| 1199 <span> | |
| 1200 <span>object</span> | |
| 1201 </span> | |
| 1202 </span> | |
| 1203 ) | |
| 1204 </div> | |
| 1205 </em> | |
| 1206 </dt> | |
| 1207 <dd class="todo"> | |
| 1208 Undocumented. | |
| 1209 </dd> | |
| 1210 <!-- OBJECT PROPERTIES --> | |
| 1211 <dd> | |
| 1212 <dl> | |
| 1213 <div> | |
| 1214 <div> | |
| 1215 <dt> | |
| 1216 <var>imageData</var> | |
| 1217 <em> | |
| 1218 <!-- TYPE --> | |
| 1219 <div style="display:inline"> | |
| 1220 ( | |
| 1221 <span class="optional">optional</span> | |
| 1222 <span id="typeTemplate"> | |
| 1223 <span> | |
| 1224 <span>ImageData</span> | |
| 1225 </span> | |
| 1226 </span> | |
| 1227 ) | |
| 1228 </div> | |
| 1229 </em> | |
| 1230 </dt> | |
| 1231 <dd>Pixel data for an image. Must be an ImageData object (for example,
from a <code>canvas</code> element).</dd> | |
| 1232 <!-- OBJECT PROPERTIES --> | |
| 1233 <!-- OBJECT METHODS --> | |
| 1234 <!-- OBJECT EVENT FIELDS --> | |
| 1235 <!-- FUNCTION PARAMETERS --> | |
| 1236 </div> | |
| 1237 </div><div> | |
| 1238 <div> | |
| 1239 <dt> | |
| 1240 <var>path</var> | |
| 1241 <em> | |
| 1242 <!-- TYPE --> | |
| 1243 <div style="display:inline"> | |
| 1244 ( | |
| 1245 <span class="optional">optional</span> | |
| 1246 <span id="typeTemplate"> | |
| 1247 <span> | |
| 1248 <span>string</span> | |
| 1249 </span> | |
| 1250 </span> | |
| 1251 ) | |
| 1252 </div> | |
| 1253 </em> | |
| 1254 </dt> | |
| 1255 <dd>Relative path to an image in the extension to show in the browser
action.</dd> | |
| 1256 <!-- OBJECT PROPERTIES --> | |
| 1257 <!-- OBJECT METHODS --> | |
| 1258 <!-- OBJECT EVENT FIELDS --> | |
| 1259 <!-- FUNCTION PARAMETERS --> | |
| 1260 </div> | |
| 1261 </div><div> | |
| 1262 <div> | |
| 1263 <dt> | |
| 1264 <var>tabId</var> | |
| 1265 <em> | |
| 1266 <!-- TYPE --> | |
| 1267 <div style="display:inline"> | |
| 1268 ( | |
| 1269 <span class="optional">optional</span> | |
| 1270 <span id="typeTemplate"> | |
| 1271 <span> | |
| 1272 <span>integer</span> | |
| 1273 </span> | |
| 1274 </span> | |
| 1275 ) | |
| 1276 </div> | |
| 1277 </em> | |
| 1278 </dt> | |
| 1279 <dd>Limits the change to when a particular tab is selected. Automatica
lly resets when the tab is closed.</dd> | |
| 1280 <!-- OBJECT PROPERTIES --> | |
| 1281 <!-- OBJECT METHODS --> | |
| 1282 <!-- OBJECT EVENT FIELDS --> | |
| 1283 <!-- FUNCTION PARAMETERS --> | |
| 1284 </div> | |
| 1285 </div> | |
| 1286 </dl> | |
| 1287 </dd> | |
| 1288 <!-- OBJECT METHODS --> | |
| 1289 <!-- OBJECT EVENT FIELDS --> | |
| 1290 <!-- FUNCTION PARAMETERS --> | |
| 1291 </div> | |
| 1292 </div><div> | |
| 1293 <div> | |
| 1294 <dt> | |
| 1295 <var>callback</var> | |
| 1296 <em> | |
| 1297 <!-- TYPE --> | |
| 1298 <div style="display:inline"> | |
| 1299 ( | |
| 1300 <span class="optional">optional</span> | |
| 1301 <span id="typeTemplate"> | |
| 1302 <span> | |
| 1303 <span>function</span> | |
| 1304 </span> | |
| 1305 </span> | |
| 1306 ) | |
| 1307 </div> | |
| 1308 </em> | |
| 1309 </dt> | |
| 1310 <dd class="todo"> | |
| 1311 Undocumented. | |
| 1312 </dd> | |
| 1313 <!-- OBJECT PROPERTIES --> | |
| 1314 <!-- OBJECT METHODS --> | |
| 1315 <!-- OBJECT EVENT FIELDS --> | |
| 1316 <!-- FUNCTION PARAMETERS --> | |
| 1317 </div> | |
| 1318 </div> | |
| 1319 </dl> | |
| 1320 <!-- RETURNS --> | |
| 1321 <dl> | |
| 1322 </dl> | |
| 1323 <!-- CALLBACK --> | |
| 1324 <div> | |
| 1325 <div> | |
| 1326 <h4>Callback function</h4> | |
| 1327 <p> | |
| 1328 If you specify the <em>callback</em> parameter, it should | |
| 1329 specify a function that looks like this: | |
| 1330 </p> | |
| 1331 <!-- Note: intentionally longer 80 columns --> | |
| 1332 <pre>function(<span></span>) <span class="subdued">{...}</span
>;</pre> | |
| 1333 <dl> | |
| 1334 </dl> | |
| 1335 </div> | |
| 1336 </div> | |
| 1337 <!-- MIN_VERSION --> | |
| 1338 </div> <!-- /description --> | |
| 1339 </div><div class="apiItem"> | |
| 1340 <a name="method-setPopup"></a> <!-- method-anchor --> | |
| 1341 <h4>setPopup</h4> | |
| 1342 <div class="summary"> | |
| 1343 <!-- Note: intentionally longer 80 columns --> | |
| 1344 <span>chrome.browserAction.setPopup</span>(<span class="null">
<span>object</span> | |
| 1345 <var><span>details</span></var></span>)</div> | |
| 1346 <div class="description"> | |
| 1347 <p>Sets the html document to be opened as a popup when the user
clicks on the browser action's icon.</p> | |
| 1348 <!-- PARAMETERS --> | |
| 1349 <h4>Parameters</h4> | |
| 1350 <dl> | |
| 1351 <div> | |
| 1352 <div> | |
| 1353 <dt> | |
| 1354 <var>details</var> | |
| 1355 <em> | |
| 1356 <!-- TYPE --> | |
| 1357 <div style="display:inline"> | |
| 1358 ( | |
| 1359 <span id="typeTemplate"> | |
| 1360 <span> | |
| 1361 <span>object</span> | |
| 1362 </span> | |
| 1363 </span> | |
| 1364 ) | |
| 1365 </div> | |
| 1366 </em> | |
| 1367 </dt> | |
| 1368 <dd class="todo"> | |
| 1369 Undocumented. | |
| 1370 </dd> | |
| 1371 <!-- OBJECT PROPERTIES --> | |
| 1372 <dd> | |
| 1373 <dl> | |
| 1374 <div> | |
| 1375 <div> | |
| 1376 <dt> | |
| 1377 <var>tabId</var> | |
| 1378 <em> | |
| 1379 <!-- TYPE --> | |
| 1380 <div style="display:inline"> | |
| 1381 ( | |
| 1382 <span class="optional">optional</span> | |
| 1383 <span id="typeTemplate"> | |
| 1384 <span> | |
| 1385 <span>integer</span> | |
| 1386 </span> | |
| 1387 </span> | |
| 1388 ) | |
| 1389 </div> | |
| 1390 </em> | |
| 1391 </dt> | |
| 1392 <dd>Limits the change to when a particular tab is selected. Automatica
lly resets when the tab is closed.</dd> | |
| 1393 <!-- OBJECT PROPERTIES --> | |
| 1394 <!-- OBJECT METHODS --> | |
| 1395 <!-- OBJECT EVENT FIELDS --> | |
| 1396 <!-- FUNCTION PARAMETERS --> | |
| 1397 </div> | |
| 1398 </div><div> | |
| 1399 <div> | |
| 1400 <dt> | |
| 1401 <var>popup</var> | |
| 1402 <em> | |
| 1403 <!-- TYPE --> | |
| 1404 <div style="display:inline"> | |
| 1405 ( | |
| 1406 <span id="typeTemplate"> | |
| 1407 <span> | |
| 1408 <span>string</span> | |
| 1409 </span> | |
| 1410 </span> | |
| 1411 ) | |
| 1412 </div> | |
| 1413 </em> | |
| 1414 </dt> | |
| 1415 <dd>The html file to show in a popup. If set to the empty string ('')
, no popup is shown.</dd> | |
| 1416 <!-- OBJECT PROPERTIES --> | |
| 1417 <!-- OBJECT METHODS --> | |
| 1418 <!-- OBJECT EVENT FIELDS --> | |
| 1419 <!-- FUNCTION PARAMETERS --> | |
| 1420 </div> | |
| 1421 </div> | |
| 1422 </dl> | |
| 1423 </dd> | |
| 1424 <!-- OBJECT METHODS --> | |
| 1425 <!-- OBJECT EVENT FIELDS --> | |
| 1426 <!-- FUNCTION PARAMETERS --> | |
| 1427 </div> | |
| 1428 </div> | |
| 1429 </dl> | |
| 1430 <!-- RETURNS --> | |
| 1431 <dl> | |
| 1432 </dl> | |
| 1433 <!-- CALLBACK --> | |
| 1434 <!-- MIN_VERSION --> | |
| 1435 </div> <!-- /description --> | |
| 1436 </div><div class="apiItem"> | |
| 1437 <a name="method-setTitle"></a> <!-- method-anchor --> | |
| 1438 <h4>setTitle</h4> | |
| 1439 <div class="summary"> | |
| 1440 <!-- Note: intentionally longer 80 columns --> | |
| 1441 <span>chrome.browserAction.setTitle</span>(<span class="null">
<span>object</span> | |
| 1442 <var><span>details</span></var></span>)</div> | |
| 1443 <div class="description"> | |
| 1444 <p>Sets the title of the browser action. This shows up in the to
oltip.</p> | |
| 1445 <!-- PARAMETERS --> | |
| 1446 <h4>Parameters</h4> | |
| 1447 <dl> | |
| 1448 <div> | |
| 1449 <div> | |
| 1450 <dt> | |
| 1451 <var>details</var> | |
| 1452 <em> | |
| 1453 <!-- TYPE --> | |
| 1454 <div style="display:inline"> | |
| 1455 ( | |
| 1456 <span id="typeTemplate"> | |
| 1457 <span> | |
| 1458 <span>object</span> | |
| 1459 </span> | |
| 1460 </span> | |
| 1461 ) | |
| 1462 </div> | |
| 1463 </em> | |
| 1464 </dt> | |
| 1465 <dd class="todo"> | |
| 1466 Undocumented. | |
| 1467 </dd> | |
| 1468 <!-- OBJECT PROPERTIES --> | |
| 1469 <dd> | |
| 1470 <dl> | |
| 1471 <div> | |
| 1472 <div> | |
| 1473 <dt> | |
| 1474 <var>title</var> | |
| 1475 <em> | |
| 1476 <!-- TYPE --> | |
| 1477 <div style="display:inline"> | |
| 1478 ( | |
| 1479 <span id="typeTemplate"> | |
| 1480 <span> | |
| 1481 <span>string</span> | |
| 1482 </span> | |
| 1483 </span> | |
| 1484 ) | |
| 1485 </div> | |
| 1486 </em> | |
| 1487 </dt> | |
| 1488 <dd>The string the browser action should display when moused over.</dd
> | |
| 1489 <!-- OBJECT PROPERTIES --> | |
| 1490 <!-- OBJECT METHODS --> | |
| 1491 <!-- OBJECT EVENT FIELDS --> | |
| 1492 <!-- FUNCTION PARAMETERS --> | |
| 1493 </div> | |
| 1494 </div><div> | |
| 1495 <div> | |
| 1496 <dt> | |
| 1497 <var>tabId</var> | |
| 1498 <em> | |
| 1499 <!-- TYPE --> | |
| 1500 <div style="display:inline"> | |
| 1501 ( | |
| 1502 <span class="optional">optional</span> | |
| 1503 <span id="typeTemplate"> | |
| 1504 <span> | |
| 1505 <span>integer</span> | |
| 1506 </span> | |
| 1507 </span> | |
| 1508 ) | |
| 1509 </div> | |
| 1510 </em> | |
| 1511 </dt> | |
| 1512 <dd>Limits the change to when a particular tab is selected. Automatica
lly resets when the tab is closed.</dd> | |
| 1513 <!-- OBJECT PROPERTIES --> | |
| 1514 <!-- OBJECT METHODS --> | |
| 1515 <!-- OBJECT EVENT FIELDS --> | |
| 1516 <!-- FUNCTION PARAMETERS --> | |
| 1517 </div> | |
| 1518 </div> | |
| 1519 </dl> | |
| 1520 </dd> | |
| 1521 <!-- OBJECT METHODS --> | |
| 1522 <!-- OBJECT EVENT FIELDS --> | |
| 1523 <!-- FUNCTION PARAMETERS --> | |
| 1524 </div> | |
| 1525 </div> | |
| 1526 </dl> | |
| 1527 <!-- RETURNS --> | |
| 1528 <dl> | |
| 1529 </dl> | |
| 1530 <!-- CALLBACK --> | |
| 1531 <!-- MIN_VERSION --> | |
| 1532 </div> <!-- /description --> | |
| 1533 </div> <!-- /apiItem --> | |
| 1534 </div> <!-- /apiGroup --> | |
| 1535 <!-- EVENTS --> | |
| 1536 <div id="eventsTemplate" class="apiGroup"> | |
| 1537 <a name="global-events"></a> | |
| 1538 <h3>Events</h3> | |
| 1539 <!-- iterates over all events --> | |
| 1540 <div class="apiItem"> | |
| 1541 <a name="event-onClicked"></a> | |
| 1542 <h4>onClicked</h4> | |
| 1543 <div class="summary"> | |
| 1544 <!-- Note: intentionally longer 80 columns --> | |
| 1545 <span class="subdued">chrome.browserAction.</span><span>onClicke
d</span><span class="subdued">.addListener</span>(function(<span>tabs.Tab tab</s
pan>) <span class="subdued">{...}</span><span></span>); | |
| 1546 </div> | |
| 1547 <div class="description"> | |
| 1548 <p>Fired when a browser action icon is clicked. This event will
not fire if the browser action has a popup.</p> | |
| 1549 <!-- LISTENER PARAMETERS --> | |
| 1550 <div> | |
| 1551 <h4>Listener parameters</h4> | |
| 1552 <dl> | |
| 1553 <div> | |
| 1554 <div> | |
| 1555 <dt> | |
| 1556 <var>tab</var> | |
| 1557 <em> | |
| 1558 <!-- TYPE --> | |
| 1559 <div style="display:inline"> | |
| 1560 ( | |
| 1561 <span id="typeTemplate"> | |
| 1562 <span> | |
| 1563 <a>tabs.Tab</a> | |
| 1564 </span> | |
| 1565 </span> | |
| 1566 ) | |
| 1567 </div> | |
| 1568 </em> | |
| 1569 </dt> | |
| 1570 <dd class="todo"> | |
| 1571 Undocumented. | |
| 1572 </dd> | |
| 1573 <!-- OBJECT PROPERTIES --> | |
| 1574 <!-- OBJECT METHODS --> | |
| 1575 <!-- OBJECT EVENT FIELDS --> | |
| 1576 <!-- FUNCTION PARAMETERS --> | |
| 1577 </div> | |
| 1578 </div> | |
| 1579 </dl> | |
| 1580 </div> | |
| 1581 <!-- EXTRA PARAMETERS --> | |
| 1582 <!-- LISTENER RETURN VALUE --> | |
| 1583 <dl> | |
| 1584 </dl> | |
| 1585 </div> <!-- /description --> | |
| 1586 <!-- /description --> | |
| 1587 </div> <!-- /apiItem --> | |
| 1588 </div> <!-- /apiGroup --> | |
| 1589 <!-- TYPES --> | |
| 1590 <div class="apiGroup"> | |
| 1591 <a name="types"></a> | |
| 1592 <h3 id="types">Types</h3> | |
| 1593 <!-- iterates over all types --> | |
| 1594 <div class="apiItem"> | |
| 1595 <a name="type-ColorArray"></a> | |
| 1596 <h4>ColorArray</h4> | |
| 1597 <div> | |
| 1598 <dt> | |
| 1599 <em> | |
| 1600 <!-- TYPE --> | |
| 1601 <div style="display:inline"> | |
| 1602 ( | |
| 1603 <span id="typeTemplate"> | |
| 1604 <span> | |
| 1605 <span> | |
| 1606 array of <span><span> | |
| 1607 <span> | |
| 1608 <span>integer</span> | |
| 1609 </span> | |
| 1610 </span></span> | |
| 1611 </span> | |
| 1612 </span> | |
| 1613 </span> | |
| 1614 ) | |
| 1615 </div> | |
| 1616 </em> | |
| 1617 </dt> | |
| 1618 <dd class="todo"> | |
| 1619 Undocumented. | |
| 1620 </dd> | |
| 1621 <!-- OBJECT PROPERTIES --> | |
| 1622 <!-- OBJECT METHODS --> | |
| 1623 <!-- OBJECT EVENT FIELDS --> | |
| 1624 <!-- FUNCTION PARAMETERS --> | |
| 1625 </div> | |
| 1626 </div> <!-- /apiItem --> | |
| 1627 </div> <!-- /apiGroup --> | |
| 1628 </div> <!-- /apiPage --> | |
| 1629 </div> <!-- /gc-pagecontent --> | |
| 1630 </div> <!-- /g-section --> | |
| 1631 </div> <!-- /codesiteContent --> | |
| 1632 <div id="gc-footer" --=""> | |
| 1633 <div class="text"> | |
| 1634 <p> | |
| 1635 Except as otherwise <a href="http://code.google.com/policies.html#restrictions
">noted</a>, | |
| 1636 the content of this page is licensed under the <a rel="license" href="http://c
reativecommons.org/licenses/by/3.0/">Creative Commons | |
| 1637 Attribution 3.0 License</a>, and code samples are licensed under the | |
| 1638 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic
ense</a>. | |
| 1639 </p> | |
| 1640 <p> | |
| 1641 ©2011 Google | |
| 1642 </p> | |
| 1643 <!-- begin analytics --> | |
| 1644 <script src="https://www.google-analytics.com/urchin.js" type="text/javascript">
</script> | |
| 1645 <script src="https://www.google-analytics.com/ga.js" type="text/javascript"></sc
ript> | |
| 1646 <script type="text/javascript"> | |
| 1647 // chrome doc tracking | |
| 1648 try { | |
| 1649 var engdocs = _gat._getTracker("YT-10763712-2"); | |
| 1650 engdocs._trackPageview(); | |
| 1651 } catch(err) {} | |
| 1652 // code.google.com site-wide tracking | |
| 1653 try { | |
| 1654 _uacct="UA-18071-1"; | |
| 1655 _uanchor=1; | |
| 1656 _uff=0; | |
| 1657 urchinTracker(); | |
| 1658 } | |
| 1659 catch(e) {/* urchinTracker not available. */} | |
| 1660 </script> | |
| 1661 <!-- end analytics --> | |
| 1662 </div> | |
| 1663 </div> <!-- /gc-footer --> | |
| 1664 </div> <!-- /gc-container --> | |
| 1665 </body></html> | |
| OLD | NEW |