summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-02 00:37:49 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-02 00:37:49 +0000
commit1f62425f0aef6cbe0b4ff9982ef48a7232d6afbf (patch)
tree05a0e4a008ed8d574cf325189e7c8a2303a60632 /chrome/common
parent183aa804ea52374ae1bca809516de677d94a6d95 (diff)
downloadchromium_src-1f62425f0aef6cbe0b4ff9982ef48a7232d6afbf.zip
chromium_src-1f62425f0aef6cbe0b4ff9982ef48a7232d6afbf.tar.gz
chromium_src-1f62425f0aef6cbe0b4ff9982ef48a7232d6afbf.tar.bz2
Fix up extension docs to include latest changes to how file URLs work with
content scripts. Review URL: http://codereview.chromium.org/2864035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51467 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/extensions/docs/match_patterns.html51
-rw-r--r--chrome/common/extensions/docs/static/match_patterns.html52
2 files changed, 95 insertions, 8 deletions
diff --git a/chrome/common/extensions/docs/match_patterns.html b/chrome/common/extensions/docs/match_patterns.html
index 167c589..fa0c6d3 100644
--- a/chrome/common/extensions/docs/match_patterns.html
+++ b/chrome/common/extensions/docs/match_patterns.html
@@ -278,15 +278,19 @@ which URLs your content script affects.
<p>
A match pattern is essentially a URL
-that begins with <code>http</code>, <code>https</code>,
-<code>file</code>, or <code>ftp</code>,
+that begins with a permitted scheme (<code>http</code>,
+<code>https</code>, <code>file</code>, or <code>ftp</code>),
and that can contain '<code>*</code>' characters.
+The special pattern
+<code>&lt;all_urls&gt;</code> matches any URL
+that starts with a permitted scheme.
Each match pattern has 3 parts:</p>
<p></p>
<ul>
<li> <em>scheme</em> —
for example, <code>http</code> or <code>file</code>
+ or <code>*</code>
</li>
<li> <em>host</em> —
for example, <code>www.google.com</code>
@@ -303,11 +307,17 @@ Each match pattern has 3 parts:</p>
<p>Here's the basic syntax:</p>
-<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>
+<pre><em>&lt;url-pattern&gt;</em> := <em>&lt;scheme&gt;</em>://<em>&lt;host&gt;</em><em>&lt;path&gt;</em>
+<em>&lt;scheme&gt;</em> := '*' | 'http' | 'https' | 'file' | 'ftp'
+<em>&lt;host&gt;</em> := '*' | '*.' <em>&lt;any char except '/' and '*'&gt;</em>+
+<em>&lt;path&gt;</em> := '/' <em>&lt;any chars&gt;</em>
+</pre>
<p>
The meaning of '<code>*</code>' depends on whether
-it's in the <em>host</em> or the <em>path</em> part.
+it's in the <em>scheme</em>, <em>host</em>, or <em>path</em> part.
+If the <em>scheme</em> is <code>*</code>,
+then it matches either <code>http</code> or <code>https</code>.
If the <em>host</em> is just <code>*</code>,
then it matches any host.
If the <em>host</em> is <code>*.<em>hostname</em></code>,
@@ -412,6 +422,39 @@ The following table shows some valid patterns.
http://127.0.0.1/foo/bar.html
</td>
</tr>
+
+<tr>
+ <td>
+ <code>*://mail.google.com/* </code>
+ </td>
+
+ <td>
+ Matches any URL that starts with
+ <code>http://mail.google.com</code> or
+ <code>https://mail.google.com</code>.
+ </td>
+
+ <td>
+ http://mail.google.com/foo/baz/bar<br>
+ https://mail.google.com/foobar
+ </td>
+</tr>
+
+<tr>
+ <td>
+ <code>&lt;all_urls&gt;</code>
+ </td>
+
+ <td>
+ Matches any URL that uses a permitted scheme.
+ (See the beginning of this section for the list of permitted
+ schemes.)
+ </td>
+ <td>
+ http://example.org/foo/bar.html<br>
+ file:///bar/baz.html
+ </td>
+</tr>
</tbody>
</table>
diff --git a/chrome/common/extensions/docs/static/match_patterns.html b/chrome/common/extensions/docs/static/match_patterns.html
index e30c828..ab8d7fb 100644
--- a/chrome/common/extensions/docs/static/match_patterns.html
+++ b/chrome/common/extensions/docs/static/match_patterns.html
@@ -13,15 +13,19 @@ which URLs your content script affects.
<p>
A match pattern is essentially a URL
-that begins with <code>http</code>, <code>https</code>,
-<code>file</code>, or <code>ftp</code>,
+that begins with a permitted scheme (<code>http</code>,
+<code>https</code>, <code>file</code>, or <code>ftp</code>),
and that can contain '<code>*</code>' characters.
+The special pattern
+<code>&lt;all_urls&gt;</code> matches any URL
+that starts with a permitted scheme.
Each match pattern has 3 parts:</p>
</p>
<ul>
<li> <em>scheme</em> &mdash;
for example, <code>http</code> or <code>file</code>
+ or <code>*</code>
</li>
<li> <em>host</em> &mdash;
for example, <code>www.google.com</code>
@@ -38,11 +42,18 @@ Each match pattern has 3 parts:</p>
<p>Here's the basic syntax:</p>
-<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>
+<pre>
+<em>&lt;url-pattern&gt;</em> := <em>&lt;scheme&gt;</em>://<em>&lt;host&gt;</em><em>&lt;path&gt;</em>
+<em>&lt;scheme&gt;</em> := '*' | 'http' | 'https' | 'file' | 'ftp'
+<em>&lt;host&gt;</em> := '*' | '*.' <em>&lt;any char except '/' and '*'&gt;</em>+
+<em>&lt;path&gt;</em> := '/' <em>&lt;any chars&gt;</em>
+</pre>
<p>
The meaning of '<code>*</code>' depends on whether
-it's in the <em>host</em> or the <em>path</em> part.
+it's in the <em>scheme</em>, <em>host</em>, or <em>path</em> part.
+If the <em>scheme</em> is <code>*</code>,
+then it matches either <code>http</code> or <code>https</code>.
If the <em>host</em> is just <code>*</code>,
then it matches any host.
If the <em>host</em> is <code>*.<em>hostname</em></code>,
@@ -147,6 +158,39 @@ The following table shows some valid patterns.
http://127.0.0.1/foo/bar.html
</td>
</tr>
+
+<tr>
+ <td>
+ <code>*://mail.google.com/* </code>
+ </td>
+
+ <td>
+ Matches any URL that starts with
+ <code>http://mail.google.com</code> or
+ <code>https://mail.google.com</code>.
+ </td>
+
+ <td>
+ http://mail.google.com/foo/baz/bar<br>
+ https://mail.google.com/foobar
+ </td>
+</tr>
+
+<tr>
+ <td>
+ <code>&lt;all_urls&gt;</code>
+ </td>
+
+ <td>
+ Matches any URL that uses a permitted scheme.
+ (See the beginning of this section for the list of permitted
+ schemes.)
+ </td>
+ <td>
+ http://example.org/foo/bar.html<br>
+ file:///bar/baz.html
+ </td>
+</tr>
</tbody>
</table>