Skip to content

Commit 4a7001f

Browse files
author
Micah Lee
committed
Merge remote-tracking branch 'yan/master'
Conflicts: src/chrome/content/rules/Yandex.xml
2 parents 4d56915 + b050aec commit 4a7001f

32 files changed

Lines changed: 339 additions & 139 deletions

hooks/update

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/sh
2+
#
3+
# Hook script to validate rules and check locales before accepting
4+
# pushed changes on the server side.
5+
# See http://stackoverflow.com/questions/4541417/how-can-i-make-it-so-git-rejects-pushing-code-that-wont-compile
6+
#
7+
# By default, this should run in the root of the git repository.
8+
9+
# --- Command line
10+
refname="$1"
11+
oldrev="$2"
12+
newrev="$3"
13+
14+
# --- Safety check
15+
if [ -z "$GIT_DIR" ]; then
16+
echo "Don't run this script from the command line." >&2
17+
echo " (if you want, you could supply GIT_DIR then run" >&2
18+
echo " $0 <ref> <oldrev> <newrev>)" >&2
19+
exit 1
20+
fi
21+
22+
if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
23+
echo "Usage: $0 <ref> <oldrev> <newrev>" >&2
24+
exit 1
25+
fi
26+
27+
# --- Copy the state of the repository as of the new pushed code
28+
29+
maindir=$(git rev-parse --show-toplevel)
30+
cd "$maindir"
31+
copydir="./tmp/git_hook_compile_copy"
32+
33+
echo "making copy of $newrev to $copydir" >&2
34+
rm -rf "$copydir"
35+
mkdir "$copydir"
36+
git archive $newrev | tar -x -C $copydir/
37+
if [ "$?" != "0" ]; then
38+
echo "*** unable to make copy of code" >&2
39+
exit 1
40+
fi
41+
echo "attempting to validate $newrev" >&2
42+
43+
# --- Test build
44+
45+
if [ -f makexpi.sh ]; then
46+
./makexpi.sh
47+
if [ "$?" != 0 ]; then
48+
echo "*** build failed" >&2
49+
exit 1
50+
else
51+
exit 0
52+
fi
53+
else
54+
echo "*** could not find makexpi.sh" >&2
55+
exit 1
56+
fi
57+

src/chrome/content/code/HTTPS.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const HTTPS = {
3737
if (!uri) this.log(WARN, "OH NO BAD ARGH\nARGH");
3838

3939
var c2 = channel.QueryInterface(CI.nsIHttpChannel);
40-
this.log(DBUG,"Redirection limit is " + c2.redirectionLimit);
40+
this.log(DBUG, channel.URI.spec+": Redirection limit is " + c2.redirectionLimit);
4141
// XXX This used to be (c2.redirectionLimit == 1), but that's very
4242
// inefficient in a case (eg amazon) where this may happen A LOT.
4343
// Rather than number like 10, we should use the starting value

src/chrome/content/code/HTTPSRules.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,11 +484,13 @@ const HTTPSRules = {
484484
blob.newuri = rs[i].transformURI(uri);
485485
if (blob.newuri) {
486486
// we rewrote the uri
487-
if (alist)
487+
this.log(DBUG, "Rewrote "+input_uri.spec);
488+
if (alist) {
488489
if (uri.spec in https_everywhere_blacklist)
489-
alist.breaking_rule(rs[i])
490+
alist.breaking_rule(rs[i]);
490491
else
491492
alist.active_rule(rs[i]);
493+
}
492494
if (userpass_present) blob.newuri.userPass = input_uri.userPass;
493495
blob.applied_ruleset = rs[i];
494496
return blob;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<ruleset name="3bbwifi.com">
2+
<target host="3bbwifi.com" />
3+
<target host="www.3bbwifi.com" />
4+
5+
<rule from="^http://(www\.)?3bbwifi\.com/" to="https://www.3bbwifi.com/" />
6+
</ruleset>

src/chrome/content/rules/9gag.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<ruleset name="9gag">
1+
<ruleset name="9gag" default_off="broken">
22
<target host="9gag.com"/>
33
<target host="*.9gag.com"/>
44

src/chrome/content/rules/About-Ads.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
<target host="aboutads.info" />
44
<target host="*.aboutads.info" />
5-
<exclusion pattern="^http://(?:www\.)?aboutads\.info/choices/" />
5+
<exclusion pattern="^http://(?:www\.)?aboutads\.info/(choices)/" />
66

7-
8-
<securecookie host="^(?:.*\.)?aboutads\.info$" name=".+" />
7+
<!-- comment this out so that www.aboutads.info/choices page
8+
will not throw a "First Party Cookies Not Enabled" error
9+
<securecookie host="^(?:.*\.)?aboutads\.info$" name=".+" /> -->
910

1011

1112
<rule from="^http://(?:www\.)?aboutads\.info/"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<ruleset name="Blognone.com">
2+
<target host="blognone.com" />
3+
<target host="www.blognone.com" />
4+
5+
<rule from="^http://(www\.)?blognone\.com/" to="https://www.blognone.com/" />
6+
</ruleset>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<ruleset name="Craigslist.org">
2+
<!-- As of 8/2013, craigslist.org will redirect back to HTTP, but not subdomains. -->
3+
<target host="craigslist.org" />
4+
<target host="*.craigslist.org" />
5+
6+
<rule from="^http://(www\.)?craigslist\.org/" to="https://www.craigslist.org/" />
7+
<rule from="^http://([^/:@]*)\.craigslist\.org/" to="https://$1.craigslist.org/" />
8+
</ruleset>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<ruleset name="Dealfish.co.th">
2+
<target host="dealfish.co.th" />
3+
<target host="www.dealfish.co.th" />
4+
5+
<rule from="^http://(www\.)?dealfish\.co\.th/" to="https://www.dealfish.co.th/" />
6+
</ruleset>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<ruleset name="Etravelway.com">
2+
<target host="etravelway.com" />
3+
<target host="www.etravelway.com" />
4+
5+
<rule from="^http://(www\.)?etravelway\.com/" to="https://www.etravelway.com/" />
6+
</ruleset>

0 commit comments

Comments
 (0)