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.pageAction modu
le, which is part of the Google Chrome extension APIs."><title>Page Actions - G
oogle 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><a href="browserAction.html">Browser Actions</a></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 class="leftNavSelected">Page Actions</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">Page 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 </ol> | |
202 </li><li> | |
203 <a href="#tips">Tips</a> | |
204 <ol> | |
205 </ol> | |
206 </li><li> | |
207 <a href="#examples"> Examples </a> | |
208 <ol> | |
209 </ol> | |
210 </li> | |
211 <li> | |
212 <a href="#apiReference">API reference: chrome.pageAction</a> | |
213 <ol> | |
214 <li> | |
215 <a href="#global-methods">Methods</a> | |
216 <ol> | |
217 <li> | |
218 <a href="#method-getPopup">getPopup</a> | |
219 </li><li> | |
220 <a href="#method-getTitle">getTitle</a> | |
221 </li><li> | |
222 <a href="#method-hide">hide</a> | |
223 </li><li> | |
224 <a href="#method-setIcon">setIcon</a> | |
225 </li><li> | |
226 <a href="#method-setPopup">setPopup</a> | |
227 </li><li> | |
228 <a href="#method-setTitle">setTitle</a> | |
229 </li><li> | |
230 <a href="#method-show">show</a> | |
231 </li> | |
232 </ol> | |
233 </li> | |
234 <li> | |
235 <a href="#global-events">Events</a> | |
236 <ol> | |
237 <li> | |
238 <a href="#event-onClicked">onClicked</a> | |
239 </li> | |
240 </ol> | |
241 </li> | |
242 </ol> | |
243 </li> | |
244 </ol> | |
245 </div> | |
246 <!-- /TABLE OF CONTENTS --> | |
247 <!-- Standard content lead-in for experimental API pages --> | |
248 <!-- STATIC CONTENT PLACEHOLDER --> | |
249 <div id="static"><div id="pageData-name" class="pageData">Page Actions</
div> | |
250 <!-- BEGIN AUTHORED CONTENT --> | |
251 <p> | |
252 Use page actions to put icons inside the address bar. | |
253 Page actions represent actions | |
254 that can be taken on the current page, | |
255 but that aren't applicable to all pages. | |
256 Some examples: | |
257 </p> | |
258 <ul> | |
259 <li> Subscribe to this page's RSS feed </li> | |
260 <li> Make a slideshow out of this page's photos </li> | |
261 </ul> | |
262 <p> | |
263 The RSS icon in the following screenshot | |
264 represents a page action | |
265 that lets you subscribe to | |
266 the RSS feed for the current page. | |
267 </p> | |
268 <img src="images/page-action.png" width="361" height="79"> | |
269 <p> | |
270 If you want the extension's icon to always be visible, | |
271 use a <a href="browserAction.html">browser action</a> instead. | |
272 </p> | |
273 <p class="caution"> | |
274 <strong>Note:</strong> | |
275 Packaged apps cannot use page actions. | |
276 </p> | |
277 <h2 id="manifest">Manifest</h2> | |
278 <p> | |
279 Register your page action in the | |
280 <a href="manifest.html">extension manifest</a> | |
281 like this: | |
282 </p> | |
283 <pre>{ | |
284 "name": "My extension", | |
285 ... | |
286 <b>"page_action": { | |
287 "default_icon": "icons/foo.png", <em>// optional</em> | |
288 "default_title": "Do action", <em>// optional; shown in tooltip</em> | |
289 "default_popup": "popup.html" <em>// optional</em> | |
290 }</b>, | |
291 ... | |
292 }</pre> | |
293 <h2 id="ui">Parts of the UI</h2> | |
294 <p> | |
295 Like browser actions, | |
296 page actions can have an icon, | |
297 a tooltip, and popup; | |
298 they can't have badges, however. | |
299 In addition, page actions can appear and disappear. | |
300 You can find information about icons, tooltips, and popups | |
301 by reading about the | |
302 <a href="browserAction.html#ui">browser action UI</a>. | |
303 </p> | |
304 <p> | |
305 You make a page action appear and disappear using the | |
306 <a href="#method-show">show()</a> and | |
307 <a href="#method-hide">hide()</a> methods, respectively. | |
308 By default, a page action is hidden. | |
309 When you show it, you specify the tab | |
310 in which the icon should appear. | |
311 The icon remains visible | |
312 until the tab is closed | |
313 or starts displaying a different URL | |
314 (because the user clicks a link, for example). | |
315 </p> | |
316 <!-- [PENDING: We should discuss how tabs and page actions are related. All met
hods take a tab ID argument. How do you get that tab ID? What's the usual way
of arranging the code that monitors pages? Point to examples.] --> | |
317 <h2 id="tips">Tips</h2> | |
318 <p>For the best visual impact, | |
319 follow these guidelines:</p> | |
320 <ul> | |
321 <li><b>Do</b> use page actions | |
322 for features that make sense | |
323 for only a few pages. | |
324 </li><li><b>Don't</b> use page actions | |
325 for features that make sense | |
326 for most pages. | |
327 Use <a href="browserAction.html">browser actions</a> instead. | |
328 </li><li><b>Don't</b> constantly animate your icon. | |
329 That's just annoying. | |
330 </li></ul> | |
331 <h2 id="examples"> Examples </h2> | |
332 <p> | |
333 You can find simple examples of using page actions in the | |
334 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension
s/docs/examples/api/pageAction/">examples/api/pageAction</a> | |
335 directory. | |
336 For other examples and for help in viewing the source code, see | |
337 <a href="samples.html">Samples</a>. | |
338 </p> | |
339 <!-- END AUTHORED CONTENT --> | |
340 </div> | |
341 <!-- API PAGE --> | |
342 <div class="apiPage"> | |
343 <a name="apiReference"></a> | |
344 <h2>API reference: chrome.pageAction</h2> | |
345 <!-- PROPERTIES --> | |
346 <!-- /apiGroup --> | |
347 <!-- METHODS --> | |
348 <div id="methodsTemplate" class="apiGroup"> | |
349 <a name="global-methods"></a> | |
350 <h3>Methods</h3> | |
351 <!-- iterates over all functions --> | |
352 <div class="apiItem"> | |
353 <a name="method-getPopup"></a> <!-- method-anchor --> | |
354 <h4>getPopup</h4> | |
355 <div class="summary"> | |
356 <!-- Note: intentionally longer 80 columns --> | |
357 <span>chrome.pageAction.getPopup</span>(<span class="null"><sp
an>object</span> | |
358 <var><span>details</span></var></span><span class="null"><
span>, </span><span>function</span> | |
359 <var><span>callback</span></var></span>)</div> | |
360 <div class="description"> | |
361 <p>Gets the html document set as the popup for this browser acti
on.</p> | |
362 <!-- PARAMETERS --> | |
363 <h4>Parameters</h4> | |
364 <dl> | |
365 <div> | |
366 <div> | |
367 <dt> | |
368 <var>details</var> | |
369 <em> | |
370 <!-- TYPE --> | |
371 <div style="display:inline"> | |
372 ( | |
373 <span id="typeTemplate"> | |
374 <span> | |
375 <span>object</span> | |
376 </span> | |
377 </span> | |
378 ) | |
379 </div> | |
380 </em> | |
381 </dt> | |
382 <dd class="todo"> | |
383 Undocumented. | |
384 </dd> | |
385 <!-- OBJECT PROPERTIES --> | |
386 <dd> | |
387 <dl> | |
388 <div> | |
389 <div> | |
390 <dt> | |
391 <var>tabId</var> | |
392 <em> | |
393 <!-- TYPE --> | |
394 <div style="display:inline"> | |
395 ( | |
396 <span id="typeTemplate"> | |
397 <span> | |
398 <span>integer</span> | |
399 </span> | |
400 </span> | |
401 ) | |
402 </div> | |
403 </em> | |
404 </dt> | |
405 <dd>Specify the tab to get the popup from.</dd> | |
406 <!-- OBJECT PROPERTIES --> | |
407 <!-- OBJECT METHODS --> | |
408 <!-- OBJECT EVENT FIELDS --> | |
409 <!-- FUNCTION PARAMETERS --> | |
410 </div> | |
411 </div> | |
412 </dl> | |
413 </dd> | |
414 <!-- OBJECT METHODS --> | |
415 <!-- OBJECT EVENT FIELDS --> | |
416 <!-- FUNCTION PARAMETERS --> | |
417 </div> | |
418 </div><div> | |
419 <div> | |
420 <dt> | |
421 <var>callback</var> | |
422 <em> | |
423 <!-- TYPE --> | |
424 <div style="display:inline"> | |
425 ( | |
426 <span id="typeTemplate"> | |
427 <span> | |
428 <span>function</span> | |
429 </span> | |
430 </span> | |
431 ) | |
432 </div> | |
433 </em> | |
434 </dt> | |
435 <dd class="todo"> | |
436 Undocumented. | |
437 </dd> | |
438 <!-- OBJECT PROPERTIES --> | |
439 <!-- OBJECT METHODS --> | |
440 <!-- OBJECT EVENT FIELDS --> | |
441 <!-- FUNCTION PARAMETERS --> | |
442 </div> | |
443 </div> | |
444 </dl> | |
445 <!-- RETURNS --> | |
446 <dl> | |
447 </dl> | |
448 <!-- CALLBACK --> | |
449 <div> | |
450 <div> | |
451 <h4>Callback function</h4> | |
452 <p> | |
453 The <em>callback</em> parameter should specify a function | |
454 that looks like this: | |
455 </p> | |
456 <!-- Note: intentionally longer 80 columns --> | |
457 <pre>function(<span>string result</span>) <span class="subdued
">{...}</span>;</pre> | |
458 <dl> | |
459 <div> | |
460 <div> | |
461 <dt> | |
462 <var>result</var> | |
463 <em> | |
464 <!-- TYPE --> | |
465 <div style="display:inline"> | |
466 ( | |
467 <span id="typeTemplate"> | |
468 <span> | |
469 <span>string</span> | |
470 </span> | |
471 </span> | |
472 ) | |
473 </div> | |
474 </em> | |
475 </dt> | |
476 <dd class="todo"> | |
477 Undocumented. | |
478 </dd> | |
479 <!-- OBJECT PROPERTIES --> | |
480 <!-- OBJECT METHODS --> | |
481 <!-- OBJECT EVENT FIELDS --> | |
482 <!-- FUNCTION PARAMETERS --> | |
483 </div> | |
484 </div> | |
485 </dl> | |
486 </div> | |
487 </div> | |
488 <!-- MIN_VERSION --> | |
489 </div> <!-- /description --> | |
490 </div><div class="apiItem"> | |
491 <a name="method-getTitle"></a> <!-- method-anchor --> | |
492 <h4>getTitle</h4> | |
493 <div class="summary"> | |
494 <!-- Note: intentionally longer 80 columns --> | |
495 <span>chrome.pageAction.getTitle</span>(<span class="null"><sp
an>object</span> | |
496 <var><span>details</span></var></span><span class="null"><
span>, </span><span>function</span> | |
497 <var><span>callback</span></var></span>)</div> | |
498 <div class="description"> | |
499 <p>Gets the title of the browser action.</p> | |
500 <!-- PARAMETERS --> | |
501 <h4>Parameters</h4> | |
502 <dl> | |
503 <div> | |
504 <div> | |
505 <dt> | |
506 <var>details</var> | |
507 <em> | |
508 <!-- TYPE --> | |
509 <div style="display:inline"> | |
510 ( | |
511 <span id="typeTemplate"> | |
512 <span> | |
513 <span>object</span> | |
514 </span> | |
515 </span> | |
516 ) | |
517 </div> | |
518 </em> | |
519 </dt> | |
520 <dd class="todo"> | |
521 Undocumented. | |
522 </dd> | |
523 <!-- OBJECT PROPERTIES --> | |
524 <dd> | |
525 <dl> | |
526 <div> | |
527 <div> | |
528 <dt> | |
529 <var>tabId</var> | |
530 <em> | |
531 <!-- TYPE --> | |
532 <div style="display:inline"> | |
533 ( | |
534 <span id="typeTemplate"> | |
535 <span> | |
536 <span>integer</span> | |
537 </span> | |
538 </span> | |
539 ) | |
540 </div> | |
541 </em> | |
542 </dt> | |
543 <dd>Specify the tab to get the title from.</dd> | |
544 <!-- OBJECT PROPERTIES --> | |
545 <!-- OBJECT METHODS --> | |
546 <!-- OBJECT EVENT FIELDS --> | |
547 <!-- FUNCTION PARAMETERS --> | |
548 </div> | |
549 </div> | |
550 </dl> | |
551 </dd> | |
552 <!-- OBJECT METHODS --> | |
553 <!-- OBJECT EVENT FIELDS --> | |
554 <!-- FUNCTION PARAMETERS --> | |
555 </div> | |
556 </div><div> | |
557 <div> | |
558 <dt> | |
559 <var>callback</var> | |
560 <em> | |
561 <!-- TYPE --> | |
562 <div style="display:inline"> | |
563 ( | |
564 <span id="typeTemplate"> | |
565 <span> | |
566 <span>function</span> | |
567 </span> | |
568 </span> | |
569 ) | |
570 </div> | |
571 </em> | |
572 </dt> | |
573 <dd class="todo"> | |
574 Undocumented. | |
575 </dd> | |
576 <!-- OBJECT PROPERTIES --> | |
577 <!-- OBJECT METHODS --> | |
578 <!-- OBJECT EVENT FIELDS --> | |
579 <!-- FUNCTION PARAMETERS --> | |
580 </div> | |
581 </div> | |
582 </dl> | |
583 <!-- RETURNS --> | |
584 <dl> | |
585 </dl> | |
586 <!-- CALLBACK --> | |
587 <div> | |
588 <div> | |
589 <h4>Callback function</h4> | |
590 <p> | |
591 The <em>callback</em> parameter should specify a function | |
592 that looks like this: | |
593 </p> | |
594 <!-- Note: intentionally longer 80 columns --> | |
595 <pre>function(<span>string result</span>) <span class="subdued
">{...}</span>;</pre> | |
596 <dl> | |
597 <div> | |
598 <div> | |
599 <dt> | |
600 <var>result</var> | |
601 <em> | |
602 <!-- TYPE --> | |
603 <div style="display:inline"> | |
604 ( | |
605 <span id="typeTemplate"> | |
606 <span> | |
607 <span>string</span> | |
608 </span> | |
609 </span> | |
610 ) | |
611 </div> | |
612 </em> | |
613 </dt> | |
614 <dd class="todo"> | |
615 Undocumented. | |
616 </dd> | |
617 <!-- OBJECT PROPERTIES --> | |
618 <!-- OBJECT METHODS --> | |
619 <!-- OBJECT EVENT FIELDS --> | |
620 <!-- FUNCTION PARAMETERS --> | |
621 </div> | |
622 </div> | |
623 </dl> | |
624 </div> | |
625 </div> | |
626 <!-- MIN_VERSION --> | |
627 </div> <!-- /description --> | |
628 </div><div class="apiItem"> | |
629 <a name="method-hide"></a> <!-- method-anchor --> | |
630 <h4>hide</h4> | |
631 <div class="summary"> | |
632 <!-- Note: intentionally longer 80 columns --> | |
633 <span>chrome.pageAction.hide</span>(<span class="null"><span>i
nteger</span> | |
634 <var><span>tabId</span></var></span>)</div> | |
635 <div class="description"> | |
636 <p>Hides the page action.</p> | |
637 <!-- PARAMETERS --> | |
638 <h4>Parameters</h4> | |
639 <dl> | |
640 <div> | |
641 <div> | |
642 <dt> | |
643 <var>tabId</var> | |
644 <em> | |
645 <!-- TYPE --> | |
646 <div style="display:inline"> | |
647 ( | |
648 <span id="typeTemplate"> | |
649 <span> | |
650 <span>integer</span> | |
651 </span> | |
652 </span> | |
653 ) | |
654 </div> | |
655 </em> | |
656 </dt> | |
657 <dd>The id of the tab for which you want to modify the page action.</d
d> | |
658 <!-- OBJECT PROPERTIES --> | |
659 <!-- OBJECT METHODS --> | |
660 <!-- OBJECT EVENT FIELDS --> | |
661 <!-- FUNCTION PARAMETERS --> | |
662 </div> | |
663 </div> | |
664 </dl> | |
665 <!-- RETURNS --> | |
666 <dl> | |
667 </dl> | |
668 <!-- CALLBACK --> | |
669 <!-- MIN_VERSION --> | |
670 </div> <!-- /description --> | |
671 </div><div class="apiItem"> | |
672 <a name="method-setIcon"></a> <!-- method-anchor --> | |
673 <h4>setIcon</h4> | |
674 <div class="summary"> | |
675 <!-- Note: intentionally longer 80 columns --> | |
676 <span>chrome.pageAction.setIcon</span>(<span class="null"><spa
n>object</span> | |
677 <var><span>details</span></var></span><span class="optiona
l"><span>, </span><span>function</span> | |
678 <var><span>callback</span></var></span>)</div> | |
679 <div class="description"> | |
680 <p>Sets the icon for the page action. The icon can be specified
either as the path to an image file or as the pixel data from a canvas element.
Either the <b>path</b> or the <b>imageData</b> property must be specified.</p> | |
681 <!-- PARAMETERS --> | |
682 <h4>Parameters</h4> | |
683 <dl> | |
684 <div> | |
685 <div> | |
686 <dt> | |
687 <var>details</var> | |
688 <em> | |
689 <!-- TYPE --> | |
690 <div style="display:inline"> | |
691 ( | |
692 <span id="typeTemplate"> | |
693 <span> | |
694 <span>object</span> | |
695 </span> | |
696 </span> | |
697 ) | |
698 </div> | |
699 </em> | |
700 </dt> | |
701 <dd class="todo"> | |
702 Undocumented. | |
703 </dd> | |
704 <!-- OBJECT PROPERTIES --> | |
705 <dd> | |
706 <dl> | |
707 <div> | |
708 <div> | |
709 <dt> | |
710 <var>tabId</var> | |
711 <em> | |
712 <!-- TYPE --> | |
713 <div style="display:inline"> | |
714 ( | |
715 <span id="typeTemplate"> | |
716 <span> | |
717 <span>integer</span> | |
718 </span> | |
719 </span> | |
720 ) | |
721 </div> | |
722 </em> | |
723 </dt> | |
724 <dd>The id of the tab for which you want to modify the page action.</d
d> | |
725 <!-- OBJECT PROPERTIES --> | |
726 <!-- OBJECT METHODS --> | |
727 <!-- OBJECT EVENT FIELDS --> | |
728 <!-- FUNCTION PARAMETERS --> | |
729 </div> | |
730 </div><div> | |
731 <div> | |
732 <dt> | |
733 <var>imageData</var> | |
734 <em> | |
735 <!-- TYPE --> | |
736 <div style="display:inline"> | |
737 ( | |
738 <span class="optional">optional</span> | |
739 <span id="typeTemplate"> | |
740 <span> | |
741 <span>ImageData</span> | |
742 </span> | |
743 </span> | |
744 ) | |
745 </div> | |
746 </em> | |
747 </dt> | |
748 <dd>Pixel data for an image. Must be an ImageData object (for example,
from a canvas element).</dd> | |
749 <!-- OBJECT PROPERTIES --> | |
750 <!-- OBJECT METHODS --> | |
751 <!-- OBJECT EVENT FIELDS --> | |
752 <!-- FUNCTION PARAMETERS --> | |
753 </div> | |
754 </div><div> | |
755 <div> | |
756 <dt> | |
757 <var>path</var> | |
758 <em> | |
759 <!-- TYPE --> | |
760 <div style="display:inline"> | |
761 ( | |
762 <span class="optional">optional</span> | |
763 <span id="typeTemplate"> | |
764 <span> | |
765 <span>string</span> | |
766 </span> | |
767 </span> | |
768 ) | |
769 </div> | |
770 </em> | |
771 </dt> | |
772 <dd>Relative path to an image in the extension to show in the browser
action.</dd> | |
773 <!-- OBJECT PROPERTIES --> | |
774 <!-- OBJECT METHODS --> | |
775 <!-- OBJECT EVENT FIELDS --> | |
776 <!-- FUNCTION PARAMETERS --> | |
777 </div> | |
778 </div><div> | |
779 <div> | |
780 <dt> | |
781 <var>iconIndex</var> | |
782 <em> | |
783 <!-- TYPE --> | |
784 <div style="display:inline"> | |
785 ( | |
786 <span class="optional">optional</span> | |
787 <span id="typeTemplate"> | |
788 <span> | |
789 <span>integer</span> | |
790 </span> | |
791 </span> | |
792 ) | |
793 </div> | |
794 </em> | |
795 </dt> | |
796 <dd><b>Deprecated.</b> The zero-based index into the <b>icons</b> vect
or specified in the manifest.</dd> | |
797 <!-- OBJECT PROPERTIES --> | |
798 <!-- OBJECT METHODS --> | |
799 <!-- OBJECT EVENT FIELDS --> | |
800 <!-- FUNCTION PARAMETERS --> | |
801 </div> | |
802 </div> | |
803 </dl> | |
804 </dd> | |
805 <!-- OBJECT METHODS --> | |
806 <!-- OBJECT EVENT FIELDS --> | |
807 <!-- FUNCTION PARAMETERS --> | |
808 </div> | |
809 </div><div> | |
810 <div> | |
811 <dt> | |
812 <var>callback</var> | |
813 <em> | |
814 <!-- TYPE --> | |
815 <div style="display:inline"> | |
816 ( | |
817 <span class="optional">optional</span> | |
818 <span id="typeTemplate"> | |
819 <span> | |
820 <span>function</span> | |
821 </span> | |
822 </span> | |
823 ) | |
824 </div> | |
825 </em> | |
826 </dt> | |
827 <dd class="todo"> | |
828 Undocumented. | |
829 </dd> | |
830 <!-- OBJECT PROPERTIES --> | |
831 <!-- OBJECT METHODS --> | |
832 <!-- OBJECT EVENT FIELDS --> | |
833 <!-- FUNCTION PARAMETERS --> | |
834 </div> | |
835 </div> | |
836 </dl> | |
837 <!-- RETURNS --> | |
838 <dl> | |
839 </dl> | |
840 <!-- CALLBACK --> | |
841 <div> | |
842 <div> | |
843 <h4>Callback function</h4> | |
844 <p> | |
845 If you specify the <em>callback</em> parameter, it should | |
846 specify a function that looks like this: | |
847 </p> | |
848 <!-- Note: intentionally longer 80 columns --> | |
849 <pre>function(<span></span>) <span class="subdued">{...}</span
>;</pre> | |
850 <dl> | |
851 </dl> | |
852 </div> | |
853 </div> | |
854 <!-- MIN_VERSION --> | |
855 </div> <!-- /description --> | |
856 </div><div class="apiItem"> | |
857 <a name="method-setPopup"></a> <!-- method-anchor --> | |
858 <h4>setPopup</h4> | |
859 <div class="summary"> | |
860 <!-- Note: intentionally longer 80 columns --> | |
861 <span>chrome.pageAction.setPopup</span>(<span class="null"><sp
an>object</span> | |
862 <var><span>details</span></var></span>)</div> | |
863 <div class="description"> | |
864 <p>Sets the html document to be opened as a popup when the user
clicks on the page action's icon.</p> | |
865 <!-- PARAMETERS --> | |
866 <h4>Parameters</h4> | |
867 <dl> | |
868 <div> | |
869 <div> | |
870 <dt> | |
871 <var>details</var> | |
872 <em> | |
873 <!-- TYPE --> | |
874 <div style="display:inline"> | |
875 ( | |
876 <span id="typeTemplate"> | |
877 <span> | |
878 <span>object</span> | |
879 </span> | |
880 </span> | |
881 ) | |
882 </div> | |
883 </em> | |
884 </dt> | |
885 <dd class="todo"> | |
886 Undocumented. | |
887 </dd> | |
888 <!-- OBJECT PROPERTIES --> | |
889 <dd> | |
890 <dl> | |
891 <div> | |
892 <div> | |
893 <dt> | |
894 <var>tabId</var> | |
895 <em> | |
896 <!-- TYPE --> | |
897 <div style="display:inline"> | |
898 ( | |
899 <span id="typeTemplate"> | |
900 <span> | |
901 <span>integer</span> | |
902 </span> | |
903 </span> | |
904 ) | |
905 </div> | |
906 </em> | |
907 </dt> | |
908 <dd>The id of the tab for which you want to modify the page action.</d
d> | |
909 <!-- OBJECT PROPERTIES --> | |
910 <!-- OBJECT METHODS --> | |
911 <!-- OBJECT EVENT FIELDS --> | |
912 <!-- FUNCTION PARAMETERS --> | |
913 </div> | |
914 </div><div> | |
915 <div> | |
916 <dt> | |
917 <var>popup</var> | |
918 <em> | |
919 <!-- TYPE --> | |
920 <div style="display:inline"> | |
921 ( | |
922 <span id="typeTemplate"> | |
923 <span> | |
924 <span>string</span> | |
925 </span> | |
926 </span> | |
927 ) | |
928 </div> | |
929 </em> | |
930 </dt> | |
931 <dd>The html file to show in a popup. If set to the empty string ('')
, no popup is shown.</dd> | |
932 <!-- OBJECT PROPERTIES --> | |
933 <!-- OBJECT METHODS --> | |
934 <!-- OBJECT EVENT FIELDS --> | |
935 <!-- FUNCTION PARAMETERS --> | |
936 </div> | |
937 </div> | |
938 </dl> | |
939 </dd> | |
940 <!-- OBJECT METHODS --> | |
941 <!-- OBJECT EVENT FIELDS --> | |
942 <!-- FUNCTION PARAMETERS --> | |
943 </div> | |
944 </div> | |
945 </dl> | |
946 <!-- RETURNS --> | |
947 <dl> | |
948 </dl> | |
949 <!-- CALLBACK --> | |
950 <!-- MIN_VERSION --> | |
951 </div> <!-- /description --> | |
952 </div><div class="apiItem"> | |
953 <a name="method-setTitle"></a> <!-- method-anchor --> | |
954 <h4>setTitle</h4> | |
955 <div class="summary"> | |
956 <!-- Note: intentionally longer 80 columns --> | |
957 <span>chrome.pageAction.setTitle</span>(<span class="null"><sp
an>object</span> | |
958 <var><span>details</span></var></span>)</div> | |
959 <div class="description"> | |
960 <p>Sets the title of the page action. This is displayed in a too
ltip over the page action.</p> | |
961 <!-- PARAMETERS --> | |
962 <h4>Parameters</h4> | |
963 <dl> | |
964 <div> | |
965 <div> | |
966 <dt> | |
967 <var>details</var> | |
968 <em> | |
969 <!-- TYPE --> | |
970 <div style="display:inline"> | |
971 ( | |
972 <span id="typeTemplate"> | |
973 <span> | |
974 <span>object</span> | |
975 </span> | |
976 </span> | |
977 ) | |
978 </div> | |
979 </em> | |
980 </dt> | |
981 <dd class="todo"> | |
982 Undocumented. | |
983 </dd> | |
984 <!-- OBJECT PROPERTIES --> | |
985 <dd> | |
986 <dl> | |
987 <div> | |
988 <div> | |
989 <dt> | |
990 <var>tabId</var> | |
991 <em> | |
992 <!-- TYPE --> | |
993 <div style="display:inline"> | |
994 ( | |
995 <span id="typeTemplate"> | |
996 <span> | |
997 <span>integer</span> | |
998 </span> | |
999 </span> | |
1000 ) | |
1001 </div> | |
1002 </em> | |
1003 </dt> | |
1004 <dd>The id of the tab for which you want to modify the page action.</d
d> | |
1005 <!-- OBJECT PROPERTIES --> | |
1006 <!-- OBJECT METHODS --> | |
1007 <!-- OBJECT EVENT FIELDS --> | |
1008 <!-- FUNCTION PARAMETERS --> | |
1009 </div> | |
1010 </div><div> | |
1011 <div> | |
1012 <dt> | |
1013 <var>title</var> | |
1014 <em> | |
1015 <!-- TYPE --> | |
1016 <div style="display:inline"> | |
1017 ( | |
1018 <span id="typeTemplate"> | |
1019 <span> | |
1020 <span>string</span> | |
1021 </span> | |
1022 </span> | |
1023 ) | |
1024 </div> | |
1025 </em> | |
1026 </dt> | |
1027 <dd>The tooltip string.</dd> | |
1028 <!-- OBJECT PROPERTIES --> | |
1029 <!-- OBJECT METHODS --> | |
1030 <!-- OBJECT EVENT FIELDS --> | |
1031 <!-- FUNCTION PARAMETERS --> | |
1032 </div> | |
1033 </div> | |
1034 </dl> | |
1035 </dd> | |
1036 <!-- OBJECT METHODS --> | |
1037 <!-- OBJECT EVENT FIELDS --> | |
1038 <!-- FUNCTION PARAMETERS --> | |
1039 </div> | |
1040 </div> | |
1041 </dl> | |
1042 <!-- RETURNS --> | |
1043 <dl> | |
1044 </dl> | |
1045 <!-- CALLBACK --> | |
1046 <!-- MIN_VERSION --> | |
1047 </div> <!-- /description --> | |
1048 </div><div class="apiItem"> | |
1049 <a name="method-show"></a> <!-- method-anchor --> | |
1050 <h4>show</h4> | |
1051 <div class="summary"> | |
1052 <!-- Note: intentionally longer 80 columns --> | |
1053 <span>chrome.pageAction.show</span>(<span class="null"><span>i
nteger</span> | |
1054 <var><span>tabId</span></var></span>)</div> | |
1055 <div class="description"> | |
1056 <p>Shows the page action. The page action is shown whenever the
tab is selected.</p> | |
1057 <!-- PARAMETERS --> | |
1058 <h4>Parameters</h4> | |
1059 <dl> | |
1060 <div> | |
1061 <div> | |
1062 <dt> | |
1063 <var>tabId</var> | |
1064 <em> | |
1065 <!-- TYPE --> | |
1066 <div style="display:inline"> | |
1067 ( | |
1068 <span id="typeTemplate"> | |
1069 <span> | |
1070 <span>integer</span> | |
1071 </span> | |
1072 </span> | |
1073 ) | |
1074 </div> | |
1075 </em> | |
1076 </dt> | |
1077 <dd>The id of the tab for which you want to modify the page action.</d
d> | |
1078 <!-- OBJECT PROPERTIES --> | |
1079 <!-- OBJECT METHODS --> | |
1080 <!-- OBJECT EVENT FIELDS --> | |
1081 <!-- FUNCTION PARAMETERS --> | |
1082 </div> | |
1083 </div> | |
1084 </dl> | |
1085 <!-- RETURNS --> | |
1086 <dl> | |
1087 </dl> | |
1088 <!-- CALLBACK --> | |
1089 <!-- MIN_VERSION --> | |
1090 </div> <!-- /description --> | |
1091 </div> <!-- /apiItem --> | |
1092 </div> <!-- /apiGroup --> | |
1093 <!-- EVENTS --> | |
1094 <div id="eventsTemplate" class="apiGroup"> | |
1095 <a name="global-events"></a> | |
1096 <h3>Events</h3> | |
1097 <!-- iterates over all events --> | |
1098 <div class="apiItem"> | |
1099 <a name="event-onClicked"></a> | |
1100 <h4>onClicked</h4> | |
1101 <div class="summary"> | |
1102 <!-- Note: intentionally longer 80 columns --> | |
1103 <span class="subdued">chrome.pageAction.</span><span>onClicked</
span><span class="subdued">.addListener</span>(function(<span>tabs.Tab tab</span
>) <span class="subdued">{...}</span><span></span>); | |
1104 </div> | |
1105 <div class="description"> | |
1106 <p>Fired when a page action icon is clicked. This event will no
t fire if the page action has a popup.</p> | |
1107 <!-- LISTENER PARAMETERS --> | |
1108 <div> | |
1109 <h4>Listener parameters</h4> | |
1110 <dl> | |
1111 <div> | |
1112 <div> | |
1113 <dt> | |
1114 <var>tab</var> | |
1115 <em> | |
1116 <!-- TYPE --> | |
1117 <div style="display:inline"> | |
1118 ( | |
1119 <span id="typeTemplate"> | |
1120 <span> | |
1121 <a>tabs.Tab</a> | |
1122 </span> | |
1123 </span> | |
1124 ) | |
1125 </div> | |
1126 </em> | |
1127 </dt> | |
1128 <dd class="todo"> | |
1129 Undocumented. | |
1130 </dd> | |
1131 <!-- OBJECT PROPERTIES --> | |
1132 <!-- OBJECT METHODS --> | |
1133 <!-- OBJECT EVENT FIELDS --> | |
1134 <!-- FUNCTION PARAMETERS --> | |
1135 </div> | |
1136 </div> | |
1137 </dl> | |
1138 </div> | |
1139 <!-- EXTRA PARAMETERS --> | |
1140 <!-- LISTENER RETURN VALUE --> | |
1141 <dl> | |
1142 </dl> | |
1143 </div> <!-- /description --> | |
1144 <!-- /description --> | |
1145 </div> <!-- /apiItem --> | |
1146 </div> <!-- /apiGroup --> | |
1147 <!-- TYPES --> | |
1148 <!-- /apiGroup --> | |
1149 </div> <!-- /apiPage --> | |
1150 </div> <!-- /gc-pagecontent --> | |
1151 </div> <!-- /g-section --> | |
1152 </div> <!-- /codesiteContent --> | |
1153 <div id="gc-footer" --=""> | |
1154 <div class="text"> | |
1155 <p> | |
1156 Except as otherwise <a href="http://code.google.com/policies.html#restrictions
">noted</a>, | |
1157 the content of this page is licensed under the <a rel="license" href="http://c
reativecommons.org/licenses/by/3.0/">Creative Commons | |
1158 Attribution 3.0 License</a>, and code samples are licensed under the | |
1159 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic
ense</a>. | |
1160 </p> | |
1161 <p> | |
1162 ©2011 Google | |
1163 </p> | |
1164 <!-- begin analytics --> | |
1165 <script src="https://www.google-analytics.com/urchin.js" type="text/javascript">
</script> | |
1166 <script src="https://www.google-analytics.com/ga.js" type="text/javascript"></sc
ript> | |
1167 <script type="text/javascript"> | |
1168 // chrome doc tracking | |
1169 try { | |
1170 var engdocs = _gat._getTracker("YT-10763712-2"); | |
1171 engdocs._trackPageview(); | |
1172 } catch(err) {} | |
1173 // code.google.com site-wide tracking | |
1174 try { | |
1175 _uacct="UA-18071-1"; | |
1176 _uanchor=1; | |
1177 _uff=0; | |
1178 urchinTracker(); | |
1179 } | |
1180 catch(e) {/* urchinTracker not available. */} | |
1181 </script> | |
1182 <!-- end analytics --> | |
1183 </div> | |
1184 </div> <!-- /gc-footer --> | |
1185 </div> <!-- /gc-container --> | |
1186 </body></html> | |
OLD | NEW |