diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-02 00:37:49 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-02 00:37:49 +0000 |
commit | 1f62425f0aef6cbe0b4ff9982ef48a7232d6afbf (patch) | |
tree | 05a0e4a008ed8d574cf325189e7c8a2303a60632 /chrome/common | |
parent | 183aa804ea52374ae1bca809516de677d94a6d95 (diff) | |
download | chromium_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.html | 51 | ||||
-rw-r--r-- | chrome/common/extensions/docs/static/match_patterns.html | 52 |
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><all_urls></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><url-pattern></em> := <em><scheme></em>://<em><host></em><em><path></em><br><em><scheme></em> := 'http' | 'https' | 'file' | 'ftp'<br><em><host></em> := '*' | '*.' <em><any char except '/' and '*'></em>+<br><em><path></em> := '/' <em><any chars></em></pre> +<pre><em><url-pattern></em> := <em><scheme></em>://<em><host></em><em><path></em> +<em><scheme></em> := '*' | 'http' | 'https' | 'file' | 'ftp' +<em><host></em> := '*' | '*.' <em><any char except '/' and '*'></em>+ +<em><path></em> := '/' <em><any chars></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><all_urls></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><all_urls></code> matches any URL +that starts with a permitted scheme. Each match pattern has 3 parts:</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> @@ -38,11 +42,18 @@ Each match pattern has 3 parts:</p> <p>Here's the basic syntax:</p> -<pre><em><url-pattern></em> := <em><scheme></em>://<em><host></em><em><path></em><br><em><scheme></em> := 'http' | 'https' | 'file' | 'ftp'<br><em><host></em> := '*' | '*.' <em><any char except '/' and '*'></em>+<br><em><path></em> := '/' <em><any chars></em></pre> +<pre> +<em><url-pattern></em> := <em><scheme></em>://<em><host></em><em><path></em> +<em><scheme></em> := '*' | 'http' | 'https' | 'file' | 'ftp' +<em><host></em> := '*' | '*.' <em><any char except '/' and '*'></em>+ +<em><path></em> := '/' <em><any chars></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><all_urls></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> |