Skip to content

Commit b576002

Browse files
committed
Merge branch 'master' into e10s
2 parents 08798c2 + 7a4d608 commit b576002

24 files changed

Lines changed: 234 additions & 88 deletions

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
*~
22
chromium.pem
33
dummy-chromium.pem
4-
pkg/crx
5-
pkg/*.crx
6-
pkg/*.xpi
4+
pkg/
75
src/chrome/content/rules/default.rulesets
86
src/defaults/rulesets.sqlite
97
*.swp

https-everywhere-tests/test/test-httpse-installed.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,16 @@ exports["test httpse potentiallyApplicableRulesets"] = function(assert) {
2020
"Test that HTTPSE finds one applicable rule for www.eff.org");
2121
}
2222

23+
exports["test sample ruleset"] = function(assert, done) {
24+
var tabs = require("sdk/tabs");
25+
26+
tabs.on('ready', function(tab) {
27+
assert.equal(tab.url, "https://www.reddit.com/robots.txt",
28+
"Test that Reddit URLs are rewritten to HTTPS.");
29+
done();
30+
});
31+
32+
tabs.open("http://www.reddit.com/robots.txt");
33+
}
34+
2335
require("sdk/test").run(exports);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1+
// Submit SSL Observatory reports.
12
user_pref("extensions.https_everywhere._observatory.enabled", true);
3+
// Don't show any popups that might get in the way of testing.
24
user_pref("extensions.https_everywhere._observatory.popup_shown", true);
35
user_pref("extensions.https_everywhere.toolbar_hint_shown", true);
6+
// Show all logs.
47
user_pref("extensions.https_everywhere.LogLevel", 0);
8+
// Allow running of Mixed Content Blocking tests.
9+
user_pref("extensions.https_everywhere.show_ruleset_tests", true);
10+
// Make it quicker to make manual config changes.
11+
user_pref("general.warnOnAboutConfig", false);
12+
// Minimize unnecesary requests.
13+
user_pref("browser.safebrowsing.enabled", false);
14+
user_pref("browser.safebrowsing.malware.enabled", false);

makexpi.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,11 @@ if [ "$1" ] && [ "$1" != "--fast" ] ; then
135135
XPI_NAME="$XPI_NAME.xpi"
136136
else
137137
# During development, generate packages named with the short hash of HEAD.
138-
XPI_NAME="$XPI_NAME~`git rev-parse --short HEAD`.xpi"
138+
XPI_NAME="$XPI_NAME~`git rev-parse --short HEAD`"
139+
if ! git diff-index --quiet HEAD; then
140+
XPI_NAME="$XPI_NAME-dirty"
141+
fi
142+
XPI_NAME="$XPI_NAME.xpi"
139143
fi
140144

141145
[ -d pkg ] || mkdir pkg

src/chrome/content/code/HTTPS.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,18 @@ const HTTPS = {
2929
httpsForced: null,
3030
httpsForcedExceptions: null,
3131
httpsRewrite: null,
32-
32+
33+
/**
34+
* Given a channel and a list of potentially applicable rules,
35+
* redirect or abort a request if appropriate.
36+
*
37+
* @param {RuleSet[]} applicable_list A list of potentially applicable rules
38+
* (i.e. those that match on a hostname basis).
39+
* @param {nsIChannel} channel The channel to be manipulated.
40+
* @param {boolean} httpNowhereEnabled Whether to abort non-https requests.
41+
* @returns {boolean} True if the request was redirected; false if it was
42+
* untouched or aborted.
43+
*/
3344
replaceChannel: function(applicable_list, channel, httpNowhereEnabled) {
3445
var blob = HTTPSRules.rewrittenURI(applicable_list, channel.URI.clone());
3546
if (blob === null) {

src/chrome/content/rules/BGPmon.net.xml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@
99
1010
-->
1111
<ruleset name="BGPmon.net">
12-
1312
<target host="bgpmon.net" />
1413
<target host="*.bgpmon.net" />
14+
<target host="bgpmon.com" />
15+
<target host="*.bgpmon.com" />
1516

16-
17-
<!-- Not secured by server:
18-
-->
17+
<!-- Not secured by server: -->
1918
<securecookie host="^portal\.bgpmon\.net$" name=".+" />
2019

20+
<rule from="^https?://bgpmon\.(com|net)/"
21+
to="https://www.bgpmon.net/" />
2122

22-
<rule from="^http://(portal\.|www\.)?bgpmon\.net/"
23-
to="https://$1bgpmon.net/" />
24-
23+
<rule from="^http://(portal|www)?\.bgpmon\.net/"
24+
to="https://$1.bgpmon.net/" />
25+
<rule from="^http://(portal|www)?\.bgpmon\.com/"
26+
to="https://$1.bgpmon.net/" />
2527
</ruleset>

src/chrome/content/rules/Cell.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<!--
2+
Default off because of infinite loops:
3+
https://github.com/EFForg/https-everywhere/issues/493
4+
25
Nonfunctional domains:
36
47
- download (http reply)
@@ -17,9 +20,8 @@
1720
- cdn.realtidbits.com *
1821
1922
* Secured by us
20-
2123
-->
22-
<ruleset name="Cell (partial)">
24+
<ruleset name="Cell (partial)" default_off="all infinite loops">
2325

2426
<target host="cell.com" />
2527
<target host="www.cell.com" />
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<ruleset name="Deutsches Forschungsnetz">
2+
<target host="dfn.de" />
3+
<target host="*.dfn.de" />
4+
5+
<securecookie host="^(.*\.)?dfn\.de$" name=".+" />
6+
7+
<rule from="^https?://dfn\.de/"
8+
to="https://www.dfn.de/" />
9+
<rule from="^http://([^/:@]+)?\.dfn\.de/"
10+
to="https://$1.dfn.de/" />
11+
</ruleset>

src/chrome/content/rules/E-boks.dk.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
<target host="e-boks.dk" />
33
<target host="www.e-boks.dk" />
44

5+
<!-- Infinite redirects: https://github.com/EFForg/https-everywhere/issues/474
56
<rule from="^http://(www\.)?e-boks\.dk/" to="https://www.e-boks.dk/" />
7+
-->
8+
9+
<rule from="^http://logon\.e-boks\.dk/" to="https://logon.e-boks.dk/" />
610
</ruleset>
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<ruleset name="Fazekas">
2+
<target host="fazekas.hu" />
23
<target host="www.fazekas.hu" />
4+
<target host="sas.fazekas.hu" />
5+
<target host="summertime.fazekas.hu" />
36

4-
<rule from="^http://www\.fazekas\.hu/" to="https://www.fazekas.hu/" />
7+
<rule from="^http://(www\.)?fazekas\.hu/" to="https://fazekas.hu/" />
8+
<rule from="^http://sas\.fazekas\.hu/" to="https://sas.fazekas.hu/" />
9+
<rule from="^http://summertime\.fazekas\.hu/" to="https://summertime.fazekas.hu/" />
510
</ruleset>

0 commit comments

Comments
 (0)