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

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

Issue 8800006: Support chrome-extension:// scheme in URLPattern. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed merge issues in unit tests Created 9 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">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 &mdash; 10 This page describes the match pattern syntax &mdash;
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>&lt;all_urls&gt;</code> matches any URL 22 <code>&lt;all_urls&gt;</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> &mdash; 28 <li> <em>scheme</em> &mdash;
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
44 <li> <em>path</em> &mdash; 45 <li> <em>path</em> &mdash;
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>&lt;url-pattern&gt;</em> := <em>&lt;scheme&gt;</em>://<em>&lt;host&gt;</em>< em>&lt;path&gt;</em> 54 <em>&lt;url-pattern&gt;</em> := <em>&lt;scheme&gt;</em>://<em>&lt;host&gt;</em>< em>&lt;path&gt;</em>
54 <em>&lt;scheme&gt;</em> := '*' | 'http' | 'https' | 'file' | 'ftp' 55 <em>&lt;scheme&gt;</em> := '*' | 'http' | 'https' | 'file' | 'ftp' | 'chrome-ext ension'
55 <em>&lt;host&gt;</em> := '*' | '*.' <em>&lt;any char except '/' and '*'&gt;</em> + 56 <em>&lt;host&gt;</em> := '*' | '*.' <em>&lt;any char except '/' and '*'&gt;</em> +
56 <em>&lt;path&gt;</em> := '/' <em>&lt;any chars&gt;</em> 57 <em>&lt;path&gt;</em> := '/' <em>&lt;any chars&gt;</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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 </td> 180 </td>
180 181
181 <td> 182 <td>
182 http://mail.google.com/foo/baz/bar<br> 183 http://mail.google.com/foo/baz/bar<br>
183 https://mail.google.com/foobar 184 https://mail.google.com/foobar
184 </td> 185 </td>
185 </tr> 186 </tr>
186 187
187 <tr> 188 <tr>
188 <td> 189 <td>
190 <code>chrome-extension://*/* </code>
191 </td>
192
193 <td>
194 Matches any URL pointing to an extension (the first <code>*</code>
195 represents a filter for extension IDs, the second for paths).
196 </td>
197
198 <td>
199 chrome-extension://askla...asdf/options.html
200 </td>
201 </tr>
202
203 <tr>
204 <td>
189 <code>&lt;all_urls&gt;</code> 205 <code>&lt;all_urls&gt;</code>
190 </td> 206 </td>
191 207
192 <td> 208 <td>
193 Matches any URL that uses a permitted scheme. 209 Matches any URL that uses a permitted scheme.
194 (See the beginning of this section for the list of permitted 210 (See the beginning of this section for the list of permitted
195 schemes.) 211 schemes.)
196 </td> 212 </td>
197 <td> 213 <td>
198 http://example.org/foo/bar.html<br> 214 http://example.org/foo/bar.html<br>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 <td><code>http:/bar</code></td> 248 <td><code>http:/bar</code></td>
233 <td>Missing <em>scheme</em> separator ("/" should be "//")</td> 249 <td>Missing <em>scheme</em> separator ("/" should be "//")</td>
234 </tr> 250 </tr>
235 251
236 <tr> 252 <tr>
237 <td><code>foo://*</code></td> 253 <td><code>foo://*</code></td>
238 <td>Invalid <em>scheme</em></td> 254 <td>Invalid <em>scheme</em></td>
239 </tr> 255 </tr>
240 </tbody> 256 </tbody>
241 </table> 257 </table>
258
259 <p>
260 Some schemes are not supported in all contexts.
261 </p>
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/match_patterns.html ('k') | chrome/common/extensions/docs/static/webRequest.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698