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

Side by Side Diff: chrome/common/extensions/docs/experimental.discovery.html

Issue 10391034: Scaffolding for an experimental discovery API letting users inject links in the recommended pane of… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Answered review comments from PatchSet 4. Created 8 years, 7 months 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 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc. Note: 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 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 3 across api docs and should be edited only with knowledge of the
4 templating mechanism. 4 templating mechanism.
5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a 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 6 browser, it will be re-generated from the template, json schema and
7 authored overview content. 7 authored overview content.
8 4) The <body>.innerHTML is also generated by an offline step so that this 8 4) The <body>.innerHTML is also generated by an offline step so that this
9 page may easily be indexed by search engines. 9 page may easily be indexed by search engines.
10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> 10 --><html xmlns="http://www.w3.org/1999/xhtml"><head>
11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> 12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css">
13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> 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"> 14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla te_compiled.js">
15 </script> 15 </script>
16 <script type="text/javascript" src="../../../../third_party/json_minify/mini fy-sans-regexp.js"> 16 <script type="text/javascript" src="../../../../third_party/json_minify/mini fy-sans-regexp.js">
17 </script> 17 </script>
18 <script type="text/javascript" src="js/api_page_generator.js"></script> 18 <script type="text/javascript" src="js/api_page_generator.js"></script>
19 <script type="text/javascript" src="js/bootstrap.js"></script> 19 <script type="text/javascript" src="js/bootstrap.js"></script>
20 <script type="text/javascript" src="js/sidebar.js"></script> 20 <script type="text/javascript" src="js/sidebar.js"></script>
21 <title>chrome.experimental.* APIs - Google Chrome Extensions - Google Code</ti tle></head> 21 <meta name="description" content="Documentation for the chrome.experimental.di scovery module, which is part of the Google Chrome extension APIs."><title>Expe rimental Discovery APIs - Google Chrome Extensions - Google Code</title></head>
22 <body> <div id="devModeWarning" class="displayModeWarning"> 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. 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> 24 </div>
25 <div id="branchWarning" class="displayModeWarning"> 25 <div id="branchWarning" class="displayModeWarning">
26 <span>WARNING: This is the <span id="branchName">BETA</span> documentation. 26 <span>WARNING: This is the <span id="branchName">BETA</span> documentation.
27 It may not work with the stable release of Chrome.</span> 27 It may not work with the stable release of Chrome.</span>
28 <select id="branchChooser"> 28 <select id="branchChooser">
29 <option>Choose a different version... 29 <option>Choose a different version...
30 </option><option value="">Stable 30 </option><option value="">Stable
31 </option><option value="beta">Beta 31 </option><option value="beta">Beta
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 <li><a href="themes.html">Themes</a></li> 178 <li><a href="themes.html">Themes</a></li>
179 </ul> 179 </ul>
180 </li> 180 </li>
181 </ul> 181 </ul>
182 </div> 182 </div>
183 <script> 183 <script>
184 initToggles(); 184 initToggles();
185 </script> 185 </script>
186 <div class="g-unit" id="gc-pagecontent"> 186 <div class="g-unit" id="gc-pagecontent">
187 <div id="pageTitle"> 187 <div id="pageTitle">
188 <h1 class="page_title">chrome.experimental.* APIs</h1> 188 <h1 class="page_title">Experimental Discovery APIs</h1>
189 </div> 189 </div>
190 <!-- TABLE OF CONTENTS --> 190 <!-- TABLE OF CONTENTS -->
191 <div id="toc"> 191 <div id="toc">
192 <h2>Contents</h2> 192 <h2>Contents</h2>
193 <ol> 193 <ol>
194 <li> 194 <li>
195 <a href="#overview"> 195 <a href="#apiReference">API reference: chrome.experimental.disco very</a>
196 List of APIs 196 <ol>
197 </a> 197 <li>
198 <ol> 198 <a href="#global-methods">Methods</a>
199 </ol> 199 <ol>
200 </li><li> 200 <li>
201 <a href="#using">How to use experimental APIs</a> 201 <a href="#method-clearAllSuggestions">clearAllSuggestions</a>
202 <ol> 202 </li><li>
203 </ol> 203 <a href="#method-removeSuggestion">removeSuggestion</a>
204 </li><li> 204 </li><li>
205 <a href="#other">More APIs</a> 205 <a href="#method-suggest">suggest</a>
206 <ol> 206 </li>
207 </ol> 207 </ol>
208 </li> 208 </li>
209 <li>
210 <a href="#types">Types</a>
211 <ol>
212 <li>
213 <a href="#type-experimental.discovery.SuggestDetails">experiment al.discovery.SuggestDetails</a>
214 <ol>
215 </ol>
216 </li>
217 </ol>
218 </li>
219 </ol>
220 </li>
209 </ol> 221 </ol>
210 </div> 222 </div>
211 <!-- /TABLE OF CONTENTS --> 223 <!-- /TABLE OF CONTENTS -->
212 <!-- Standard content lead-in for experimental API pages --> 224 <!-- Standard content lead-in for experimental API pages -->
213 <!-- STATIC CONTENT PLACEHOLDER --> 225 <!-- STATIC CONTENT PLACEHOLDER -->
214 <div id="static"><div id="pageData-name" class="pageData">chrome.experim ental.* APIs</div> 226 <div id="static"><div id="pageData-name" class="pageData">Experimental D iscovery APIs</div>
215 <div id="pageData-showTOC" class="pageData">true</div> 227 <!-- BEGIN AUTHORED CONTENT -->
216 <p> 228 <p>The current methods allow extensions to inject suggested links in the recomme nded pane of the New Tab Page.</p>
217 Before you start, <strong>choose the right version of this page.</strong> 229 <!-- END AUTHORED CONTENT -->
218 You should read either:
219 </p>
220 <ul>
221 <li> <a href="http://code.google.com/chrome/extensions/trunk/experimental.html ">Most recent experimental APIs</a>
222 </li><li> <a href="http://code.google.com/chrome/extensions/dev/experimental.h tml">Dev channel experimental APIs</a></li>
223 </ul>
224 <p>
225 For information about browser versions such as
226 Canary (bleeding edge) and the Dev channel, see
227 <a href="http://www.chromium.org/getting-involved/dev-channel">Chrome Release Ch annels</a>.
228 For details about channel-specific docs,
229 see <a href="docs.html#versions">Doc versions</a>.
230 </p>
231 <h2 id="overview">
232 List of APIs
233 </h2>
234 <p>
235 We'd like your <a href="http://groups.google.com/a/chromium.org/group/chromium-e xtensions/topics">feedback</a>
236 on the following experimental APIs:
237 </p>
238 <ul>
239 <li>
240 <a href="experimental.app.html">experimental.app</a></li><li>
241 <a href="experimental.devtools.audits.html">experimental.devtools.audits</a></ li><li>
242 <a href="experimental.devtools.console.html">experimental.devtools.console</a> </li><li>
243 <a href="experimental.downloads.html">experimental.downloads</a></li><li>
244 <a href="experimental.fontSettings.html">experimental.fontSettings</a></li><li >
245 <a href="experimental.infobars.html">experimental.infobars</a></li><li>
246 <a href="experimental.input.ime.html">experimental.input.ime</a></li><li>
247 <a href="experimental.keybinding.html">experimental.keybinding</a></li><li>
248 <a href="experimental.mediaGalleries.html">experimental.mediaGalleries</a></li ><li>
249 <a href="experimental.offscreenTabs.html">experimental.offscreenTabs</a></li>< li>
250 <a href="experimental.speechInput.html">experimental.speechInput</a></li>
251 </ul>
252 <p>
253 Pay special attention to the following APIs,
254 which we expect to finalize soon:
255 <b>devtools</b>,
256 <b>infobars</b>,
257 <b>permissions</b>,
258 For examples of using the experimental APIs, see
259 <a href="samples.html#experimental">Samples</a>.
260 </p>
261 <p class="warning">
262 <b>Caution:</b>
263 Don't depend on these experimental APIs.
264 They might disappear,
265 and they <em>will</em> change.
266 Also, the Chrome Web Store doesn't allow you to
267 upload extensions that use experimental APIs.
268 </p>
269 <h2 id="using">How to use experimental APIs</h2>
270 <ol>
271 <li>
272 Make sure you're using either
273 <a href="http://tools.google.com/dlpage/chromesxs">Canary</a>
274 (which you can use at the same time as other Chrome channels) or the
275 <a href="http://www.chromium.org/getting-involved/dev-channel">Dev channel</a>.
276 Although the experimental APIs might work in other versions,
277 we need your feedback on the latest incarnation of the APIs,
278 which you can find in Canary and on the Dev channel.
279 </li>
280 <li>
281 Using either the
282 <a href="http://code.google.com/chrome/extensions/trunk/experimental.html">m ost recent API documentation</a> (if you're using Canary) or the
283 <a href="http://code.google.com/chrome/extensions/dev/experimental.html">API documentation for the Dev channel</a>,
284 write the code for your extension.
285 </li>
286 <li>
287 Specify the "experimental"
288 <a href="manifest.html#permissions">permission</a>
289 in your extension's manifest, like this:
290 <pre>"permissions": [
291 <b>"experimental"</b>,
292 ...
293 ],
294 </pre>
295 </li>
296 <li>
297 Enable the experimental API in your browser.
298 You can do this in either of two ways:
299 <ul>
300 <li> Go to <b>chrome://flags</b>,
301 find "Experimental Extension APIs",
302 click its "Enable" link,
303 and restart Chrome.
304 From now on,
305 unless you return to that page and disable experimental APIs,
306 you'll be able to run extensions that use experimental APIs.
307 </li>
308 <li> Specify the <b>--enable-experimental-extension-apis</b> flag
309 each time you launch the browser.
310 On Windows, you can do this by modifying
311 the properties of the shortcut that you use to launch Google Chrome.
312 For example:
313 <pre><em>path_to_chrome.exe</em> <b>--enable-experimental-extension-apis</b></pr e>
314 </li>
315 </ul>
316 </li>
317 <li>
318 <a href="http://groups.google.com/a/chromium.org/group/chromium-extensions/t opics">Give us feedback!</a>
319 Your comments and suggestions help us
320 improve the APIs and decide
321 which ones should move from experimental to supported.
322 </li>
323 </ol>
324 <h2 id="other">More APIs</h2>
325 <p>
326 For information on the standard APIs that extensions can use, see
327 <a href="api_index.html">chrome.* APIs</a> and
328 <a href="api_other.html">Other APIs</a>.
329 </p>
330 </div> 230 </div>
331 <!-- API PAGE --> 231 <!-- API PAGE -->
332 <!-- /apiPage --> 232 <div class="apiPage">
233 <a name="apiReference"></a>
234 <h2>API reference: chrome.experimental.discovery</h2>
235 <!-- PROPERTIES -->
236 <!-- /apiGroup -->
237 <!-- METHODS -->
238 <div id="methodsTemplate" class="apiGroup">
239 <a name="global-methods"></a>
240 <h3>Methods</h3>
241 <!-- iterates over all functions -->
242 <div class="apiItem">
243 <a name="method-clearAllSuggestions"></a> <!-- method-anchor -->
244 <h4>clearAllSuggestions</h4>
245 <div class="summary">
246 <!-- Note: intentionally longer 80 columns -->
247 <span>chrome.experimental.discovery.clearAllSuggestions</span> ()</div>
248 <div class="description">
249 <p>Clear all the URLs that were previously suggested for discove ry by this extension.</p>
250 <!-- PARAMETERS -->
251 <dl>
252 </dl>
253 <!-- RETURNS -->
254 <dl>
255 </dl>
256 <!-- CALLBACK -->
257 <!-- MIN_VERSION -->
258 </div> <!-- /description -->
259 </div><div class="apiItem">
260 <a name="method-removeSuggestion"></a> <!-- method-anchor -->
261 <h4>removeSuggestion</h4>
262 <div class="summary">
263 <!-- Note: intentionally longer 80 columns -->
264 <span>chrome.experimental.discovery.removeSuggestion</span>(<s pan class="null"><span>string</span>
265 <var><span>linkUrl</span></var></span>)</div>
266 <div class="description">
267 <p>Removes a URL that was previously suggested for discovery by this extension. a linkUrl previously used on a call to suggest.</p>
268 <!-- PARAMETERS -->
269 <h4>Parameters</h4>
270 <dl>
271 <div>
272 <div>
273 <dt>
274 <var>linkUrl</var>
275 <em>
276 <!-- TYPE -->
277 <div style="display:inline">
278 (
279 <span id="typeTemplate">
280 <span>
281 <span>string</span>
282 </span>
283 </span>
284 )
285 </div>
286 </em>
287 </dt>
288 <dd>The URl to remove from discovery. Must be exactly the same as</dd>
289 <!-- OBJECT PROPERTIES -->
290 <!-- OBJECT METHODS -->
291 <!-- OBJECT EVENT FIELDS -->
292 <!-- FUNCTION PARAMETERS -->
293 </div>
294 </div>
295 </dl>
296 <!-- RETURNS -->
297 <dl>
298 </dl>
299 <!-- CALLBACK -->
300 <!-- MIN_VERSION -->
301 </div> <!-- /description -->
302 </div><div class="apiItem">
303 <a name="method-suggest"></a> <!-- method-anchor -->
304 <h4>suggest</h4>
305 <div class="summary">
306 <!-- Note: intentionally longer 80 columns -->
307 <span>chrome.experimental.discovery.suggest</span>(<span class ="null"><span>experimental.discovery.SuggestDetails</span>
308 <var><span>details</span></var></span>)</div>
309 <div class="description">
310 <p>Suggests a URL for discovery.</p>
311 <!-- PARAMETERS -->
312 <h4>Parameters</h4>
313 <dl>
314 <div>
315 <div>
316 <dt>
317 <var>details</var>
318 <em>
319 <!-- TYPE -->
320 <div style="display:inline">
321 (
322 <span id="typeTemplate">
323 <span>
324 <a href="experimental.discovery.html#type-experimental.d iscovery.SuggestDetails">experimental.discovery.SuggestDetails</a>
325 </span>
326 </span>
327 )
328 </div>
329 </em>
330 </dt>
331 <dd>Detailed information on the URL to suggest.</dd>
332 <!-- OBJECT PROPERTIES -->
333 <!-- OBJECT METHODS -->
334 <!-- OBJECT EVENT FIELDS -->
335 <!-- FUNCTION PARAMETERS -->
336 </div>
337 </div>
338 </dl>
339 <!-- RETURNS -->
340 <dl>
341 </dl>
342 <!-- CALLBACK -->
343 <!-- MIN_VERSION -->
344 </div> <!-- /description -->
345 </div> <!-- /apiItem -->
346 </div> <!-- /apiGroup -->
347 <!-- EVENTS -->
348 <!-- /apiGroup -->
349 <!-- TYPES -->
350 <div class="apiGroup">
351 <a name="types"></a>
352 <h3 id="types">Types</h3>
353 <!-- iterates over all types -->
354 <div class="apiItem">
355 <a name="type-experimental.discovery.SuggestDetails"></a>
356 <h4>experimental.discovery.SuggestDetails</h4>
357 <div>
358 <dt>
359 <em>
360 <!-- TYPE -->
361 <div style="display:inline">
362 (
363 <span id="typeTemplate">
364 <span>
365 <span>object</span>
366 </span>
367 </span>
368 )
369 </div>
370 </em>
371 </dt>
372 <dd class="todo">
373 Undocumented.
374 </dd>
375 <!-- OBJECT PROPERTIES -->
376 <dd>
377 <dl>
378 <div>
379 <div>
380 <dt>
381 <var>linkText</var>
382 <em>
383 <!-- TYPE -->
384 <div style="display:inline">
385 (
386 <span id="typeTemplate">
387 <span>
388 <span>string</span>
389 </span>
390 </span>
391 )
392 </div>
393 </em>
394 </dt>
395 <dd>The linkified text. It should be relatively short.</dd>
396 <!-- OBJECT PROPERTIES -->
397 <!-- OBJECT METHODS -->
398 <!-- OBJECT EVENT FIELDS -->
399 <!-- FUNCTION PARAMETERS -->
400 </div>
401 </div><div>
402 <div>
403 <dt>
404 <var>linkUrl</var>
405 <em>
406 <!-- TYPE -->
407 <div style="display:inline">
408 (
409 <span id="typeTemplate">
410 <span>
411 <span>string</span>
412 </span>
413 </span>
414 )
415 </div>
416 </em>
417 </dt>
418 <dd>The URL to suggest and that will be displayed in the new tab page under the recommended pane.</dd>
419 <!-- OBJECT PROPERTIES -->
420 <!-- OBJECT METHODS -->
421 <!-- OBJECT EVENT FIELDS -->
422 <!-- FUNCTION PARAMETERS -->
423 </div>
424 </div><div>
425 <div>
426 <dt>
427 <var>score</var>
428 <em>
429 <!-- TYPE -->
430 <div style="display:inline">
431 (
432 <span class="optional">optional</span>
433 <span id="typeTemplate">
434 <span>
435 <span>number</span>
436 </span>
437 </span>
438 )
439 </div>
440 </em>
441 </dt>
442 <dd>A score indicating how interesting that suggestion is. The value m ust be between 0 and 1. A suggestion with score 1 is twice as likely to be displ ayed than one with a score of 0.5. Defaults to 1. TODO: need minimum=0 and maxim um=1.</dd>
443 <!-- OBJECT PROPERTIES -->
444 <!-- OBJECT METHODS -->
445 <!-- OBJECT EVENT FIELDS -->
446 <!-- FUNCTION PARAMETERS -->
447 </div>
448 </div>
449 </dl>
450 </dd>
451 <!-- OBJECT METHODS -->
452 <!-- OBJECT EVENT FIELDS -->
453 <!-- FUNCTION PARAMETERS -->
454 </div>
455 </div> <!-- /apiItem -->
456 </div> <!-- /apiGroup -->
457 </div> <!-- /apiPage -->
333 </div> <!-- /gc-pagecontent --> 458 </div> <!-- /gc-pagecontent -->
334 </div> <!-- /g-section --> 459 </div> <!-- /g-section -->
335 </div> <!-- /codesiteContent --> 460 </div> <!-- /codesiteContent -->
336 <div id="gc-footer" --=""> 461 <div id="gc-footer" --="">
337 <div class="text"> 462 <div class="text">
338 <p> 463 <p>
339 Except as otherwise <a href="http://code.google.com/policies.html#restrictions ">noted</a>, 464 Except as otherwise <a href="http://code.google.com/policies.html#restrictions ">noted</a>,
340 the content of this page is licensed under the <a rel="license" href="http://c reativecommons.org/licenses/by/3.0/">Creative Commons 465 the content of this page is licensed under the <a rel="license" href="http://c reativecommons.org/licenses/by/3.0/">Creative Commons
341 Attribution 3.0 License</a>, and code samples are licensed under the 466 Attribution 3.0 License</a>, and code samples are licensed under the
342 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic ense</a>. 467 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic ense</a>.
(...skipping 17 matching lines...) Expand all
360 _uff=0; 485 _uff=0;
361 urchinTracker(); 486 urchinTracker();
362 } 487 }
363 catch(e) {/* urchinTracker not available. */} 488 catch(e) {/* urchinTracker not available. */}
364 </script> 489 </script>
365 <!-- end analytics --> 490 <!-- end analytics -->
366 </div> 491 </div>
367 </div> <!-- /gc-footer --> 492 </div> <!-- /gc-footer -->
368 </div> <!-- /gc-container --> 493 </div> <!-- /gc-container -->
369 </body></html> 494 </body></html>
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/experimental.html ('k') | chrome/common/extensions/docs/js/api_page_generator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698