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

Side by Side Diff: chrome/common/extensions/docs/match_patterns.html

Issue 2864035: Fix up extension docs to include latest changes to how file URLs work with (Closed)
Patch Set: spelling Created 10 years, 5 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
« no previous file with comments | « no previous file | chrome/common/extensions/docs/static/match_patterns.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 You can put one or more match patterns 271 You can put one or more match patterns
272 in the <code>"matches"</code> part of 272 in the <code>"matches"</code> part of
273 a content script's section of the manifest. 273 a content script's section of the manifest.
274 This page describes the match pattern syntax — 274 This page describes the match pattern syntax —
275 the rules you need to follow when you specify 275 the rules you need to follow when you specify
276 which URLs your content script affects. 276 which URLs your content script affects.
277 </p> 277 </p>
278 278
279 <p> 279 <p>
280 A match pattern is essentially a URL 280 A match pattern is essentially a URL
281 that begins with <code>http</code>, <code>https</code>, 281 that begins with a permitted scheme (<code>http</code>,
282 <code>file</code>, or <code>ftp</code>, 282 <code>https</code>, <code>file</code>, or <code>ftp</code>),
283 and that can contain '<code>*</code>' characters. 283 and that can contain '<code>*</code>' characters.
284 The special pattern
285 <code>&lt;all_urls&gt;</code> matches any URL
286 that starts with a permitted scheme.
284 Each match pattern has 3 parts:</p> 287 Each match pattern has 3 parts:</p>
285 <p></p> 288 <p></p>
286 289
287 <ul> 290 <ul>
288 <li> <em>scheme</em> — 291 <li> <em>scheme</em> —
289 for example, <code>http</code> or <code>file</code> 292 for example, <code>http</code> or <code>file</code>
293 or <code>*</code>
290 </li> 294 </li>
291 <li> <em>host</em> — 295 <li> <em>host</em> —
292 for example, <code>www.google.com</code> 296 for example, <code>www.google.com</code>
293 or <code>*.google.com</code> 297 or <code>*.google.com</code>
294 or <code>*</code>; 298 or <code>*</code>;
295 if the scheme is <code>file</code>, 299 if the scheme is <code>file</code>,
296 there is no <em>host</em> part 300 there is no <em>host</em> part
297 </li> 301 </li>
298 <li> <em>path</em> — 302 <li> <em>path</em> —
299 for example, <code>/*</code>, <code>/foo* </code>, 303 for example, <code>/*</code>, <code>/foo* </code>,
300 or <code>/foo/bar </code> 304 or <code>/foo/bar </code>
301 </li> 305 </li>
302 </ul> 306 </ul>
303 307
304 <p>Here's the basic syntax:</p> 308 <p>Here's the basic syntax:</p>
305 309
306 <pre><em>&lt;url-pattern&gt;</em> := <em>&lt;scheme&gt;</em>://<em>&lt;host&gt;< /em><em>&lt;path&gt;</em><br><em>&lt;scheme&gt;</em> := 'http' | 'https' | 'file ' | 'ftp'<br><em>&lt;host&gt;</em> := '*' | '*.' <em>&lt;any char except '/' and '*'&gt;</em>+<br><em>&lt;path&gt;</em> := '/' <em>&lt;any chars&gt;</em></pre> 310 <pre><em>&lt;url-pattern&gt;</em> := <em>&lt;scheme&gt;</em>://<em>&lt;host&gt;< /em><em>&lt;path&gt;</em>
311 <em>&lt;scheme&gt;</em> := '*' | 'http' | 'https' | 'file' | 'ftp'
312 <em>&lt;host&gt;</em> := '*' | '*.' <em>&lt;any char except '/' and '*'&gt;</em> +
313 <em>&lt;path&gt;</em> := '/' <em>&lt;any chars&gt;</em>
314 </pre>
307 315
308 <p> 316 <p>
309 The meaning of '<code>*</code>' depends on whether 317 The meaning of '<code>*</code>' depends on whether
310 it's in the <em>host</em> or the <em>path</em> part. 318 it's in the <em>scheme</em>, <em>host</em>, or <em>path</em> part.
319 If the <em>scheme</em> is <code>*</code>,
320 then it matches either <code>http</code> or <code>https</code>.
311 If the <em>host</em> is just <code>*</code>, 321 If the <em>host</em> is just <code>*</code>,
312 then it matches any host. 322 then it matches any host.
313 If the <em>host</em> is <code>*.<em>hostname</em></code>, 323 If the <em>host</em> is <code>*.<em>hostname</em></code>,
314 then it matches the specified host or any of its subdomains. 324 then it matches the specified host or any of its subdomains.
315 In the <em>path</em> section, 325 In the <em>path</em> section,
316 each '<code>*</code>' matches 0 or more characters. 326 each '<code>*</code>' matches 0 or more characters.
317 The following table shows some valid patterns. 327 The following table shows some valid patterns.
318 </p> 328 </p>
319 329
320 <table class="columns"> 330 <table class="columns">
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 415
406 <td> 416 <td>
407 Matches any URL that uses the <code>http</code> scheme 417 Matches any URL that uses the <code>http</code> scheme
408 and is on the host 127.0.0.1 418 and is on the host 127.0.0.1
409 </td> 419 </td>
410 <td> 420 <td>
411 http://127.0.0.1/<br> 421 http://127.0.0.1/<br>
412 http://127.0.0.1/foo/bar.html 422 http://127.0.0.1/foo/bar.html
413 </td> 423 </td>
414 </tr> 424 </tr>
425
426 <tr>
427 <td>
428 <code>*://mail.google.com/* </code>
429 </td>
430
431 <td>
432 Matches any URL that starts with
433 <code>http://mail.google.com</code> or
434 <code>https://mail.google.com</code>.
435 </td>
436
437 <td>
438 http://mail.google.com/foo/baz/bar<br>
439 https://mail.google.com/foobar
440 </td>
441 </tr>
442
443 <tr>
444 <td>
445 <code>&lt;all_urls&gt;</code>
446 </td>
447
448 <td>
449 Matches any URL that uses a permitted scheme.
450 (See the beginning of this section for the list of permitted
451 schemes.)
452 </td>
453 <td>
454 http://example.org/foo/bar.html<br>
455 file:///bar/baz.html
456 </td>
457 </tr>
415 </tbody> 458 </tbody>
416 </table> 459 </table>
417 460
418 <p> 461 <p>
419 Here are some examples of <em>invalid</em> pattern matches: 462 Here are some examples of <em>invalid</em> pattern matches:
420 </p> 463 </p>
421 464
422 <table class="columns"> 465 <table class="columns">
423 <tbody> 466 <tbody>
424 <tr> 467 <tr>
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 _uff=0; 684 _uff=0;
642 urchinTracker(); 685 urchinTracker();
643 } 686 }
644 catch(e) {/* urchinTracker not available. */} 687 catch(e) {/* urchinTracker not available. */}
645 </script> 688 </script>
646 <!-- end analytics --> 689 <!-- end analytics -->
647 </div> 690 </div>
648 </div> <!-- /gc-footer --> 691 </div> <!-- /gc-footer -->
649 </div> <!-- /gc-container --> 692 </div> <!-- /gc-container -->
650 </body></html> 693 </body></html>
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/docs/static/match_patterns.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698