Skip to content

Commit c8ad923

Browse files
author
MB
committed
Merge branch 'master' of github.com:EFForg/HTTPS-Everywhere
Conflicts: src/chrome/content/rules/NLnet-Labs-cacert.xml src/chrome/content/rules/NLnet-Labs.xml src/chrome/content/rules/Warzone2100.xml
2 parents c4f0aca + 6e6d443 commit c8ad923

File tree

322 files changed

+1857
-9075
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

322 files changed

+1857
-9075
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55
path = https-everywhere-checker
66
url = https://github.com/jsha/https-everywhere-checker.git
77
branch = coverage
8+
[submodule "translations"]
9+
path = translations
10+
url = https://git.torproject.org/translation.git
11+
branch = https_everywhere

chromium/background.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* @param url: a relative URL to local XML
66
*/
7-
function getRuleXml(url) {
7+
function loadExtensionFile(url, returnType) {
88
var xhr = new XMLHttpRequest();
99
// Use blocking XHR to ensure everything is loaded by the time
1010
// we return.
@@ -14,14 +14,18 @@ function getRuleXml(url) {
1414
if (xhr.readyState != 4) {
1515
return;
1616
}
17-
return xhr.responseXML;
17+
if (returnType === 'xml') {
18+
return xhr.responseXML;
19+
}
20+
return xhr.responseText;
1821
}
1922

23+
2024
// Rules are loaded here
2125
var all_rules = new RuleSets(navigator.userAgent, LRUCache, localStorage);
22-
for (var i = 0; i < rule_list.length; i++) {
23-
all_rules.addFromXml(getRuleXml(rule_list[i]));
24-
}
26+
var rule_list = 'rules/default.rulesets';
27+
all_rules.addFromXml(loadExtensionFile(rule_list, 'xml'));
28+
2529

2630
var USER_RULE_KEY = 'userRules';
2731
// Records which tabId's are active in the HTTPS Switch Planner (see
@@ -504,7 +508,14 @@ function onBeforeRedirect(details) {
504508
}
505509

506510
// Registers the handler for requests
507-
wr.onBeforeRequest.addListener(onBeforeRequest, {urls: ["https://*/*", "http://*/*"]}, ["blocking"]);
511+
// We listen to all HTTP hosts, because RequestFilter can't handle tons of url restrictions.
512+
wr.onBeforeRequest.addListener(onBeforeRequest, {urls: ["http://*/*"]}, ["blocking"]);
513+
514+
// TODO: Listen only to the tiny subset of HTTPS hosts that we rewrite/downgrade.
515+
var httpsUrlsWeListenTo = ["https://*/*"];
516+
// See: https://developer.chrome.com/extensions/match_patterns
517+
wr.onBeforeRequest.addListener(onBeforeRequest, {urls: httpsUrlsWeListenTo}, ["blocking"]);
518+
508519

509520
// Try to catch redirect loops on URLs we've redirected to HTTPS.
510521
wr.onBeforeRedirect.addListener(onBeforeRedirect, {urls: ["https://*/*"]});

chromium/manifest.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"background": {
66
"scripts": [
77
"lru.js",
8-
"rule_list.js",
98
"rules.js",
109
"util.js",
1110
"background.js"
@@ -40,5 +39,5 @@
4039
"<all_urls>"
4140
],
4241
"update_url": "https://www.eff.org/files/https-everywhere-chrome-updates.xml",
43-
"version": "2015.7.17"
42+
"version": "2015.8.13"
4443
}

chromium/rule_list.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

chromium/util.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
VERB=1;
2-
DBUG=2;
3-
INFO=3;
4-
NOTE=4;
5-
WARN=5;
1+
"use strict";
2+
3+
var VERB=1;
4+
var DBUG=2;
5+
var INFO=3;
6+
var NOTE=4;
7+
var WARN=5;
68
// FYI: Logging everything is /very/ slow. Chrome will log & buffer
79
// these console logs even when the debug tools are closed. :(
810

911
// TODO: Add an easy UI to change the log level.
1012
// (Developers can just type DEFAULT_LOG_LEVEL=1 in the console)
11-
DEFAULT_LOG_LEVEL=4;
13+
var DEFAULT_LOG_LEVEL=4;
1214
console.log("Hey developer! Want to see more verbose logging?");
1315
console.log("Type this into the console: DEFAULT_LOG_LEVEL=1");
1416

https-everywhere-checker

https-everywhere-tests/test_profile_skeleton/prefs.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ user_pref("extensions.https_everywhere.toolbar_hint_shown", true);
66
// Show all logs.
77
user_pref("extensions.https_everywhere.LogLevel", 0);
88
user_pref("extensions.https_everywhere.log_to_stdout", true);
9-
// Allow running of Mixed Content Blocking tests.
10-
user_pref("extensions.https_everywhere.show_ruleset_tests", true);
119
// Make it quicker to make manual config changes.
1210
user_pref("general.warnOnAboutConfig", false);
1311
// Minimize unnecesary requests.

makecrx.sh

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,21 @@ RULESETS_UNVALIDATED="$PWD/pkg/rulesets.unvalidated.sqlite"
2424
RULESETS_SQLITE="$PWD/src/defaults/rulesets.sqlite"
2525

2626
if [ -n "$1" ]; then
27-
if [ "$1" = today ] ; then
28-
python chromium/setversion.py
29-
else
30-
BRANCH=`git branch | head -n 1 | cut -d \ -f 2-`
31-
SUBDIR=checkout
32-
[ -d $SUBDIR ] || mkdir $SUBDIR
33-
cp -r -f -a .git $SUBDIR
34-
cd $SUBDIR
35-
git reset --hard "$1"
36-
fi
27+
BRANCH=`git branch | head -n 1 | cut -d \ -f 2-`
28+
SUBDIR=checkout
29+
[ -d $SUBDIR ] || mkdir $SUBDIR
30+
cp -r -f -a .git $SUBDIR
31+
cd $SUBDIR
32+
git reset --hard "$1"
3733
fi
3834

3935
VERSION=`python -c "import json ; print(json.loads(open('chromium/manifest.json').read())['version'])"`
4036

4137
echo "Building chrome version" $VERSION
4238

39+
[ -d pkg ] || mkdir -p pkg
40+
[ -e pkg/crx ] && rm -rf pkg/crx
41+
4342
# Only generate the sqlite database if any rulesets have changed. Tried
4443
# implementing this with make, but make is very slow with 15k+ input files.
4544
needs_update() {
@@ -50,14 +49,11 @@ if [ ! -f "$RULESETS_UNVALIDATED" ] || needs_update ; then
5049
# Build the SQLite DB even though we don't yet use it in the Chrome extension,
5150
# because trivial-validate.py depends on it.
5251
echo "Generating sqlite DB"
53-
python2.7 ./utils/make-sqlite.py
54-
bash utils/validate.sh
52+
python2.7 ./utils/make-sqlite.py && bash utils/validate.sh
5553
fi
5654

5755
sed -e "s/VERSION/$VERSION/g" chromium/updates-master.xml > chromium/updates.xml
5856

59-
[ -d pkg ] || mkdir -p pkg
60-
[ -e pkg/crx ] && rm -rf pkg/crx
6157
mkdir -p pkg/crx/rules
6258
cd pkg/crx
6359
cp -a ../../chromium/* .

makexpi.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@ if [ -n "$1" ] && [ "$2" != "--no-recurse" ] ; then
3737
# Use the version of the build script that was current when that
3838
# tag/release/branch was made.
3939
./makexpi.sh $1 --no-recurse || exit 1
40+
41+
# Check that all the string present in the English entities file are present in
42+
# each other locale we use. A missing entity causes a nasty error at startup.
43+
# Note that we only make this check when doing tagged builds, since otherwise
44+
# the check would fail anytime someone adds a new string in the entities file,
45+
# before it is included in Transifex. Once the new string is in the master
46+
# branch, Transifex will automatically fill it in with the default English
47+
# value in all the other locales.
48+
if bash utils/compare-locales.sh pkg/$XPI_NAME.xpi >&2
49+
then
50+
echo Validation of included locales completed. >&2
51+
else
52+
die "Validation of locales failed."
53+
fi
54+
4055
# The fact that the above works even when the thing you are building predates
4156
# support for --no-recurse in this script is (1) non-intuitive; (2) crazy; and (3)
4257
# involves two pristine checkouts of $1 within each other
@@ -100,6 +115,7 @@ fi
100115
[ -d pkg ] || mkdir pkg
101116
[ -e pkg/xpi-eff ] && rm -rf pkg/xpi-eff
102117
cp -a src/ pkg/xpi-eff/
118+
cp -a translations/* pkg/xpi-eff/chrome/locale/
103119
rm -r pkg/xpi-eff/chrome/content/rules
104120
[ -e pkg/xpi-amo ] && rm -rf pkg/xpi-amo
105121
cp -a pkg/xpi-eff/ pkg/xpi-amo/

src/Changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Firefox 5.0.8 / Chrome-2015.8.13
2+
* Ruleset fixes
3+
* Restore checkbox icons on Firefox
4+
* Add a link to the HTTPS Everywhere Atlas
5+
16
Firefox 5.0.7 / Chrome-2015.7.17
27
* Ruleset fixes, in particular disable broken Netflix rule
38
* Fix "Add a rule" functionality in Chrome.

0 commit comments

Comments
 (0)