Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #629 from wbamberg/804795
Browse files Browse the repository at this point in the history
fix bug 804795 Added more detail on mathcing different schemes r=@erikvold
  • Loading branch information
erikvold committed Oct 24, 2012
2 parents fa826ef + 951fd7d commit 58a0f16
Showing 1 changed file with 31 additions and 18 deletions.
49 changes: 31 additions & 18 deletions doc/module-source/sdk/page-mod/match-pattern.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ slash, and contain no wildcards.
<table>

<colgroup>
<col width="30%">
<col width="35%">
<col width="35%">
<col width="20%">
<col width="25%">
<col width="55%">
</colgroup>

<tr>
Expand All @@ -46,15 +46,15 @@ slash, and contain no wildcards.
### Wildcards ###

**A single asterisk** matches any URL with an `http`, `https`, or `ftp`
scheme. For other schemes like `file`, use a scheme followed by an
asterisk, as below.
scheme. For other schemes like `file`, `resource`, or `data`, use a scheme
followed by an asterisk, as below.

<table>

<colgroup>
<col width="30%">
<col width="35%">
<col width="35%">
<col width="20%">
<col width="25%">
<col width="55%">
</colgroup>

<tr>
Expand All @@ -70,7 +70,9 @@ asterisk, as below.
<code>ftp://example.com/</code><br>
<code>http://bar.com/foo.js</code><br>
<code>http://foo.com/</code></td>
<td><code>file://example.js</code></td>
<td><code>file://example.js</code><br>
<code>resource://me/my-addon/data/file.html</code><br>
<code>data:text/html,Hi there</code></td>
</tr>

</table>
Expand All @@ -81,9 +83,9 @@ domain or a subdomain, using any of `http`, `https`, `ftp`.
<table>

<colgroup>
<col width="30%">
<col width="35%">
<col width="35%">
<col width="20%">
<col width="25%">
<col width="55%">
</colgroup>

<tr>
Expand Down Expand Up @@ -111,9 +113,9 @@ the pattern.
<table>

<colgroup>
<col width="30%">
<col width="35%">
<col width="35%">
<col width="20%">
<col width="25%">
<col width="55%">
</colgroup>

<tr>
Expand All @@ -134,13 +136,14 @@ the pattern.
</table>

**A scheme followed by an asterisk** matches all URLs with that scheme. To
match local files, use `file://*`.
match local files, use `file://*`, and to match files loaded from your
add-on's [data](modules/sdk/self.html#data) directory, use `resource://`.

<table>

<colgroup>
<col width="30%">
<col width="70%">
<col width="20%">
<col width="80%">
</colgroup>

<tr>
Expand All @@ -154,6 +157,16 @@ match local files, use `file://*`.
<code>file:///home/file.png</code></td>
</tr>

<tr>
<td><code>"resource://*"</code></td>
<td><code>resource://my-addon-at-me-dot-org/my-addon/data/file.html</code></td>
</tr>

<tr>
<td><code>"data:*"</code></td>
<td><code>data:text/html,Hi there</code></td>
</tr>

</table>

### Regular Expressions ###
Expand Down

0 comments on commit 58a0f16

Please sign in to comment.