Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Side by Side Diff: chrome/common/extensions/docs/static/overview.html

Issue 5398002: doc stuff (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <div id="pageData-name" class="pageData">Overview</div> 1 <div id="pageData-name" class="pageData">Overview</div>
2 <div id="pageData-showTOC" class="pageData">true</div> 2 <div id="pageData-showTOC" class="pageData">true</div>
3 3
4 <p> 4 <p>
5 Once you've finished this page 5 Once you've finished this page
6 and the 6 and the
7 <a href="getstarted.html">Getting Started</a> tutorial, 7 <a href="getstarted.html">Getting Started</a> tutorial,
8 you'll be all set to start writing extensions. 8 you'll be all set to start writing extensions and packaged apps.
9 </p> 9 </p>
10 10
11 <p class="caution">
12 <strong>Note:</strong>
13 <em>Packaged apps</em> are implemented as extensions,
14 so unless otherwise stated,
15 everything in this page applies to packaged apps.
16 </p>
11 17
12 <h2 id="what">The basics</h2> 18 <h2 id="what">The basics</h2>
13 19
14 <p> 20 <p>
15 An extension is a zipped bundle of files &mdash; 21 An extension is a zipped bundle of files&mdash;HTML,
16 HTML, CSS, JavaScript, images, and anything else you need &mdash; 22 CSS, JavaScript, images, and anything else you need&mdash;that
17 that adds functionality to the Google Chrome browser. 23 adds functionality to the Google Chrome browser.
18 Extensions are essentially web pages, 24 Extensions are essentially web pages,
19 and they can use all the 25 and they can use all the
20 <a href="api_other.html">APIs that the browser provides to web pages</a>, 26 <a href="api_other.html">APIs that the browser provides to web pages</a>,
21 from XMLHttpRequest to JSON to HTML5. 27 from XMLHttpRequest to JSON to HTML5.
22 </p> 28 </p>
23 29
24 <p> 30 <p>
25 Many extensions add UI to Google Chrome, 31 Extensions can interact with web pages or servers using
26 in the form of 32 <a href="content_scripts.html">content scripts</a> or
27 <a href="browserAction.html">browser actions</a> 33 <a href="xhr.html">cross-origin XMLHttpRequests</a>.
28 or <a href="pageAction.html">page actions</a>.
29 Extensions can also interact programmatically 34 Extensions can also interact programmatically
30 with browser features such as 35 with browser features such as
31 <a href="bookmarks.html">bookmarks</a> 36 <a href="bookmarks.html">bookmarks</a>
32 and <a href="tabs.html">tabs</a>. 37 and <a href="tabs.html">tabs</a>.
33 To interact with web pages or servers,
34 extensions can use
35 <a href="content_scripts.html">content scripts</a> or
36 <a href="xhr.html">cross-origin XMLHttpRequests</a>.
37 </p> 38 </p>
38 39
40 <h3 id="extension-ui">Extension UIs</h3>
41
39 <p> 42 <p>
40 <b>Note:</b> 43 Many extensions&mdash;but not packaged apps&mdash;add
44 UI to Google Chrome in the form of
45 <a href="browserAction.html">browser actions</a>
46 or <a href="pageAction.html">page actions</a>.
41 Each extension can have at most one browser action or page action. 47 Each extension can have at most one browser action or page action.
42 Choose a <b>browser action</b> when the extension is relevant to most pages. 48 Choose a <b>browser action</b> when the extension is relevant to most pages.
43 Choose a <b>page action</b> when the extension's icon 49 Choose a <b>page action</b> when the extension's icon
44 should appear or disappear, 50 should appear or disappear,
45 depending on the page. 51 depending on the page.
46 </p> 52 </p>
47 53
54 <table class="columns">
55 <tr>
56 <td>
57 <img src="images/index/gmail.png"
58 width="150" height="79"
59 alt="screenshot" />
60 </td>
61 <td>
62 <img src="images/index/news.png"
63 width="150" height="79"
64 alt="screenshot" />
65 </td>
66 <td>
67 <img src="images/index/rss.png"
68 width="150" height="79"
69 alt="screenshot" />
70 </td>
71 </tr>
72
73 <tr>
74 <td>
75 This <a href="samples.html#gmail">mail extension</a>
76 uses a <em>browser action</em>
77 (icon in the toolbar).
78 </td>
79 <td>
80 This <a href="samples.html#news">news reader extension</a>
81 features a browser action that,
82 when clicked,
83 shows a <em>popup</em>.
84 </td>
85 <td>
86 This <a href="samples.html#mappy">map extension</a>
87 uses a <em>page action</em>
88 (icon in the address bar)
89 and <em>content script</em>
90 (code injected into a web page).
91 </td>
92 </tr>
93 </table>
94
48 <p> 95 <p>
96 Extensions (and packaged apps) can also present a UI in other ways,
97 such as adding to the Chrome context menu,
98 providing an options page,
99 or using a content script that changes how pages look.
49 See the <a href="devguide.html">Developer's Guide</a> 100 See the <a href="devguide.html">Developer's Guide</a>
50 for a complete list of extension features, 101 for a complete list of extension features,
51 with implementation details 102 with links to implementation details
52 for each one. 103 for each one.
53 </p> 104 </p>
54 105
106
107 <h3 id="packagedapp-ui">Packaged app UIs</h3>
108
109 <p>
110 A packaged app usually presents its main functionality using
111 an HTML page that's bundled into the app.
112 For example, the following packaged app
113 displays a Flash file within an HTML page.
114 </p>
115
116 <img src="images/index/flashapp.png"
117 width="372" height="300"
118 alt="screenshot" />
119
120 <p>
121 For more information,
122 see <a href="apps.html">Packaged Apps</a>.
123 </p>
124
55 <h2 id="files">Files</h2> 125 <h2 id="files">Files</h2>
56 <p> 126 <p>
57 Each extension has the following files: 127 Each extension has the following files:
58 <!-- PENDING: This could use a picture --> 128 <!-- PENDING: This could use a picture -->
59 </p> 129 </p>
60 130
61 <ul> 131 <ul>
62 <li>A <b>manifest file</b></li> 132 <li>A <b>manifest file</b></li>
63 <li>One or more <b>HTML files</b> (unless the extension is a theme)</li> 133 <li>One or more <b>HTML files</b> (unless the extension is a theme)</li>
64 <li><em>Optional:</em> One or more <b>JavaScript files</b></li> 134 <li><em>Optional:</em> One or more <b>JavaScript files</b></li>
65 <li><em>Optional:</em> Any other files your extension needs &mdash; 135 <li><em>Optional:</em> Any other files your extension needs&mdash;for
66 for example, image files</li> 136 example, image files</li>
67 </ul> 137 </ul>
68 138
69 <p> 139 <p>
70 While you're working on your extension, 140 While you're working on your extension,
71 you put all these files into a single folder. 141 you put all these files into a single folder.
72 When you distribute your extension, 142 When you distribute your extension,
73 the contents of the folder are packaged into a special ZIP file 143 the contents of the folder are packaged into a special ZIP file
74 that has a <code>.crx</code> suffix. 144 that has a <code>.crx</code> suffix.
75 If you put your extension in the gallery, 145 If you upload your extension using the
76 the gallery creates the <code>.crx</code> file for you. 146 <a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Develope r Dashboard</a>,
147 the <code>.crx</code> file is created for you.
77 For details on distributing extensions, 148 For details on distributing extensions,
78 see <a href="hosting.html">Hosting</a>. 149 see <a href="hosting.html">Hosting</a>.
79 </p> 150 </p>
80 151
81 152
82 <h3 id="relative-urls">Referring to files</h3> 153 <h3 id="relative-urls">Referring to files</h3>
83 154
84 <p> 155 <p>
85 You can put any file you like into an extension, 156 You can put any file you like into an extension,
86 but how do you use it? 157 but how do you use it?
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 <h2 id="incognito"> Saving data and incognito mode </h2> 373 <h2 id="incognito"> Saving data and incognito mode </h2>
303 374
304 <p> 375 <p>
305 Extensions can save data using 376 Extensions can save data using
306 the HTML5 <a href="http://dev.w3.org/html5/webstorage/">web storage API</a> 377 the HTML5 <a href="http://dev.w3.org/html5/webstorage/">web storage API</a>
307 (such as <code>localStorage</code>) 378 (such as <code>localStorage</code>)
308 or by making server requests that result in saving data. 379 or by making server requests that result in saving data.
309 Whenever you want to save something, 380 Whenever you want to save something,
310 first consider whether it's 381 first consider whether it's
311 from a window that's in incognito mode. 382 from a window that's in incognito mode.
312 By default, extensions don't run in incognito windows. 383 By default, extensions don't run in incognito windows,
313 However, users can selectively enable your extension for incognito mode, 384 and packaged apps <em>do</em>.
314 so you need to consider what a user expects 385 You need to consider what a user expects
315 from your extension in that case. 386 from your extension or packaged app
387 when the browser is incognito.
316 </p> 388 </p>
317 389
318 <p> 390 <p>
319 <em>Incognito mode</em> promises that the window will leave no tracks. 391 <em>Incognito mode</em> promises that the window will leave no tracks.
320 When dealing with data from incognito windows, 392 When dealing with data from incognito windows,
321 do your best to honor this promise. 393 do your best to honor this promise.
322 For example, if your extension normally 394 For example, if your extension normally
323 saves browsing history to the cloud, 395 saves browsing history to the cloud,
324 don't save history from incognito windows. 396 don't save history from incognito windows.
325 On the other hand, you can store 397 On the other hand, you can store
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 <ul> 437 <ul>
366 <li> <a href="getstarted.html">Tutorial: Getting Started</a> </li> 438 <li> <a href="getstarted.html">Tutorial: Getting Started</a> </li>
367 <li> <a href="tut_debugging.html">Tutorial: Debugging</a> </li> 439 <li> <a href="tut_debugging.html">Tutorial: Debugging</a> </li>
368 <li> <a href="devguide.html">Developer's Guide</a> </li> 440 <li> <a href="devguide.html">Developer's Guide</a> </li>
369 <li> <a href="http://dev.chromium.org/developers/design-documents/extensions/s amples">Samples</a> </li> 441 <li> <a href="http://dev.chromium.org/developers/design-documents/extensions/s amples">Samples</a> </li>
370 <li> <a href="http://www.youtube.com/view_play_list?p=CA101D6A85FE9D4B">Videos </a>, 442 <li> <a href="http://www.youtube.com/view_play_list?p=CA101D6A85FE9D4B">Videos </a>,
371 such as 443 such as
372 <a href="http://www.youtube.com/watch?v=B4M_a7xejYI&feature=PlayList&p=CA101 D6A85FE9D4B&index=6">Extension Message Passing</a> 444 <a href="http://www.youtube.com/watch?v=B4M_a7xejYI&feature=PlayList&p=CA101 D6A85FE9D4B&index=6">Extension Message Passing</a>
373 </li> 445 </li>
374 </ul> 446 </ul>
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/static/manifest.html ('k') | chrome/common/extensions/docs/static/packaging.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698