| OLD | NEW |
| 1 <div id="pageData-name" class="pageData">Match Patterns</div> | 1 <div id="pageData-name" class="pageData">Match Patterns</div> |
| 2 | 2 |
| 3 <p> | 3 <p> |
| 4 <a href="content_scripts.html">Content scripts</a> operate on | 4 <a href="content_scripts.html">Content scripts</a> operate on |
| 5 a set of URLs defined by match patterns. | 5 a set of URLs defined by match patterns. |
| 6 You can put one or more match patterns | 6 You can put one or more match patterns |
| 7 in the <code>"matches"</code> part of | 7 in the <code>"matches"</code> part of |
| 8 a content script's section of the manifest, | 8 a content script's section of the manifest, |
| 9 as well as in the <code>"exclude_matches"</code> section. | 9 as well as in the <code>"exclude_matches"</code> section. |
| 10 This page describes the match pattern syntax — | 10 This page describes the match pattern syntax — |
| 11 the rules you need to follow when you specify | 11 the rules you need to follow when you specify |
| 12 which URLs your content script affects. | 12 which URLs your content script affects. |
| 13 </p> | 13 </p> |
| 14 | 14 |
| 15 <p> | 15 <p> |
| 16 A match pattern is essentially a URL | 16 A match pattern is essentially a URL |
| 17 that begins with a permitted scheme (<code>http</code>, | 17 that begins with a permitted scheme (<code>http</code>, |
| 18 <code>https</code>, <code>file</code>, or <code>ftp</code>), | 18 <code>https</code>, <code>file</code>, <code>ftp</code>, or |
| 19 <code>chrome-extension</code>), |
| 19 and that can contain '<code>*</code>' characters. | 20 and that can contain '<code>*</code>' characters. |
| 20 The special pattern | 21 The special pattern |
| 21 <code><all_urls></code> matches any URL | 22 <code><all_urls></code> matches any URL |
| 22 that starts with a permitted scheme. | 23 that starts with a permitted scheme. |
| 23 Each match pattern has 3 parts:</p> | 24 Each match pattern has 3 parts:</p> |
| 24 </p> | 25 </p> |
| 25 | 26 |
| 26 <ul> | 27 <ul> |
| 27 <li> <em>scheme</em> — | 28 <li> <em>scheme</em> — |
| 28 for example, <code>http</code> or <code>file</code> | 29 for example, <code>http</code> or <code>file</code> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 44 <li> <em>path</em> — | 45 <li> <em>path</em> — |
| 45 for example, <code>/*</code>, <code>/foo* </code>, | 46 for example, <code>/*</code>, <code>/foo* </code>, |
| 46 or <code>/foo/bar </code> | 47 or <code>/foo/bar </code> |
| 47 </li> | 48 </li> |
| 48 </ul> | 49 </ul> |
| 49 | 50 |
| 50 <p>Here's the basic syntax:</p> | 51 <p>Here's the basic syntax:</p> |
| 51 | 52 |
| 52 <pre> | 53 <pre> |
| 53 <em><url-pattern></em> := <em><scheme></em>://<em><host></em><
em><path></em> | 54 <em><url-pattern></em> := <em><scheme></em>://<em><host></em><
em><path></em> |
| 54 <em><scheme></em> := '*' | 'http' | 'https' | 'file' | 'ftp' | 55 <em><scheme></em> := '*' | 'http' | 'https' | 'file' | 'ftp' | 'chrome-ext
ension' |
| 55 <em><host></em> := '*' | '*.' <em><any char except '/' and '*'></em>
+ | 56 <em><host></em> := '*' | '*.' <em><any char except '/' and '*'></em>
+ |
| 56 <em><path></em> := '/' <em><any chars></em> | 57 <em><path></em> := '/' <em><any chars></em> |
| 57 </pre> | 58 </pre> |
| 58 | 59 |
| 59 <p> | 60 <p> |
| 60 The meaning of '<code>*</code>' depends on whether | 61 The meaning of '<code>*</code>' depends on whether |
| 61 it's in the <em>scheme</em>, <em>host</em>, or <em>path</em> part. | 62 it's in the <em>scheme</em>, <em>host</em>, or <em>path</em> part. |
| 62 If the <em>scheme</em> is <code>*</code>, | 63 If the <em>scheme</em> is <code>*</code>, |
| 63 then it matches either <code>http</code> or <code>https</code>. | 64 then it matches either <code>http</code> or <code>https</code>. |
| 64 If the <em>host</em> is just <code>*</code>, | 65 If the <em>host</em> is just <code>*</code>, |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 <td><code>http:/bar</code></td> | 233 <td><code>http:/bar</code></td> |
| 233 <td>Missing <em>scheme</em> separator ("/" should be "//")</td> | 234 <td>Missing <em>scheme</em> separator ("/" should be "//")</td> |
| 234 </tr> | 235 </tr> |
| 235 | 236 |
| 236 <tr> | 237 <tr> |
| 237 <td><code>foo://*</code></td> | 238 <td><code>foo://*</code></td> |
| 238 <td>Invalid <em>scheme</em></td> | 239 <td>Invalid <em>scheme</em></td> |
| 239 </tr> | 240 </tr> |
| 240 </tbody> | 241 </tbody> |
| 241 </table> | 242 </table> |
| OLD | NEW |