| 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 <title>Frequently Asked Questions - Google Chrome Extensions - Google Code</ti
tle></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><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">Frequently Asked Questions</h1> | |
| 189 </div> | |
| 190 <!-- TABLE OF CONTENTS --> | |
| 191 <!-- /TABLE OF CONTENTS --> | |
| 192 <!-- Standard content lead-in for experimental API pages --> | |
| 193 <!-- STATIC CONTENT PLACEHOLDER --> | |
| 194 <div id="static"><div id="pageData-name" class="pageData">Frequently Ask
ed Questions</div> | |
| 195 <!-- <div id="pageData-showTOC" class="pageData">true</div> --> | |
| 196 <p> | |
| 197 If you don't find an answer to your question here, | |
| 198 try the | |
| 199 <a href="http://code.google.com/chrome/webstore/faq.html">Chrome Web Store FAQ</
a>, the | |
| 200 <a href="http://stackoverflow.com/questions/tagged/google-chrome-extension">[goo
gle-chrome-extension] tag on Stack Overflow</a>, the | |
| 201 <a href="http://groups.google.com/a/chromium.org/group/chromium-extensions">grou
p</a>, or the | |
| 202 <a href="http://www.google.com/support/chrome_webstore/">store help</a>. | |
| 203 </p> | |
| 204 <div id="faq-TOC"> | |
| 205 <h4>General</h4> | |
| 206 <ul> | |
| 207 <li><a href="#faq-gen-01">What are Google Chrome Extensions?</a></li> | |
| 208 <li><a href="#faq-dev-01">How can I set up Chrome for extension development?
</a></li> | |
| 209 <li><a href="#faq-gen-02">What technologies are used to write extensions for
Chrome?</a></li> | |
| 210 <li><a href="#faq-gen-03">Are extensions fetched from the web every time the
browser is loaded?</a></li> | |
| 211 <li><a href="#faq-dev-14">How do I determine which version of Chrome is depl
oyed to which channel?</a></li> | |
| 212 </ul> | |
| 213 <h4>Capabilities</h4> | |
| 214 <ul> | |
| 215 <li><a href="#faq-dev-02">Can extensions make cross-domain Ajax requests?</a
></li> | |
| 216 <li><a href="#faq-dev-03">Can extensions use 3rd party web services?</a></li
> | |
| 217 <li><a href="#faq-dev-07">Can extensions encode/decode JSON data?</a></li> | |
| 218 <li><a href="#faq-dev-08">Can extensions store data locally?</a></li> | |
| 219 <li><a href="#faq-dev-04">Can extensions use OAuth?</a></li> | |
| 220 <li><a href="#faq-dev-06">Can extensions load DLLs?</a></li> | |
| 221 <li><a href="#faq-dev-05">Can extensions create UI outside of the rendered w
eb page?</a></li> | |
| 222 <li><a href="#faq-interact-chrome">Can extensions listen to clicks on Chrome
tabs and navigation buttons?</a> | |
| 223 </li><li><a href="#faq-dev-11">Can two extensions communicate with each othe
r?</a></li> | |
| 224 <li><a href="#faq-dev-13">Can extensions use Google Analytics?</a></li> | |
| 225 <li><a href="#faq-dev-15">Can extensions modify chrome:// URLs?</a></li> | |
| 226 <li><a href="#faq-open-popups">Can extensions open browser/page action popup
s without user interaction?</a></li> | |
| 227 <li><a href="#faq-persist-popups">Can extensions keep popups open after the
user clicks away from them?</a></li> | |
| 228 <li><a href="#faq-lifecycle-events">Can extensions be notified when they are
installed/uninstalled?</a></li> | |
| 229 </ul> | |
| 230 <h4>Development</h4> | |
| 231 <ul> | |
| 232 <li><a href="#faq-building-ui">How do I build a UI for my extension?</a> | |
| 233 </li><li><a href="#faq-dev-09">How much data can I store in localStorage?</a
></li> | |
| 234 <li><a href="#faq-dev-10">How do I create an options menu for my application
?</a></li> | |
| 235 <li><a href="#faq-dev-12">What debugging tools are available to extension de
velopers?</a></li> | |
| 236 <li><a href="#faq-dev-16">Why do wildcard matches not work for top level dom
ains (TLDs)?</a></li> | |
| 237 <li><a href="#faq-management">Why does the management API not fire events wh
en my extension is installed/uninstalled?</a></li> | |
| 238 <li><a href="#faq-firstrun">How can an extension determine whether it is run
ning for the first time?</a></li> | |
| 239 </ul> | |
| 240 <h4>Features and bugs</h4> | |
| 241 <ul> | |
| 242 <li><a href="#faq-fea-01">I think I've found a bug! How do I make sure it ge
ts fixed?</a></li> | |
| 243 <li><a href="#faq-fea-02">I have a feature request! How can I report it?</a>
</li> | |
| 244 </ul> | |
| 245 </div> | |
| 246 <h2>General</h2> | |
| 247 <h3 id="faq-gen-01">What are Google Chrome Extensions?</h3> | |
| 248 <p> | |
| 249 Google Chrome Extensions are applications that run inside the | |
| 250 Chrome browser and provide additional functionality, integration with third | |
| 251 party websites or services, and customized browsing experiences. | |
| 252 </p> | |
| 253 <h3 id="faq-dev-01">How can I set up Chrome for extension development?</h3> | |
| 254 <p> | |
| 255 As long as you are using a version of Chrome that supports | |
| 256 extensions, you already have everything you need to start writing an | |
| 257 extension of your own. | |
| 258 You can start by turning on Developer mode. | |
| 259 </p> | |
| 260 <p> | |
| 261 Click the wrench icon | |
| 262 <img src="images/toolsmenu.gif" height="29" width="29" alt="" class="nomargin"
> | |
| 263 and select <b>Extensions</b> from the <b>Tools</b> menu. | |
| 264 If there's a "+" next to "Developer mode", | |
| 265 click the "+" so it turns into a "-". | |
| 266 Now you can reload extensions, | |
| 267 load an unpacked directory of files as if it were a packaged extension, | |
| 268 and more. For a complete tutorial, see | |
| 269 <a href="http://code.google.com/chrome/extensions/getstarted.html">Getting Sta
rted</a>. | |
| 270 </p> | |
| 271 <h3 id="faq-gen-02">What technologies are used to write extensions for Chrome?</
h3> | |
| 272 <p> | |
| 273 Extensions are written using the same standard web | |
| 274 technologies that developers use to create websites. HTML is used as a | |
| 275 content markup language, CSS is used for styling, and JavaScript for | |
| 276 scripting. Because Chrome supports HTML5 and CSS3, developers can | |
| 277 use the latest open web technologies such as canvas and CSS animations in | |
| 278 their extensions. Extensions also have access to several | |
| 279 <a href="http://code.google.com/chrome/extensions/api_other.html">JavaScript A
PIs</a> | |
| 280 that help perform functions like JSON encoding and interacting with the | |
| 281 browser. | |
| 282 </p> | |
| 283 <h3 id="faq-gen-03">Are extensions fetched from the web every time the browser i
s loaded?</h3> | |
| 284 <p> | |
| 285 Extensions are downloaded by the Chrome browser upon install, and | |
| 286 are subsequently run off of the local disk in order to speed up | |
| 287 performance. However, if a new version of the extension is pushed online, | |
| 288 it will be automatically downloaded in the background to any users who | |
| 289 have the extension installed. Extensions may also make requests for remote | |
| 290 content at any time, in order to interact with a web service or pull new | |
| 291 content from the web. | |
| 292 </p> | |
| 293 <h3 id="faq-dev-14">How do I determine which version of Chrome is deployed to wh
ich channel?</h3> | |
| 294 <p> | |
| 295 To determine which version of Chrome is currently available on each | |
| 296 of the different platforms, visit | |
| 297 <a href="http://omahaproxy.appspot.com">omahaproxy.appspot.com</a>. On that | |
| 298 site you will see data in a format similar to: | |
| 299 </p> | |
| 300 <pre>cf,dev,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,##### | |
| 301 cf,beta,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,##### | |
| 302 cf,stable,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,##### | |
| 303 linux,dev,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,##### | |
| 304 linux,beta,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,##### | |
| 305 linux,stable,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,##### | |
| 306 mac,dev,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,##### | |
| 307 mac,beta,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,##### | |
| 308 mac,stable,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,##### | |
| 309 win,canary,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,##### | |
| 310 win,dev,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,##### | |
| 311 win,beta,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,##### | |
| 312 win,stable,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,##### | |
| 313 cros,dev,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,##### | |
| 314 cros,beta,#.#.###.#,#.#.###.#,mm/dd/yy,mm/dd/yy,#####,#####,#####</pre> | |
| 315 <p> | |
| 316 Each line represents information about a different platform and channel | |
| 317 combination. The | |
| 318 listed platforms are <code>cf</code> (Google Chrome Frame), | |
| 319 <code>linux</code>, <code>mac</code>, <code>win</code>, and | |
| 320 <code>cros</code> (Google Chrome OS). The listed | |
| 321 channels are <code>canary</code>, <code>dev</code>, <code>beta</code>, | |
| 322 and <code>stable</code>. | |
| 323 The two four-part numbers after the channel represent the current and previous | |
| 324 versions of Chrome deployed to that platform-channel | |
| 325 combination. The rest of the information is metadata about when the releases | |
| 326 were first pushed, as well as revision numbers associated with each build. | |
| 327 </p> | |
| 328 <h2>Capabilities</h2> | |
| 329 <h3 id="faq-dev-02">Can extensions make cross-domain Ajax requests?</h3> | |
| 330 <p> | |
| 331 Yes. Extensions can make cross-domain requests. See | |
| 332 <a href="http://code.google.com/chrome/extensions/xhr.html">this page</a> | |
| 333 for more information. | |
| 334 </p> | |
| 335 <h3 id="faq-dev-03">Can extensions use 3rd party web services?</h3> | |
| 336 <p> | |
| 337 Yes. Extensions are capable of making cross-domain Ajax | |
| 338 requests, so they can call remote APIs directly. APIs that provide data | |
| 339 in JSON format are particularly easy to use. | |
| 340 </p> | |
| 341 <h3 id="faq-dev-07">Can extensions encode/decode JSON data?</h3> | |
| 342 <p> | |
| 343 Yes, because V8 (Chrome's JavaScript engine) supports | |
| 344 JSON.stringify and JSON.parse natively, you may use these functions in your | |
| 345 extensions | |
| 346 <a href="http://json.org/js.html">as described here</a> without including | |
| 347 any additional JSON libraries in your code. | |
| 348 </p> | |
| 349 <h3 id="faq-dev-08">Can extensions store data locally?</h3> | |
| 350 <p> | |
| 351 Yes, extensions can use <a href="http://dev.w3.org/html5/webstorage/">localSto
rage</a> | |
| 352 to store string data permanently. Using Chrome's built-in JSON | |
| 353 functions, you can store complex data structures in localStorage. For | |
| 354 extensions that need to execute SQL queries on their stored data, | |
| 355 Chrome implements | |
| 356 <a href="http://dev.w3.org/html5/webdatabase/">client side SQL databases</a>, | |
| 357 which may be used as well. | |
| 358 </p> | |
| 359 <h3 id="faq-dev-04">Can extensions use OAuth?</h3> | |
| 360 <p> | |
| 361 Yes, there are extensions that use OAuth to access remote data | |
| 362 APIs. Most developers find it convenient to use a | |
| 363 <a href="http://unitedheroes.net/OAuthSimple/js/OAuthSimple.js">JavaScript OAu
th library</a> | |
| 364 in order to simplify the process of signing OAuth requests. | |
| 365 </p> | |
| 366 <h3 id="faq-dev-06">Can extensions load DLLs?</h3> | |
| 367 <p> | |
| 368 Yes, using the <a href="npapi.html">NPAPI interface</a>. | |
| 369 Because of the possibility for abuse, though, we will review your extension | |
| 370 before hosting it in the Chrome Web Store. | |
| 371 </p> | |
| 372 <h3 id="faq-dev-05">Can extensions create UI outside of the rendered web page?</
h3> | |
| 373 <p> | |
| 374 Yes, your extension may add buttons to the Chrome browser's user interface. | |
| 375 See <a href="browserAction.html">browser actions</a> and | |
| 376 <a href="pageAction.html">page actions</a> for more information. | |
| 377 </p> | |
| 378 <p> | |
| 379 An extension may also create popup notifications, which exist outside of the | |
| 380 browser window. See the <a href="notifications.html">desktop | |
| 381 notifications</a> documentation for more details. | |
| 382 </p> | |
| 383 <h3 id="faq-interact-chrome">Can extensions listen to clicks on Chrome tabs and | |
| 384 navigation buttons?</h3> | |
| 385 <p> | |
| 386 No. Extensions are limited to listening to the events described in the <a hre
f="api_index.html">API documentation</a>. | |
| 387 </p> | |
| 388 <h3 id="faq-dev-11">Can two extensions communicate with each other?</h3> | |
| 389 <p> | |
| 390 Yes, extensions may pass messages to other extensions. See the | |
| 391 <a href="messaging.html#external">message passing documentation</a> | |
| 392 for more information. | |
| 393 </p> | |
| 394 <h3 id="faq-dev-13">Can extensions use Google Analytics?</h3> | |
| 395 <p> | |
| 396 Yes, since extensions are built just like websites, they can use | |
| 397 <a href="http://www.google.com/analytics/">Google Analytics</a> to track | |
| 398 usage. However, we strongly advise you to modify the tracking code to pull | |
| 399 an HTTPS version of the Google Analytics library. See | |
| 400 <a href="tut_analytics.html">this tutorial</a> for more information on doing | |
| 401 this. | |
| 402 </p> | |
| 403 <h3 id="faq-dev-15">Can extensions modify chrome:// URLs?</h3> | |
| 404 <p> | |
| 405 No. The extensions APIs have been designed to minimize backwards | |
| 406 compatibility issues that can arise when new versions of the browser are | |
| 407 pushed. Allowing content scripts on <code>chrome://</code> | |
| 408 URLs would mean that developers would begin to rely on the DOM, CSS, and | |
| 409 JavaScript of these pages to stay the same. In the best case, these pages | |
| 410 could not be updated as quickly as they are being updated right now. | |
| 411 In the worst case, it could mean that an update to one | |
| 412 of these pages could cause an extension to break, causing key parts of the | |
| 413 browser to stop working for users of that extension. | |
| 414 </p> | |
| 415 <p> | |
| 416 The reason that <a href="override.html">replacing the content</a> | |
| 417 hosted at these URLs entirely is | |
| 418 allowed is because it forces an extension developer to implement all of the | |
| 419 functionality they want without depending on the browser's internal implementa
tion | |
| 420 to stay the same. | |
| 421 </p> | |
| 422 <h3 id="faq-open-popups">Can extensions open browser/page action popups without | |
| 423 user interaction?</h3> | |
| 424 <p> | |
| 425 No, popups can only be opened if the user clicks on the corresponding page or | |
| 426 browser action. An extension cannot open its popup programatically. | |
| 427 </p> | |
| 428 <h3 id="faq-persist-popups">Can extensions keep popups open after the user | |
| 429 clicks away from them?</h3> | |
| 430 <p> | |
| 431 No, popups automatically close when the user focuses on some portion of the | |
| 432 browser outside of the popup. There is no way to keep the popup open after | |
| 433 the user has clicked away. | |
| 434 </p> | |
| 435 <h3 id="faq-lifecycle-events">Can extensions be notified when they are | |
| 436 installed/uninstalled?</h3> | |
| 437 <p> | |
| 438 No, there are no events an extension can listen to in order to determine | |
| 439 whether it has been installed or uninstalled. However, an extension can | |
| 440 determine when it has been run for the first time. See <a href="#faq-firstrun
">this FAQ entry</a> for information. | |
| 441 </p> | |
| 442 <h2>Development</h2> | |
| 443 <h3 id="faq-building-ui">How do I build a UI for my extension?</h3> | |
| 444 <p> | |
| 445 Extensions use HTML and CSS to define their user interfaces, so you can use | |
| 446 standard form controls to build your UI, or style the interface with CSS, | |
| 447 as you would a web page. Additionally, extensions can add | |
| 448 <a href="#faq-dev-05">some limited UI elements to Chrome itself.</a> | |
| 449 </p> | |
| 450 <h3 id="faq-dev-09">How much data can I store in localStorage?</h3> | |
| 451 <p> | |
| 452 Extensions can store up to 5MB of data in localStorage. | |
| 453 </p> | |
| 454 <h3 id="faq-dev-10">How do I create an options menu for my application?</h3> | |
| 455 <p> | |
| 456 You can let users set options for your extension by creating an | |
| 457 <a href="http://code.google.com/chrome/extensions/trunk/options.html">options
page</a>, | |
| 458 which is a simple HTML page that will be loaded when a user clicks the | |
| 459 "options" button for your extension. This page can read and write settings | |
| 460 to localStorage, or even send options to a web server so that they can be | |
| 461 persisted across browsers. | |
| 462 </p> | |
| 463 <h3 id="faq-dev-12">What debugging tools are available to extension developers?<
/h3> | |
| 464 <p> | |
| 465 Chrome's built-in developer tools can be used to debug extensions | |
| 466 as well as web pages. See this | |
| 467 <a href="http://code.google.com/chrome/extensions/tut_debugging.html ">tutoria
l on debugging extensions</a> | |
| 468 for more information. | |
| 469 </p> | |
| 470 <h3 id="faq-dev-16">Why do wildcard matches not work for top level domains | |
| 471 (TLDs)?</h3> | |
| 472 <p> | |
| 473 You cannot use wildcard match patterns like <code>http://google.*/*</code> | |
| 474 to match TLDs (like <code>http://google.es</code> and | |
| 475 <code>http://google.fr</code>) due to the | |
| 476 complexity of actually restricting such a match to only the desired domains. | |
| 477 </p> | |
| 478 <p> | |
| 479 For the example of <code>http://google.*/*</code>, the Google domains would | |
| 480 be matched, but so would <code>http://google.someotherdomain.com</code>. | |
| 481 Additionally, many sites do not own all of the TLDs for their | |
| 482 domain. For an example, assume you want to use | |
| 483 <code>http://example.*/*</code> to match <code>http://example.com</code> and | |
| 484 <code>http://example.es</code>, but <code>http://example.net</code> is a | |
| 485 hostile site. If your extension has a bug, the hostile site could potentially | |
| 486 attack your extension in order to get access to your extension's increased | |
| 487 privileges. | |
| 488 </p> | |
| 489 <p> | |
| 490 You should explicitly enumerate the TLDs that you wish to run | |
| 491 your extension on. | |
| 492 </p> | |
| 493 <h3 id="faq-management">Why does the management API not fire events when my | |
| 494 extension is installed/uninstalled?</h3> | |
| 495 <p> | |
| 496 The <a href="management.html">management API</a> was intended to help create | |
| 497 new tab page replacement extensions. It was not intended to fire | |
| 498 install/uninstall events for the current extension. | |
| 499 </p> | |
| 500 <h3 id="faq-firstrun">How can an extension determine whether it is running for | |
| 501 the first time?</h3> | |
| 502 <p> | |
| 503 An extension can check to see whether it is running for the first time by | |
| 504 checking for the presence of a value in localStorage, and writing the value if | |
| 505 it does not exist. For example: | |
| 506 </p> | |
| 507 <pre>var firstRun = (localStorage['firstRun'] == 'true'); | |
| 508 if (!firstRun) { | |
| 509 localStorage['firstRun'] = 'true'; | |
| 510 }</pre> | |
| 511 <p> | |
| 512 Note that this check should be run in a background page, not a content script. | |
| 513 </p> | |
| 514 <h2>Features and bugs</h2> | |
| 515 <h3 id="faq-fea-01">I think I've found a bug! How do I make sure it gets | |
| 516 fixed?</h3> | |
| 517 <p> | |
| 518 While developing an extension, you may find behavior that does not | |
| 519 match the extensions documentation and may be the result of a bug in | |
| 520 Chrome. The best thing to do is to make sure an appropriate issue | |
| 521 report is filed, and the Chromium team has enough information to reproduce | |
| 522 the behavior. | |
| 523 </p> | |
| 524 <p>The steps you should follow to ensure this are:</p> | |
| 525 <ol> | |
| 526 <li> | |
| 527 Come up with a <em>minimal</em> test extension that demonstrates the issue | |
| 528 you wish to report. This extension should have as little code as possible | |
| 529 to demonstrate the bug—generally this should be 100 lines of | |
| 530 code or less. Many times, developers find that they cannot reproduce their | |
| 531 issues this way, which is a good indicator that the bug is in their own | |
| 532 code. | |
| 533 </li> | |
| 534 <li> | |
| 535 Search the issue tracker at | |
| 536 <a href="http://www.crbug.com">http://www.crbug.com</a> to see whether | |
| 537 someone has reported a similar issue. Most issues related to | |
| 538 extensions are filed under <strong>Feature=Extensions</strong>, so to | |
| 539 look for an extension bug related to the | |
| 540 chrome.tabs.executeScript function (for example), search for | |
| 541 "<code>Feature=Extensions Type=Bug chrome.tabs.executeScript</code>", | |
| 542 which will give you | |
| 543 <a href="http://code.google.com/p/chromium/issues/list?can=2&q=Feature%3
DExtensions+Type%3DBug+chrome.tabs.executeScript&colspec=ID+Stars+Pri+Area+F
eature+Type+Status+Summary+Modified+Owner+Mstone+OS&x=mstone&y=area&
cells=tiles"> | |
| 544 this list of results</a>. | |
| 545 </li> | |
| 546 <li> | |
| 547 If you find a bug that describes your issue, click the star icon to be | |
| 548 notified when the bug receives an update. <em>Do not respond to the | |
| 549 bug to say "me too" or ask "when will this be fixed?"</em>; such updates | |
| 550 can cause hundreds of emails to be sent. Add a comment only if you have | |
| 551 information (such as a better test case or a suggested fix) that is likely | |
| 552 to be helpful. | |
| 553 </li> | |
| 554 <li> | |
| 555 If you found no appropriate bug to star, file a new issue report at | |
| 556 <a href="http://new.crbug.com">http://new.crbug.com</a>. Be as explicit | |
| 557 as possible when filling out this form: choose a descriptive title, | |
| 558 explain the steps to reproduce the bug, and describe the expected and | |
| 559 actual behavior. Attach your test example to the report and add | |
| 560 screenshots if appropriate. The easier your report makes it for others | |
| 561 to reproduce your issue, the greater chance that your bug will be fixed | |
| 562 promptly. | |
| 563 </li> | |
| 564 <li> | |
| 565 Wait for the bug to be updated. Most new bugs are triaged within a week, | |
| 566 although it can sometimes take longer for an update. <em>Do not reply | |
| 567 to the bug to ask when the issue will be fixed.</em> If your bug has not | |
| 568 been modified after two weeks, please post a message to the | |
| 569 <a href="http://groups.google.com/a/chromium.org/group/chromium-extensions/t
opics"> | |
| 570 discussion group</a> with a link back to your bug. | |
| 571 </li> | |
| 572 <li> | |
| 573 If you originally reported your bug on the discussion group and were | |
| 574 directed to this FAQ entry, reply to your original thread with a link | |
| 575 to the bug you starred or reported. This will make it easier for others | |
| 576 experiencing the same issue to find the correct bug. | |
| 577 </li> | |
| 578 </ol> | |
| 579 <h3 id="faq-fea-02">I have a feature request! How can I report it?</h3> | |
| 580 <p>If you identify a feature (especially if it's related to an experimental | |
| 581 API) that could be added to improve the extension development experience, | |
| 582 make sure an appropriate request is filed in the issue tracker.</p> | |
| 583 <p>The steps you should follow to ensure this are:</p> | |
| 584 <ol> | |
| 585 <li> | |
| 586 Search the issue tracker at | |
| 587 <a href="http://www.crbug.com">http://www.crbug.com</a> to see whether | |
| 588 someone has requested a similar feature. Most requests related to | |
| 589 extensions are filed under <strong>Feature=Extensions</strong>, so to | |
| 590 look for an extension feature request related to keyboard shortcuts | |
| 591 (for example), search | |
| 592 for "<code>Feature=Extensions Type=Feature shortcuts</code>", | |
| 593 which will give you | |
| 594 <a href="http://code.google.com/p/chromium/issues/list?can=2&q=Feature%3
DExtensions+Type%3DFeature+shortcuts&colspec=ID+Stars+Pri+Area+Feature+Type+
Status+Summary+Modified+Owner+Mstone+OS&x=mstone&y=area&cells=tiles"
> | |
| 595 this list of results</a>. | |
| 596 </li> | |
| 597 <li> | |
| 598 If you find a ticket that matches your request, click the star icon to be | |
| 599 notified when the bug receives an update. <em>Do not respond to the | |
| 600 bug to say "me too" or ask "when will this be implemented?"</em>; such | |
| 601 updates can cause hundreds of emails to be sent. | |
| 602 </li> | |
| 603 <li> | |
| 604 If you found no appropriate ticket to star, file a new request at | |
| 605 <a href="http://new.crbug.com">http://new.crbug.com</a>. Be as detailed | |
| 606 as possible when filling out this form: choose a descriptive title | |
| 607 and explain exactly what feature you would like and how you plan to use it. | |
| 608 </li> | |
| 609 <li> | |
| 610 Wait for the ticket to be updated. Most new requests are triaged within a | |
| 611 week, although it can sometimes take longer for an update. <em>Do not reply | |
| 612 to the ticket to ask when the feature will be added.</em> If your | |
| 613 ticket has not been modified after two weeks, please post a message to the | |
| 614 <a href="http://groups.google.com/a/chromium.org/group/chromium-extensions/t
opics"> | |
| 615 discussion group</a> with a link back to your request. | |
| 616 </li> | |
| 617 <li> | |
| 618 If you originally reported your request on the discussion group and were | |
| 619 directed to this FAQ entry, reply to your original thread with a link | |
| 620 to the ticket you starred or opened. This will make it easier for others | |
| 621 with the same request to find the correct ticket. | |
| 622 </li> | |
| 623 </ol> | |
| 624 </div> | |
| 625 <!-- API PAGE --> | |
| 626 <!-- /apiPage --> | |
| 627 </div> <!-- /gc-pagecontent --> | |
| 628 </div> <!-- /g-section --> | |
| 629 </div> <!-- /codesiteContent --> | |
| 630 <div id="gc-footer" --=""> | |
| 631 <div class="text"> | |
| 632 <p> | |
| 633 Except as otherwise <a href="http://code.google.com/policies.html#restrictions
">noted</a>, | |
| 634 the content of this page is licensed under the <a rel="license" href="http://c
reativecommons.org/licenses/by/3.0/">Creative Commons | |
| 635 Attribution 3.0 License</a>, and code samples are licensed under the | |
| 636 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic
ense</a>. | |
| 637 </p> | |
| 638 <p> | |
| 639 ©2011 Google | |
| 640 </p> | |
| 641 <!-- begin analytics --> | |
| 642 <script src="https://www.google-analytics.com/urchin.js" type="text/javascript">
</script> | |
| 643 <script src="https://www.google-analytics.com/ga.js" type="text/javascript"></sc
ript> | |
| 644 <script type="text/javascript"> | |
| 645 // chrome doc tracking | |
| 646 try { | |
| 647 var engdocs = _gat._getTracker("YT-10763712-2"); | |
| 648 engdocs._trackPageview(); | |
| 649 } catch(err) {} | |
| 650 // code.google.com site-wide tracking | |
| 651 try { | |
| 652 _uacct="UA-18071-1"; | |
| 653 _uanchor=1; | |
| 654 _uff=0; | |
| 655 urchinTracker(); | |
| 656 } | |
| 657 catch(e) {/* urchinTracker not available. */} | |
| 658 </script> | |
| 659 <!-- end analytics --> | |
| 660 </div> | |
| 661 </div> <!-- /gc-footer --> | |
| 662 </div> <!-- /gc-container --> | |
| 663 </body></html> | |
| OLD | NEW |