66< p >
77 This page describes how to write rulesets for
88 < a href ="https://eff.org/https-everywhere "> HTTPS Everywhere</ a > ,
9- the Firefox add-on that switches sites over from HTTP
9+ the Firefox and Chrom* add-on that switches sites over from HTTP
1010 to HTTPS automatically. HTTPS Everywhere comes with
1111 < a href ="http://www.eff.org/https-everywhere/atlas/ "> thousands</ a >
1212 of rulesets that tell HTTPS Everywhere which sites it should switch
@@ -28,8 +28,8 @@ <h4>Rulesets</h4>
2828</ p >
2929
3030< pre >
31- <ruleset name=" RabbitMQ" >
32- <target host=" rabbitmq.com" />
31+ <ruleset name=" RabbitMQ" >
32+ <target host=" rabbitmq.com" />
3333 <target host="www.rabbitmq.com" />
3434
3535 <rule from="^http:"
@@ -41,12 +41,12 @@ <h4>Rulesets</h4>
4141 The < tt > target</ tt > tag specifies which web sites the ruleset applies
4242 to. The < tt > rule</ tt > tag specifies how URLs on those web sites should be
4343 rewritten. This rule says that any URLs on < tt > rabbitmq.com</ tt > and
44- < tt > www.rabbitmq.com</ tt > should be modified by replacing " http:" with
45- " https:" .
44+ < tt > www.rabbitmq.com</ tt > should be modified by replacing " http:" with
45+ " https:" .
4646</ p >
4747
4848< p >
49- When Firefox loads a URL, HTTPS Everywhere takes the host
49+ When the browser loads a URL, HTTPS Everywhere takes the host
5050 name (e.g. < tt > www.rabbitmq.com</ tt > ) and searches its ruleset database for
5151 rulesets that match that host name.
5252</ p >
@@ -64,14 +64,14 @@ <h4>Wildcard Targets</h4>
6464</ a >
6565
6666< p >
67- To cover all of a domain' s subdomains, you may want to specify
67+ To cover all of a domain' s subdomains, you may want to specify
6868 a wildcard target like < tt > *.twitter.com</ tt > . Specifying
6969 this type of left-side wildcard matches any host name with
7070 < tt > .twitter.com</ tt > as a suffix, e.g. < tt > www.twitter.com</ tt >
7171 or < tt > urls.api.twitter.com</ tt > . You can also specify a
7272 right-side wildcard like < tt > www.google.*</ tt > . Right-side
7373 wildcards, unlike left-side wildcards, apply only one level
74- deep. So if you want to cover all countries you' ll generally
74+ deep. So if you want to cover all countries you' ll generally
7575 need to specify < tt > www.google.*</ tt > , < tt > www.google.co.*</ tt > ,
7676 and < tt > www.google.com.*</ tt > to cover domains like
7777 < tt > www.google.co.uk</ tt > or < tt > www.google.com.au</ tt > . You should
@@ -88,16 +88,16 @@ <h4>Rules and Regular Expressions</h4>
8888 The < tt > rule</ tt > tags do the actual rewriting work. The < tt > from</ tt > attribute of
8989 each rule is a < a href ="http://www.regular-expressions.info/quickstart.html "
9090 > regular expression</ a > matched against a full URL. You can use rules to rewrite
91- URLs in simple or complicated ways. Here' s a simplified (and now obsolete) example
91+ URLs in simple or complicated ways. Here' s a simplified (and now obsolete) example
9292 for Wikipedia:
9393</ p >
9494
9595< pre >
96- <ruleset name=" Wikipedia" >
97- <target host=" *.wikipedia.org" />
96+ <ruleset name=" Wikipedia" >
97+ <target host=" *.wikipedia.org" />
9898
99- <rule from=" ^http://(\w{2})\.wikipedia\.org/wiki/"
100- to=" https://secure.wikimedia.org/wikipedia/$1/wiki/" />
99+ <rule from=" ^http://(\w{2})\.wikipedia\.org/wiki/"
100+ to=" https://secure.wikimedia.org/wikipedia/$1/wiki/" />
101101</ruleset>
102102</ pre >
103103
@@ -112,7 +112,7 @@ <h4>Rules and Regular Expressions</h4>
112112 < tt > http://fr.wikipedia.org/wiki/Chose</ tt > to
113113 < tt > https://secure.wikimedia.org/wikipedia/fr/wiki/Chose</ tt > . Notice,
114114 again, that the target is allowed to contain (just one) * as a wildcard
115- meaning " any" .
115+ meaning " any" .
116116</ p >
117117
118118< p >
@@ -141,12 +141,12 @@ <h4>Rules and Regular Expressions</h4>
141141</ p >
142142
143143< pre >
144- <exclusion pattern=" ^http://(?:\w+\.)?stack(?:exchange|overflow)\.com/users/authenticate/" />
144+ <exclusion pattern=" ^http://(?:\w+\.)?stack(?:exchange|overflow)\.com/users/authenticate/" />
145145</ pre >
146146
147147< p >
148148 Exclusions are always evaluated before rules in a given ruleset. Matching any
149- exclusion means that a URL won' t match any rules within the same ruleset.
149+ exclusion means that a URL won' t match any rules within the same ruleset.
150150 However, if other rulesets match the same target hosts, the rules in those
151151 rulesets will still be tried.
152152</ p >
@@ -157,7 +157,7 @@ <h4>Style Guide</h4>
157157
158158< p >
159159There are many different ways you can write a ruleset, or regular expression
160- within the ruleset. It' s easier for everyone to understand the rulesets if they
160+ within the ruleset. It' s easier for everyone to understand the rulesets if they
161161follow similar practices. You should read and follow the
162162< a href ="https://github.com/EFForg/https-everywhere/blob/master/ruleset-style.md "> Ruleset
163163style guide</ a > . Some of the guidelines in that document are intended to make < a
@@ -176,17 +176,17 @@ <h4>Secure Cookies</h4>
176176Everywhere provides a facility for turning this flag on. For instance:
177177</ p >
178178
179- < pre > <securecookie host=" ^market\.android\.com$" name=".+" /></ pre >
179+ < pre > <securecookie host=" ^market\.android\.com$" name=".+" /></ pre >
180180
181181< p >
182- The " host" parameter is a regexp specifying which domains
183- should have their cookies secured; the " name" parameter is a
182+ The " host" parameter is a regexp specifying which domains
183+ should have their cookies secured; the " name" parameter is a
184184regexp specifying which cookies should be secured. For a cookie to be secured,
185185it must be sent by a target host for that ruleset. It must also be sent over
186186HTTPS and match the name regexp. For cookies set by Javascript in a web page,
187- the Firefox extension can' t tell which host set the cookie and instead uses
187+ the Firefox extension can' t tell which host set the cookie and instead uses
188188the domain attribute of the cookie to check against target hosts. A cookie whose
189- domain attribute starts with a "." (the default, if not specified by
189+ domain attribute starts with a "." (the default, if not specified by
190190Javascript) will be matched as if it was sent from a host
191191name made by stripping the leading dot.
192192</ p >
@@ -205,7 +205,7 @@ <h4>Testing</h4>
205205And each of those test URLs must load, both before rewriting and after
206206rewriting. Every target host tag generates an implicit test URL unless it
207207contains a wildcard. You can add additional test URLs manually using the
208- < tt > <test url=" ..." /></ tt > tag. The test URLs you add this way should be
208+ < tt > <test url=" ..." /></ tt > tag. The test URLs you add this way should be
209209real pages loaded from the site, or real images, CSS, and Javascript if you have rules that
210210specifically affect those resources.
211211</ p >
@@ -221,7 +221,7 @@ <h4>Testing</h4>
221221</ p >
222222
223223< p >
224- If you' ve tested your rule and are sure it would
224+ If you' ve tested your rule and are sure it would
225225 be of use to the world at large, submit it as a < a
226226 href ="https://help.github.com/articles/using-pull-requests/ "> pull
227227 request</ a > on our < a
@@ -239,24 +239,24 @@ <h4>make-trivial-rule</h4>
239239can run from a Unix command line to automate the process of creating
240240a simple rule for a specified domain. These scripts are not included
241241with HTTPS Everywhere releases but are available in our development
242- repository and are described in < a href ="development "> our development
242+ repository and are described in < a href ="https://www.eff.org/https-everywhere/ development "> our development
243243documentation</ a > .
244244
245245< a name ="default-off " href ="#default-off ">
246246 < h4 > Disabling a ruleset by default</ h4 >
247247</ a >
248248< p >
249249Sometimes rulesets are useful or interesting, but cause problems
250- that make them unsuitable for being enabled by default in everyone' s
250+ that make them unsuitable for being enabled by default in everyone' s
251251browsers. Typically when a ruleset has problems we will disable it by
252252default until someone has time to fix it. You can do this by adding
253253a < tt > default_off</ tt > attribute to the ruleset element, with a value
254254explaining why the rule is off.
255255</ p >
256256< pre >
257- <ruleset name=" Amazon (buggy)" default_off=" breaks site" >
258- <target host=" www.amazon.*" />
259- <target host=" amazon.*" />
257+ <ruleset name=" Amazon (buggy)" default_off=" breaks site" >
258+ <target host=" www.amazon.*" />
259+ <target host=" amazon.*" />
260260</ruleset>
261261</ pre >
262262
@@ -275,13 +275,13 @@ <h4>Mixed Content Blocking (MCB)</h4>
275275 href ="https://trac.torproject.org/projects/tor/ticket/6975 "> Chrome</ a > and
276276 Firefox, before HTTPS Everywhere has a chance to rewrite the URLs to an HTTPS
277277 version. This generally breaks the site.
278- However, the Tor Browser doesn' t block mixed content, in order to allow HTTPS
279- Everywhere to try andrewrite the URLs to an HTTPS version.
278+ However, the Tor Browser doesn' t block mixed content, in order to allow HTTPS
279+ Everywhere to try and rewrite the URLs to an HTTPS version.
280280</ p >
281281
282282< p >
283283 To enable a rule only on platforms that allow mixed content (currently
284- only the Tor Browser), you can add a < tt > platform=" mixedcontent" </ tt >
284+ only the Tor Browser), you can add a < tt > platform=" mixedcontent" </ tt >
285285 attribute to the ruleset element.
286286</ p >
287287
@@ -296,6 +296,6 @@ <h4>HTTPS->HTTP downgrade rules</h4>
296296 links to resources which do not exist on the HTTPS part of the site.
297297 This is very rare, especially because these resources will typically be blocked
298298 by < a href ="#mixed-content "> Mixed Content Blocking</ a > . If it necessary, you can
299- add a < tt > downgrade="1" </ tt > attribute to the rule to make it easier to audit
299+ add a < tt > downgrade="1" </ tt > attribute to the rule to make it easier to audit
300300 the ruleset library for such rules.
301301</ p >
0 commit comments