tbb-commits
Threads by month
- ----- 2026 -----
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 1 participants
- 19926 discussions
[tor-browser-bundle/master] Build go-webrtc and snowflake in the mac pluggable-transports descriptor.
by gk@torproject.org 14 Jul '17
by gk@torproject.org 14 Jul '17
14 Jul '17
commit 26e0cd44f2886bfad1c3d30844ff7a21eb9d0478
Author: David Fifield <david(a)bamsoftware.com>
Date: Wed Jul 5 22:57:22 2017 -0700
Build go-webrtc and snowflake in the mac pluggable-transports descriptor.
I had to apply two tricks to get a reproducible snowflake-client.
The first is to use faketime to eliminate some timestamps. There were 11
variable timestamps in the file. Through experimentation, I found that
10 of them were dependent on the Go runtime (recompiling Go caused them
to change) and 1 was dependent on snowflake-client itself (recompiling
snowflake-client with the same runtime changed only that 1 timestamp).
The underlying issue has to do with clang 3.8.0 on Darwin embedding
timestamps, unsolved in the Go issue tracker as of 13 days ago.
https://github.com/golang/go/issues/9206#issuecomment-310476743
The second is a sed command to clobber embedded paths of the form
/tmp/go-buildXXXXXXXXX and /tmp/go-link-XXXXXXXXX. Their presence is
caused by some combination of Clang and Darwin, and there is as yet no
known workaround upstream.
---
.../mac/gitian-pluggable-transports.yml | 71 +++++++++++++++++++++-
gitian/mkbundle-mac.sh | 2 +-
2 files changed, 71 insertions(+), 2 deletions(-)
diff --git a/gitian/descriptors/mac/gitian-pluggable-transports.yml b/gitian/descriptors/mac/gitian-pluggable-transports.yml
index 75ad899..ebfcaa9 100644
--- a/gitian/descriptors/mac/gitian-pluggable-transports.yml
+++ b/gitian/descriptors/mac/gitian-pluggable-transports.yml
@@ -6,7 +6,9 @@ suites:
architectures:
- "amd64"
packages:
+- "faketime"
- "unzip"
+- "pkg-config"
- "zip"
reference_datetime: "2000-01-01 00:00:00"
remotes:
@@ -24,6 +26,12 @@ remotes:
"dir": "goxnet"
- "url": "https://git.torproject.org/pluggable-transports/obfs4.git"
"dir": "obfs4"
+- "url": "https://github.com/keroserene/go-webrtc.git"
+ "dir": "go-webrtc"
+- "url": "https://git.torproject.org/pluggable-transports/snowflake.git"
+ "dir": "snowflake"
+- "url": "https://github.com/dchest/uniuri.git"
+ "dir": "uniuri"
files:
- "versions"
- "go14.tar.gz"
@@ -31,6 +39,7 @@ files:
- "clang-linux64-jessie-utils.zip"
- "cctools.tar.gz"
- "MacOSX10.7.sdk.tar.gz"
+- "webrtc-mac64-gbuilt.zip"
- "dzip.sh"
script: |
INSTDIR="$HOME/install"
@@ -59,6 +68,8 @@ script: |
tar xaf MacOSX10.7.sdk.tar.gz
# Preparing clang for cross-compilation, setting the proper flags and
# variables
+ # "go link" expects to find a program called "dsymutil" exactly.
+ ln -sf x86_64-apple-darwin10-dsymutil $HOME/build/cctools/bin/dsymutil
# ld needs libLTO.so from llvm
export LD_LIBRARY_PATH="$HOME/build/clang/lib"
export PATH="$HOME/build/cctools/bin:$PATH"
@@ -93,7 +104,12 @@ script: |
export GOARCH=amd64
tar xvf go.tar.gz
cd go/src
- CGO_ENABLED=1 CC_FOR_TARGET="$CC_FOR_TARGET" CC= CFLAGS= LDFLAGS= ./make.bash
+ # faketime is needed because clang 3.8.0 on Darwin embeds the timestamps of
+ # certain intermediate object files (including those that arise here while
+ # compiling the Go runtime itself). Without this, variable timestamps would
+ # end up in snowflake-client.
+ # https://github.com/golang/go/issues/9206#issuecomment-310476743
+ CGO_ENABLED=1 CC_FOR_TARGET="$CC_FOR_TARGET" CC= CFLAGS= LDFLAGS= faketime -f "$REFERENCE_DATETIME" ./make.bash
cd ../..
export PATH="$PATH:$PWD/go/bin"
@@ -138,6 +154,14 @@ script: |
go install github.com/dchest/siphash
cd ..
+ # Building go uniuri
+ cd uniuri
+ find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
+ mkdir -p "$GOPATH/src/github.com/dchest/"
+ ln -sf "$PWD" "$GOPATH/src/github.com/dchest/uniuri"
+ go install github.com/dchest/uniuri
+ cd ..
+
# Building golang.org/x/crypto (obfs4proxy > 0.0.3 || Go >= 1.4)
cd goxcrypto
find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
@@ -166,6 +190,51 @@ script: |
cp -a obfs4proxy $PTDIR
cd ../..
+ unzip webrtc-mac64-gbuilt.zip
+ export SDKROOT="$PWD/MacOSX10.7.sdk"
+
+ # Building go-webrtc
+ cd go-webrtc
+ # Replace the prebuilt webrtc library with our own one.
+ rm -rf include/ lib/
+ ln -sf ../webrtc/{include,lib} .
+ find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
+ mkdir -p "$GOPATH/src/github.com/keroserene/"
+ ln -sf "$PWD" "$GOPATH/src/github.com/keroserene/go-webrtc"
+ CFLAGS="$FLAGS -mmacosx-version-min=10.7"
+ CXXFLAGS="$FLAGS -stdlib=libc++ -mmacosx-version-min=10.7"
+ LDFLAGS="$FLAGS -stdlib=libc++ -mmacosx-version-min=10.7"
+ GOARCH=amd64 CGO_ENABLED=1 CGO_CFLAGS="$CFLAGS" CGO_CXXFLAGS="$CXXFLAGS" CGO_LDFLAGS="$LDFLAGS" CC="$HOME/build/clang/bin/clang" CXX="$HOME/build/clang/bin/clang++" go install github.com/keroserene/go-webrtc
+ cd ..
+
+ # Building snowflake
+ cd snowflake
+ find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
+ cd client
+ # See the faketime comment above. Without faketime, snowflake-client would
+ # contain the timestamp of the temporary client.a file created during
+ # "go build".
+ GOARCH=amd64 CGO_ENABLED=1 CGO_CFLAGS="$CFLAGS" CGO_CXXFLAGS="$CXXFLAGS" CGO_LDFLAGS="$LDFLAGS" CC="$HOME/build/clang/bin/clang" CXX="$HOME/build/clang/bin/clang++" faketime -f "$REFERENCE_DATETIME" go build -ldflags '-s'
+ # Hack: Overwrite variable absolute paths embedded in the binary. clang 3.8.0
+ # on Darwin embeds such paths and the issue is unsolved in upstream Go as of
+ # 2016-06-28:
+ # https://github.com/golang/go/issues/9206#issuecomment-310476743
+ # The two kinds of paths are ("000000000" stands for 9 random digits):
+ # /tmp/go-build000000000
+ # /tmp/go-link-000000000
+ # Such paths are the output of ioutil.TempDir("", "go-build") and
+ # ioutil.TempDir("", "go-link-").
+ cp -a client client.stomped
+ sed -i -E -e 's#(/tmp/go-build|/tmp/go-link-)[0-9]{9}/#\1XXXXXXXXX/#g' client.stomped
+ # Sanity check: make sure the file actually changed. If it did not, it could
+ # mean that a change in go or clang has made this step unnecessary.
+ cmp client client.stomped && (echo "No paths replaced in snowflake-client. Maybe the replacement failed or is no longer needed. Check descriptors/mac/gitian-pluggable-transports.yml"; exit 1)
+ cp -a client.stomped $PTDIR/snowflake-client
+ cd ..
+ mkdir -p $INSTDIR/Docs/snowflake
+ cp -a README.md LICENSE $INSTDIR/Docs/snowflake
+ cd ..
+
# Grabbing the result
cd $INSTDIR
~/build/dzip.sh pluggable-transports-mac64-gbuilt.zip TorBrowserBundle.app
diff --git a/gitian/mkbundle-mac.sh b/gitian/mkbundle-mac.sh
index 646aca6..7bf546e 100755
--- a/gitian/mkbundle-mac.sh
+++ b/gitian/mkbundle-mac.sh
@@ -240,7 +240,7 @@ then
echo "****** Starting Pluggable Transports Component of Mac Bundle (5/6 for Mac) ******"
echo
- ./bin/gbuild -j $NUM_PROCS -m $VM_MEMORY --commit goptlib=$GOPTLIB_TAG,meek=$MEEK_TAG,ed25519=$GOED25519_TAG,siphash=$GOSIPHASH_TAG,goxcrypto=$GO_X_CRYPTO_TAG,goxnet=$GO_X_NET_TAG,obfs4=$OBFS4_TAG $DESCRIPTOR_DIR/mac/gitian-pluggable-transports.yml
+ ./bin/gbuild -j $NUM_PROCS -m $VM_MEMORY --commit goptlib=$GOPTLIB_TAG,meek=$MEEK_TAG,ed25519=$GOED25519_TAG,siphash=$GOSIPHASH_TAG,goxcrypto=$GO_X_CRYPTO_TAG,goxnet=$GO_X_NET_TAG,obfs4=$OBFS4_TAG,go-webrtc=$GO_WEBRTC_TAG,snowflake=$SNOWFLAKE_TAG,uniuri=$UNIURI_TAG $DESCRIPTOR_DIR/mac/gitian-pluggable-transports.yml
if [ $? -ne 0 ];
then
#mv var/build.log ./firefox-fail-mac.log.`date +%Y%m%d%H%M%S`
1
0
commit fcdc2be0a2da32a939e172564300d5a09259b75e
Author: David Fifield <david(a)bamsoftware.com>
Date: Wed Jul 5 22:55:39 2017 -0700
Build webrtc for mac.
---
gitian/descriptors/mac/gitian-webrtc.yml | 139 ++++++++++++++
gitian/mkbundle-mac.sh | 41 ++++-
gitian/patches/webrtc-mac.patch | 305 +++++++++++++++++++++++++++++++
3 files changed, 475 insertions(+), 10 deletions(-)
diff --git a/gitian/descriptors/mac/gitian-webrtc.yml b/gitian/descriptors/mac/gitian-webrtc.yml
new file mode 100644
index 0000000..c5f0509
--- /dev/null
+++ b/gitian/descriptors/mac/gitian-webrtc.yml
@@ -0,0 +1,139 @@
+---
+name: "webrtc-mac"
+distro: "debian"
+suites:
+- "jessie"
+architectures:
+- "amd64"
+packages:
+- "unzip"
+- "zip"
+- "libglib2.0-dev"
+- "libgtk2.0-dev"
+- "pkg-config"
+- "python-biplist"
+reference_datetime: "2000-01-01 00:00:00"
+remotes:
+- "url": "https://chromium.googlesource.com/chromium/tools/depot_tools.git"
+ "dir": "depot_tools"
+files:
+- "versions"
+- "clang-linux64-jessie-utils.zip"
+- "cctools.tar.gz"
+- "MacOSX10.7.sdk.tar.gz"
+- "dzip.sh"
+- "webrtc.tar.gz"
+- "webrtc-mac.patch"
+script: |
+ INSTDIR="$HOME/install"
+ source versions
+ export REFERENCE_DATETIME
+ export TZ=UTC
+ export LC_ALL=C
+ umask 0022
+ #
+ mkdir -p $OUTDIR/
+
+ # Setting up depot_tools
+ # https://dev.chromium.org/developers/how-tos/install-depot-tools
+ export PATH="$PATH:$PWD/depot_tools"
+ # Disable automatic updating.
+ export DEPOT_TOOLS_UPDATE=0
+
+ # Extracting all the necessary tools
+ tar xaf cctools.tar.gz
+ unzip clang-linux64-jessie-utils.zip
+ tar xaf MacOSX10.7.sdk.tar.gz
+ export SDKROOT="$PWD/MacOSX10.7.sdk"
+ # src/build/toolchain/mac/filter_libtool.py wants libtool to be called exactly "libtool".
+ ln -sf x86_64-apple-darwin10-libtool $HOME/build/cctools/bin/libtool
+ # ld needs libLTO.so from llvm
+ export LD_LIBRARY_PATH="$HOME/build/clang/lib"
+ export PATH="$HOME/build/cctools/bin:$PATH"
+ export AR=x86_64-apple-darwin10-ar
+ # Certain cross-compiling flags are set in webrtc-mac.patch because the build
+ # system doesn't honor CFLAGS etc. environment variables.
+
+ # Building webrtc
+ tar xaf webrtc.tar.gz
+ cd webrtc/src
+ patch -p1 < ../../webrtc-mac.patch
+
+ # The linux descriptor builds its own copy of gn, using tools/gn/bootstrap/bootstrap.py.
+ # I tried that here, but for some reason the gn so built doesn't work. On "gn gen",
+ # it crashes with this error:
+ # [0624/022439.767916:FATAL:command_gen.cc(59)] Check failed: !rule.empty().
+ # Instead, use the gn packaged with depot_tools.
+ GN="$HOME/build/depot_tools/gn"
+
+ # Hardcode the output of some utility programs that otherwise require Xcode
+ # tools, like xcode-select, xcodebuild, sw_vers, and xcrun. This probably
+ # needs to be kept in sync with the SDK version.
+ cat <<EOF > build/mac/find_sdk.py
+ print("$SDKROOT")
+ print("10.7")
+ EOF
+ cat <<EOF > build/config/mac/sdk_info.py
+ print("machine_os_build=\"10.7\"")
+ print("sdk_build=\"10.7\"")
+ print("sdk_path=\"$SDKROOT\"")
+ print("sdk_platform_path=\"$SDKROOT\"")
+ print("sdk_version=\"10.7\"")
+ print("xcode_build=\"7.3\"")
+ print("xcode_version=\"0730\"")
+ EOF
+
+ export GN_ARGS=""
+ # For a list of all possible GN args, do "gn gen out/Release; gn args --list out/Release".
+ # https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/cross…
+ GN_ARGS+=" target_os=\"mac\" target_cpu=\"x64\" mac_deployment_target=\"10.7\""
+ # Not debug.
+ GN_ARGS+=" is_debug=false"
+ # There are warnings from unused returns.
+ GN_ARGS+=" treat_warnings_as_errors=false"
+ # Build static libraries.
+ GN_ARGS+=" is_component_build=false"
+ # Do not use bundled utilities.
+ GN_ARGS+=" is_clang=false use_sysroot=false"
+ GN_ARGS+=" clang_use_chrome_plugins=false"
+ GN_ARGS+=" clang_base_path=\"$HOME/build/clang\""
+ GN_ARGS+=" gold_path=\"$INSTDIR/binutils/bin\""
+ # Avoid some dependencies.
+ GN_ARGS+=" rtc_include_opus=false rtc_include_ilbc=false rtc_include_internal_audio_device=false"
+ # Tests are needed for field_trial, metrics_default, and pc_test_utils targets
+ # (which include code needed by go-webrtc).
+ GN_ARGS+=" rtc_include_tests=true"
+ # Make sure not to use bundled clang and binutils.
+ rm -rf third_party/llvm-build
+ rm -rf third_party/binutils
+ rm -rf out/Release
+ "$GN" gen out/Release --args="$GN_ARGS"
+ ninja -C out/Release webrtc field_trial metrics_default pc_test_utils
+ # The cctools ar doesn't have the 'D' deterministic option of GNU ar, but the
+ # ZERO_AR_DATE environment variable similarly sets timestamps within the
+ # archive to zero.
+ # https://opensource.apple.com/source/cctools/cctools-886/ar/archive.c.auto.h…
+ # https://codereview.chromium.org/699083004/
+ # .o files under out/Release/obj/ are the build outputs. Don't include .o
+ # files from elsewhere under out/ because they are build helpers and things
+ # like that, not necessarily of the target architecture, and anyway are not
+ # needed.
+ # https://bugs.torproject.org/22832
+ ZERO_AR_DATE=1 "$AR" crs libwebrtc-magic.a $(find out/Release/obj -name '*.o' | sort)
+ # ZERO_AR_DATE additionally sets the mtime of the .a file itself to zero
+ # (1970-01-01), so change it to match everything else.
+ touch --date="$REFERENCE_DATETIME" libwebrtc-magic.a
+ cd ../..
+
+ # Grabbing the result
+ cd $INSTDIR
+ mkdir -p webrtc/include webrtc/lib
+ cp -f $HOME/build/webrtc/src/libwebrtc-magic.a webrtc/lib/libwebrtc-darwin-amd64-magic.a
+ INCLUDE_DIR="$PWD/webrtc/include"
+ (cd $HOME/build/webrtc/src && for h in $(find talk/ webrtc/ -type f -name '*.h'); do
+ mkdir -p "$INCLUDE_DIR/$(dirname $h)"
+ cp -f "$h" "$INCLUDE_DIR/$h"
+ done)
+
+ ~/build/dzip.sh webrtc-mac64-gbuilt.zip webrtc
+ cp webrtc-mac64-gbuilt.zip $OUTDIR/
diff --git a/gitian/mkbundle-mac.sh b/gitian/mkbundle-mac.sh
index 7f02f05..646aca6 100755
--- a/gitian/mkbundle-mac.sh
+++ b/gitian/mkbundle-mac.sh
@@ -140,7 +140,7 @@ if [ ! -f inputs/clang-$CLANG_VER-linux64-jessie-utils.zip -o \
! -f inputs/libevent-${LIBEVENT_TAG_ORIG#release-}-mac64-utils.zip ];
then
echo
- echo "****** Starting Utilities Component of Mac Bundle (1/5 for Mac) ******"
+ echo "****** Starting Utilities Component of Mac Bundle (1/6 for Mac) ******"
echo
./bin/gbuild -j $NUM_PROCS -m $VM_MEMORY --commit libevent=$LIBEVENT_TAG,faketime=$FAKETIME_TAG,cmake=$CMAKE_TAG,llvm=$LLVM_TAG,clang=$CLANG_TAG $DESCRIPTOR_DIR/mac/gitian-utils.yml
if [ $? -ne 0 ];
@@ -158,7 +158,7 @@ then
#cp -a result/utils-mac-res.yml inputs/
else
echo
- echo "****** SKIPPING already built Utilities Component of Mac Bundle (1/5 for
+ echo "****** SKIPPING already built Utilities Component of Mac Bundle (1/6 for
Mac) ******"
echo
# We might have built the utilities in the past but maybe the links are
@@ -173,7 +173,7 @@ fi
if [ ! -f inputs/tor-mac64-gbuilt.zip ];
then
echo
- echo "****** Starting Tor Component of Mac Bundle (2/5 for Mac) ******"
+ echo "****** Starting Tor Component of Mac Bundle (2/6 for Mac) ******"
echo
./bin/gbuild -j $NUM_PROCS -m $VM_MEMORY --commit tor=$TOR_TAG $DESCRIPTOR_DIR/mac/gitian-tor.yml
@@ -187,14 +187,14 @@ then
#cp -a result/tor-mac-res.yml inputs/
else
echo
- echo "****** SKIPPING already built Tor Component of Mac Bundle (2/5 for Mac) ******"
+ echo "****** SKIPPING already built Tor Component of Mac Bundle (2/6 for Mac) ******"
echo
fi
if [ ! -f inputs/tor-browser-mac64-gbuilt.zip ];
then
echo
- echo "****** Starting TorBrowser Component of Mac Bundle (3/5 for Mac) ******"
+ echo "****** Starting TorBrowser Component of Mac Bundle (3/6 for Mac) ******"
echo
./bin/gbuild -j $NUM_PROCS -m $VM_MEMORY --commit tor-browser=$TORBROWSER_TAG,faketime=$FAKETIME_TAG $DESCRIPTOR_DIR/mac/gitian-firefox.yml
@@ -209,14 +209,35 @@ then
#cp -a result/torbrowser-mac-res.yml inputs/
else
echo
- echo "****** SKIPPING already built TorBrowser Component of Mac Bundle (3/5 for Mac) ******"
+ echo "****** SKIPPING already built TorBrowser Component of Mac Bundle (3/6 for Mac) ******"
+ echo
+fi
+
+if [ ! -f inputs/webrtc-mac64-gbuilt.zip ];
+then
+ echo
+ echo "****** Starting WebRTC Component of Mac Bundle (4/6 for Mac) ******"
+ echo
+
+ ./bin/gbuild -j $NUM_PROCS -m $VM_MEMORY --commit depot_tools=$DEPOT_TOOLS_TAG $DESCRIPTOR_DIR/mac/gitian-webrtc.yml
+ if [ $? -ne 0 ];
+ then
+ #mv var/build.log ./webrtc-fail-mac.log.`date +%Y%m%d%H%M%S`
+ exit 1
+ fi
+
+ cp -a build/out/webrtc-mac*-gbuilt.zip inputs/
+ #cp -a result/webrtc-mac-res.yml inputs/
+else
+ echo
+ echo "****** SKIPPING already built WebRTC Component of Mac Bundle (4/6 for Mac) ******"
echo
fi
if [ ! -f inputs/pluggable-transports-mac64-gbuilt.zip ];
then
echo
- echo "****** Starting Pluggable Transports Component of Mac Bundle (4/5 for Mac) ******"
+ echo "****** Starting Pluggable Transports Component of Mac Bundle (5/6 for Mac) ******"
echo
./bin/gbuild -j $NUM_PROCS -m $VM_MEMORY --commit goptlib=$GOPTLIB_TAG,meek=$MEEK_TAG,ed25519=$GOED25519_TAG,siphash=$GOSIPHASH_TAG,goxcrypto=$GO_X_CRYPTO_TAG,goxnet=$GO_X_NET_TAG,obfs4=$OBFS4_TAG $DESCRIPTOR_DIR/mac/gitian-pluggable-transports.yml
@@ -230,7 +251,7 @@ then
#cp -a result/pluggable-transports-mac-res.yml inputs/
else
echo
- echo "****** SKIPPING already built Pluggable Transports Component of Mac Bundle (4/5 for Mac) ******"
+ echo "****** SKIPPING already built Pluggable Transports Component of Mac Bundle (5/6 for Mac) ******"
echo
fi
@@ -238,7 +259,7 @@ fi
if [ ! -f inputs/bundle-mac.gbuilt ];
then
echo
- echo "****** Starting Bundling+Localization Component of Mac Bundle (5/5 for Mac) ******"
+ echo "****** Starting Bundling+Localization Component of Mac Bundle (6/6 for Mac) ******"
echo
cd $WRAPPER_DIR && ./record-inputs.sh $VERSIONS_FILE && cd $GITIAN_DIR
@@ -255,7 +276,7 @@ then
touch inputs/bundle-mac.gbuilt
else
echo
- echo "****** SKIPPING already built Bundling+Localization Component of Mac Bundle (5/5 for Mac) ******"
+ echo "****** SKIPPING already built Bundling+Localization Component of Mac Bundle (6/6 for Mac) ******"
echo
fi
diff --git a/gitian/patches/webrtc-mac.patch b/gitian/patches/webrtc-mac.patch
new file mode 100644
index 0000000..f1e6109
--- /dev/null
+++ b/gitian/patches/webrtc-mac.patch
@@ -0,0 +1,305 @@
+From bd27c327f72ea231353983aa35a0c3e6ae8055d5 Mon Sep 17 00:00:00 2001
+From: David Fifield <david(a)bamsoftware.com>
+Date: Mon, 26 Jun 2017 11:26:55 -0700
+Subject: [PATCH 1/8] Disable assertions that prevent cross-compiling for mac.
+
+---
+ config/BUILDCONFIG.gn | 4 ++--
+ toolchain/mac/BUILD.gn | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
+index d055e705..78a2023a 100644
+--- a/build/config/BUILDCONFIG.gn
++++ b/build/config/BUILDCONFIG.gn
+@@ -232,8 +232,8 @@ if (target_os == "android") {
+ } else if (target_os == "ios") {
+ _default_toolchain = "//build/toolchain/mac:ios_clang_$target_cpu"
+ } else if (target_os == "mac") {
+- assert(host_os == "mac", "Mac cross-compiles are unsupported.")
+- _default_toolchain = host_toolchain
++ # assert(host_os == "mac", "Mac cross-compiles are unsupported.")
++ _default_toolchain = "//build/toolchain/mac:clang_$host_cpu"
+ } else if (target_os == "win") {
+ # On Windows we use the same toolchain for host and target by default.
+ assert(target_os == host_os, "Win cross-compiles only work on win hosts.")
+diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn
+index b417e76a..5f48927d 100644
+--- a/build/toolchain/mac/BUILD.gn
++++ b/build/toolchain/mac/BUILD.gn
+@@ -14,7 +14,7 @@ if (is_ios) {
+ import("//build/config/mac/mac_sdk.gni")
+ import("//build/config/mac/symbols.gni")
+
+-assert(host_os == "mac")
++# assert(host_os == "mac")
+
+ import("//build/toolchain/cc_wrapper.gni")
+ import("//build/toolchain/clang_static_analyzer.gni")
+--
+2.11.0
+
+From a58bb43ea406939fcc978aa808714d04802074ac Mon Sep 17 00:00:00 2001
+From: David Fifield <david(a)bamsoftware.com>
+Date: Mon, 26 Jun 2017 11:29:14 -0700
+Subject: [PATCH 2/8] Hardcode cross-compiling flags in config/mac/BUILD.gn.
+
+The build system doesn't provide a general way to set flags externally.
+"No way to provide extra CFLAGS/CXXFLAGS/LDFLAGS"
+https://bugs.chromium.org/p/chromium/issues/detail?id=595653
+---
+ config/mac/BUILD.gn | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/build/config/mac/BUILD.gn b/build/config/mac/BUILD.gn
+index 84180e6a..2054b46f 100644
+--- a/build/config/mac/BUILD.gn
++++ b/build/config/mac/BUILD.gn
+@@ -83,6 +83,11 @@ config("runtime_library") {
+ "-isysroot",
+ sysroot,
+ "-mmacosx-version-min=$mac_deployment_target",
++ "-target",
++ "x86_64-apple-darwin10",
++ "-mlinker-version=136",
++ "-B",
++ "/home/debian/build/cctools/bin",
+ ]
+
+ asmflags = common_flags
+--
+2.11.0
+
+From 4c57d854280a0f0a4f55cba0457ae44f6369ca08 Mon Sep 17 00:00:00 2001
+From: David Fifield <david(a)bamsoftware.com>
+Date: Mon, 26 Jun 2017 11:30:28 -0700
+Subject: [PATCH 3/8] Port build/config/mac/plist_util.py to biplist.
+
+So as not to require the plutil command. plutil was only being used to
+convert between XML and binary plist formats, because versions of the
+plistlib module before Python 3.4 only support the XML format. The
+biplist library handles both formats natively.
+
+FAILED: gen/webrtc/examples/AppRTCMobile_info_plist_merged.plist
+python ../../build/config/mac/plist_util.py merge -f=xml1 -o=gen/webrtc/examples/AppRTCMobile_info_plist_merged.plist ../../build/config/mac/BuildInfo.plist ../../webrtc/examples/objc/AppRTCMobile/mac/Info.plist
+Traceback (most recent call last):
+ File "../../build/config/mac/plist_util.py", line 254, in <module>
+ sys.exit(Main())
+ File "../../build/config/mac/plist_util.py", line 250, in Main
+ args.func(args)
+ File "../../build/config/mac/plist_util.py", line 207, in _Execute
+ data = MergePList(data, LoadPList(filename))
+ File "../../build/config/mac/plist_util.py", line 121, in LoadPList
+ subprocess.check_call(['plutil', '-convert', 'xml1', '-o', name, path])
+ File "/usr/lib/python2.7/subprocess.py", line 535, in check_call
+ retcode = call(*popenargs, **kwargs)
+ File "/usr/lib/python2.7/subprocess.py", line 522, in call
+ return Popen(*popenargs, **kwargs).wait()
+ File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
+ errread, errwrite)
+ File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
+ raise child_exception
+OSError: [Errno 2] No such file or directory
+---
+ config/mac/plist_util.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/build/config/mac/plist_util.py b/build/config/mac/plist_util.py
+index 0928fa13..898edc1a 100644
+--- a/build/config/mac/plist_util.py
++++ b/build/config/mac/plist_util.py
+@@ -3,7 +3,7 @@
+ # found in the LICENSE file.
+
+ import argparse
+-import plistlib
++import biplist
+ import os
+ import re
+ import subprocess
+@@ -116,6 +116,7 @@ def Interpolate(plist, substitutions):
+
+ def LoadPList(path):
+ """Loads Plist at |path| and returns it as a dictionary."""
++ return biplist.readPlist(path)
+ fd, name = tempfile.mkstemp()
+ try:
+ subprocess.check_call(['plutil', '-convert', 'xml1', '-o', name, path])
+@@ -127,6 +128,7 @@ def LoadPList(path):
+
+ def SavePList(path, format, data):
+ """Saves |data| as a Plist to |path| in the specified |format|."""
++ return biplist.writePlist(data, path, {"xml1": False, "binary1": True}[format]) # doesn't handle "json" format
+ fd, name = tempfile.mkstemp()
+ try:
+ with os.fdopen(fd, 'w') as f:
+--
+2.11.0
+
+From d9577991412310d3313d9dcd86453ce24f845c2e Mon Sep 17 00:00:00 2001
+From: David Fifield <david(a)bamsoftware.com>
+Date: Mon, 26 Jun 2017 11:37:34 -0700
+Subject: [PATCH 4/8] Hack workaround to disable dispatch_queue_get_label.
+
+dispatch_queue_get_label and DISPATCH_CURRENT_QUEUE_LABEL require SDK
+10.9+. I don't know if removing this code even makes sense, but it at
+least won't crash immediately because of a null pointer.
+
+https://developer.apple.com/documentation/dispatch/dispatch_current_queue_label
+https://developer.apple.com/library/content/releasenotes/General/APIDiffsMacOSX10_9/General.html
+
+FAILED: obj/webrtc/base/rtc_task_queue/sequenced_task_checker_impl.o ../../../../clang/bin/clang++ -MMD -MF obj/webrtc/base/rtc_task_queue/sequenced_task_checker_impl.o.d -DV8_DEPRECATION_WARNINGS -DNO_TCMALLOC -DUSE_EXTERNAL_POPUP_MENU=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 -DFIELDTRIAL_TESTING_ENABLED -DCR_XCODE_VERSION=0730 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DEXPAT_RELATIVE_PATH -DHAVE_SCTP -DWEBRTC_POSIX -DWEBRTC_MAC -I../.. -Igen -fno-strict-aliasing -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -arch x86_64 -Wall -Wpartial-availability -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-unused-parameter -O2 -gdwarf-2 -isysroot /home/debian/build/MacOSX10.7.sdk -mmacosx-version-min=10.9 -targ
et x86_64-apple-darwin10 -mlinker-version=136 -B /home/debian/build/cctools/bin -fvisibility=hidden -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -fvisibility-inlines-hidden -std=c++11 -stdlib=libc++ -Wno-narrowing -fno-rtti -fno-exceptions -Wnon-virtual-dtor -Woverloaded-virtual -c ../../webrtc/base/sequenced_task_checker_impl.cc -o obj/webrtc/base/rtc_task_queue/sequenced_task_checker_impl.o
+warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]
+../../webrtc/base/sequenced_task_checker_impl.cc:34:46: error: use of undeclared identifier 'DISPATCH_CURRENT_QUEUE_LABEL'
+ current_queue = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL);
+ ^
+---
+ webrtc/base/sequenced_task_checker_impl.cc | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/webrtc/base/sequenced_task_checker_impl.cc b/webrtc/base/sequenced_task_checker_impl.cc
+index f03e0b679..352b2162d 100644
+--- a/webrtc/base/sequenced_task_checker_impl.cc
++++ b/webrtc/base/sequenced_task_checker_impl.cc
+@@ -30,8 +30,9 @@ bool SequencedTaskCheckerImpl::CalledSequentially() const {
+ #if defined(WEBRTC_MAC)
+ // If we're not running on a TaskQueue, use the system dispatch queue
+ // label as an identifier.
+- if (current_queue == nullptr)
+- current_queue = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL);
++ // Disable this because dispatch_queue_get_label requires SDK 10.9+.
++ // if (current_queue == nullptr)
++ // current_queue = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL);
+ #endif
+ CritScope scoped_lock(&lock_);
+ if (!attached_) { // true if previously detached.
+--
+2.11.0
+
+
+From 62a6fa6376194ce673c220eef19fefeebe58fee1 Mon Sep 17 00:00:00 2001
+From: David Fifield <david(a)bamsoftware.com>
+Date: Mon, 26 Jun 2017 11:41:16 -0700
+Subject: [PATCH 5/8] Include <sys/socket.h> in macifaddrs_converter.cc.
+
+Without this, when built against MacOSX10.7.sdk, there are errors:
+
+In file included from ../../webrtc/base/macifaddrs_converter.cc:13:
+/home/debian/build/MacOSX10.7.sdk/usr/include/net/if.h:300:19: error: field has incomplete type 'struct sockaddr'
+ struct sockaddr ifru_addr;
+
+Related references:
+https://trac.macports.org/ticket/49012
+https://trac.macports.org/browser/trunk/dports/gnome/gstreamer1/files/patch-struct-sockadr.diff?rev=140712
+---
+ webrtc/base/macifaddrs_converter.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/webrtc/base/macifaddrs_converter.cc b/webrtc/base/macifaddrs_converter.cc
+index 2ad070e8e..1995f1940 100644
+--- a/webrtc/base/macifaddrs_converter.cc
++++ b/webrtc/base/macifaddrs_converter.cc
+@@ -10,6 +10,7 @@
+
+ #include <memory>
+
++#include <sys/socket.h>
+ #include <net/if.h>
+ #include <sys/ioctl.h>
+ #include <unistd.h>
+--
+2.11.0
+
+
+From e6a421534723408fb1292ce25051a1970f750a4a Mon Sep 17 00:00:00 2001
+From: David Fifield <david(a)bamsoftware.com>
+Date: Mon, 26 Jun 2017 11:42:34 -0700
+Subject: [PATCH 6/8] Provide definitions of NS_ENUM and NS_OPTIONS.
+
+---
+ webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMacros.h | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMacros.h b/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMacros.h
+index f9f15c37d..277676d85 100644
+--- a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMacros.h
++++ b/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMacros.h
+@@ -25,4 +25,17 @@
+ #define RTC_FWD_DECL_OBJC_CLASS(classname) typedef struct objc_object classname
+ #endif
+
++// http://iamthewalr.us/blog/2012/11/ns_enum-and-ns_options/
++#if (__cplusplus && __cplusplus >= 201103L && (__has_extension(cxx_strong_enums) || __has_feature(objc_fixed_enum))) || (!__cplusplus && __has_feature(objc_fixed_enum))
++#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
++#if (__cplusplus)
++#define NS_OPTIONS(_type, _name) _type _name; enum : _type
++#else
++#define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
++#endif
++#else
++#define NS_ENUM(_type, _name) _type _name; enum
++#define NS_OPTIONS(_type, _name) _type _name; enum
++#endif
++
+ #endif // WEBRTC_BASE_OBJC_RTC_MACROS_H_
+--
+2.11.0
+
+
+From baf5ddbd1e1281cd7c4cdda709e2ea7e07903727 Mon Sep 17 00:00:00 2001
+From: David Fifield <david(a)bamsoftware.com>
+Date: Mon, 26 Jun 2017 11:43:05 -0700
+Subject: [PATCH 7/8] Replace firstObject with objectAtIndex:0.
+
+firstObject doesn't exist in our version of the SDK.
+
+The two method calls are not exactly the same; on an empty array,
+firstObject returns nil while objectAtIndex:0 raises an exception. Let's
+hope that doesn't matter.
+---
+ webrtc/modules/video_capture/objc/rtc_video_capture_objc.mm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/webrtc/modules/video_capture/objc/rtc_video_capture_objc.mm b/webrtc/modules/video_capture/objc/rtc_video_capture_objc.mm
+index 182056228..93bea08f9 100644
+--- a/webrtc/modules/video_capture/objc/rtc_video_capture_objc.mm
++++ b/webrtc/modules/video_capture/objc/rtc_video_capture_objc.mm
+@@ -176,7 +176,7 @@ using namespace webrtc::videocapturemodule;
+ }
+
+ - (AVCaptureVideoDataOutput*)currentOutput {
+- return [[_captureSession outputs] firstObject];
++ return [[_captureSession outputs] objectAtIndex:0];
+ }
+
+ - (void)startCaptureInBackgroundWithOutput:
+--
+2.11.0
+
+
+From 0b5f86af5bc4b7697ee60adf7e1e057a023438e0 Mon Sep 17 00:00:00 2001
+From: David Fifield <david(a)bamsoftware.com>
+Date: Mon, 26 Jun 2017 11:43:51 -0700
+Subject: [PATCH 8/8] Disable the desktop_capture module.
+
+It's causing an error related to CoreGraphics.h and hopefully we don't
+need it.
+---
+ webrtc/modules/BUILD.gn | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/webrtc/modules/BUILD.gn b/webrtc/modules/BUILD.gn
+index e750a8109..590f34275 100644
+--- a/webrtc/modules/BUILD.gn
++++ b/webrtc/modules/BUILD.gn
+@@ -18,7 +18,6 @@ group("modules") {
+ "audio_processing",
+ "bitrate_controller",
+ "congestion_controller",
+- "desktop_capture",
+ "media_file",
+ "pacing",
+ "remote_bitrate_estimator",
+--
+2.11.0
+
1
0
[tor-browser/tor-browser-52.2.0esr-7.5-1] fixup! TB4: Tor Browser's Firefox preference overrides.
by gk@torproject.org 13 Jul '17
by gk@torproject.org 13 Jul '17
13 Jul '17
commit b3989f16138112084c008f89d54ecbe9cd4804d7
Author: Georg Koppen <gk(a)torproject.org>
Date: Thu Jul 13 08:48:59 2017 +0000
fixup! TB4: Tor Browser's Firefox preference overrides.
We disable the GetAddons item on the about:addons page as we don't know
which extensions Mozilla is advertising to our users and we don't want
to have some random Google Analytics script running either on
about:addons. Fixes bug 22073.
---
browser/app/profile/000-tor-browser.js | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/browser/app/profile/000-tor-browser.js b/browser/app/profile/000-tor-browser.js
index d2fb5e5..aaeba63 100644
--- a/browser/app/profile/000-tor-browser.js
+++ b/browser/app/profile/000-tor-browser.js
@@ -294,6 +294,10 @@ pref("extensions.enabledScopes", 1);
pref("extensions.pendingOperations", false);
pref("xpinstall.whitelist.add", "");
pref("xpinstall.whitelist.add.36", "");
+// We don't know what extensions Mozilla is advertising to our users and we
+// don't want to have some random Google Analytics script running either on the
+// about:addons page, see bug 22073 and 22900.
+pref("extensions.getAddons.showPane", false);
// Toolbar layout
pref("browser.uiCustomization.state", "{\"placements\":{\"PanelUI-contents\":[\"edit-controls\",\"zoom-controls\",\"new-window-button\",\"save-page-button\",\"print-button\",\"bookmarks-menu-button\",\"history-panelmenu\",\"find-button\",\"preferences-button\",\"add-ons-button\",\"developer-button\",\"https-everywhere-button\",\"downloads-button\"],\"addon-bar\":[\"addonbar-closebutton\",\"status-bar\"],\"PersonalToolbar\":[\"personal-bookmarks\"],\"nav-bar\":[\"noscript-tbb\",\"torbutton-button\",\"urlbar-container\",\"search-container\",\"webrtc-status-button\",\"loop-button\"],\"TabsToolbar\":[\"tabbrowser-tabs\",\"new-tab-button\",\"alltabs-button\"],\"toolbar-menubar\":[\"menubar-items\"]},\"seen\":[],\"dirtyAreaCache\":[\"PersonalToolbar\",\"nav-bar\",\"TabsToolbar\",\"toolbar-menubar\",\"PanelUI-contents\",\"addon-bar\"],\"currentVersion\":4,\"newElementCount\":0}");
1
0
[torbutton/master] Bug 21999: Fix display of language prompt for TBB/ESR52
by gk@torproject.org 11 Jul '17
by gk@torproject.org 11 Jul '17
11 Jul '17
commit 90c35ef999de8b9ee09876f5772a2a728d2bafc1
Author: Arthur Edelstein <arthuredelstein(a)gmail.com>
Date: Fri Jun 16 00:24:29 2017 -0700
Bug 21999: Fix display of language prompt for TBB/ESR52
---
src/chrome/content/torbutton.js | 116 ++++++++++++++++++----------------------
1 file changed, 52 insertions(+), 64 deletions(-)
diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index 3999bd4..b14585b 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -12,7 +12,7 @@ let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
let { showDialog } = Cu.import("resource://torbutton/modules/utils.js", {});
let { unescapeTorString } = Cu.import("resource://torbutton/modules/utils.js", {});
let SecurityPrefs = Cu.import("resource://torbutton/modules/security-prefs.js", {});
-let { bindPrefAndInit } = Cu.import("resource://torbutton/modules/utils.js", {});
+let { bindPrefAndInit, observe } = Cu.import("resource://torbutton/modules/utils.js", {});
const k_tb_last_browser_version_pref = "extensions.torbutton.lastBrowserVersion";
const k_tb_browser_update_needed_pref = "extensions.torbutton.updateNeeded";
@@ -1997,6 +1997,8 @@ function torbutton_is_windowed(wind) {
return true;
}
+let stopLanguagePromptObserver;
+
// Bug 1506 P3: This is needed pretty much only for the version check
// and the window resizing. See comments for individual functions for
// details
@@ -2031,11 +2033,12 @@ function torbutton_new_window(event)
}
// If the default language is not English and we have not already asked,
- // add a web progress listener that will show a "request English language
- // web pages?" prompt the first time an http or https page is opened.
+ // add an http-on-modify-request observer that will show a "request English
+ // language web pages?" prompt the first time a content http or https page
+ // is opened.
if (torbutton_should_prompt_for_language_preference()) {
- progress.addProgressListener(torbutton_langPromptListener,
- Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
+ stopLanguagePromptObserver = observe("http-on-modify-request",
+ torbutton_http_connection_observed);
}
// Check the version on every new window. We're already pinging check in these cases.
@@ -2210,68 +2213,53 @@ var torbutton_resizelistener =
onSecurityChange: function() {}
};
-var torbutton_langPromptListener =
-{
- QueryInterface: function(aIID)
- {
- if (aIID.equals(Ci.nsIWebProgressListener) ||
- aIID.equals(Ci.nsISupportsWeakReference) ||
- aIID.equals(Ci.nsISupports))
- return this;
- throw Cr.NS_NOINTERFACE;
- },
-
- onLocationChange: function(aProgress, aRequest, aURI) {},
+function torbutton_http_connection_observed(aRequest, aData) {
+ // If we are loading an HTTP page from content, show the
+ // "request English language web pages?" prompt.
+ try {
+ let httpChannel = aRequest.QueryInterface(Ci.nsIHttpChannel);
+ if (!aRequest.URI.schemeIs("http") && !aRequest.URI.schemeIs("https")) {
+ return;
+ }
+ if (!httpChannel) return;
+ let notificationCallbacks = httpChannel.notificationCallbacks;
+ if (!notificationCallbacks) return;
+ let loadContext = notificationCallbacks.getInterface(Ci.nsILoadContext);
+ if (!loadContext) return;
+ if (!loadContext.isContent) return;
+ // The above QI did not throw, the scheme is http[s], and we know the
+ // load context is content, so we must have a true HTTP request from content.
+ // Stop the observer and display the prompt if another window has
+ // not already done so.
+ stopLanguagePromptObserver();
- onStateChange: function(aProgress, aRequest, aFlag, aStatus) {
- if (aFlag & Ci.nsIWebProgressListener.STATE_START) {
- // If we are loading an HTTP page, show the
- // "request English language web pages?" prompt.
- try {
- let httpChannel = aRequest.QueryInterface(Ci.nsIHttpChannel);
-
- // The above QI did not throw, so we must have an HTTP request.
- // Remove this listener and display the prompt if another window has
- // not already done so.
- let progress = Cc["@mozilla.org/docloaderservice;1"]
- .getService(Ci.nsIWebProgress);
- progress.removeProgressListener(torbutton_langPromptListener,
- Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
-
- if (torbutton_should_prompt_for_language_preference()) {
- if (torbutton_is_homepage_url(aRequest.URI)) {
- // If the homepage is being loaded, display the prompt after a
- // delay to avoid a problem where a blank prompt is displayed.
- // In this case, the homepage will be loaded using the current
- // spoof English setting, which is OK.
- setTimeout(function() {
- if (torbutton_should_prompt_for_language_preference())
- torbutton_prompt_for_language_preference();
- }, 2000);
- } else {
- // No delay is needed. Display the prompt and fix up the
- // Accept-Language header before allowing the load to continue.
+ if (torbutton_should_prompt_for_language_preference()) {
+ if (torbutton_is_homepage_url(aRequest.URI)) {
+ // If the homepage is being loaded, display the prompt after a
+ // delay to avoid a problem where a blank prompt is displayed.
+ // In this case, the homepage will be loaded using the current
+ // spoof English setting, which is OK.
+ setTimeout(function() {
+ if (torbutton_should_prompt_for_language_preference())
torbutton_prompt_for_language_preference();
-
- // The Accept-Language header for this request was set when the
- // channel was created. Reset it to match the value that will be
- // used for future requests.
- let val = torbutton_get_current_accept_language_value(aRequest.URI);
- if (val)
- httpChannel.setRequestHeader("Accept-Language", val, false);
- }
- }
- } catch (e) {}
+ }, 2000);
+ } else {
+ // No delay is needed. Display the prompt and fix up the
+ // Accept-Language header before allowing the load to continue.
+ torbutton_prompt_for_language_preference();
+
+ // The Accept-Language header for this request was set when the
+ // channel was created. Reset it to match the value that will be
+ // used for future requests.
+ let val = torbutton_get_current_accept_language_value(aRequest.URI);
+ if (val)
+ httpChannel.setRequestHeader("Accept-Language", val, false);
+ }
}
- },
-
- onProgressChange: function(aProgress, aRequest, curSelfProgress,
- maxSelfProgress, curTotalProgress,
- maxTotalProgress) {},
- onStatusChange: function(aProgress, aRequest, stat, message) {},
- onSecurityChange: function() {}
-};
-
+ } catch (e) {
+ torbutton_log(3, e.message);
+ }
+}
// aURI should be an http or https nsIURI object.
function torbutton_get_current_accept_language_value(aURI)
1
0
11 Jul '17
commit 8af90b3222529f9b863229a32dd62b2f9f941d19
Author: Arthur Edelstein <arthuredelstein(a)gmail.com>
Date: Sun Jul 9 23:17:28 2017 -0700
Bug 21999: Detect homepage URLs more effectively
---
src/chrome/content/torbutton.js | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index b14585b..0c297aa 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -2275,6 +2275,25 @@ function torbutton_get_current_accept_language_value(aURI)
return null;
}
+// Take URL strings the user has specified for a homepage
+// and normalize it so it looks like a real URL.
+function torbutton_normalize_homepage_url_string(aURLString)
+{
+ if (!aURLString) return null;
+ if (typeof aURLString !== "string") return null;
+ let url;
+ try {
+ url = new URL(aURLString);
+ } catch (e) {
+ try {
+ url = new URL("http://" + aURLString);
+ } catch (e) {
+ return null;
+ }
+ }
+ return url.href;
+}
+
function torbutton_is_homepage_url(aURI)
{
if (!aURI)
@@ -2292,7 +2311,8 @@ function torbutton_is_homepage_url(aURI)
if (!homePageURLs)
return false;
- let urls = homePageURLs.split('|');
+ let urls = homePageURLs.split('|')
+ .map(torbutton_normalize_homepage_url_string);
return (urls.indexOf(aURI.spec) >= 0);
}
1
0
[tor-browser-bundle/maint-7.0] Bug 22829: Remove default obfs4 bridge riemann.
by gk@torproject.org 11 Jul '17
by gk@torproject.org 11 Jul '17
11 Jul '17
commit 4e4b549515c66c6c1a6eea5af4bb93fc1949d6f7
Author: David Fifield <david(a)bamsoftware.com>
Date: Wed Jul 5 18:34:23 2017 -0700
Bug 22829: Remove default obfs4 bridge riemann.
---
Bundle-Data/PTConfigs/bridge_prefs.js | 47 +++++++++++++++++------------------
1 file changed, 23 insertions(+), 24 deletions(-)
diff --git a/Bundle-Data/PTConfigs/bridge_prefs.js b/Bundle-Data/PTConfigs/bridge_prefs.js
index 0a363cd..03ccb07 100644
--- a/Bundle-Data/PTConfigs/bridge_prefs.js
+++ b/Bundle-Data/PTConfigs/bridge_prefs.js
@@ -14,30 +14,29 @@ pref("extensions.torlauncher.default_bridge.fte.3", "fte 128.105.214.162:8080 FC
pref("extensions.torlauncher.default_bridge.fte.4", "fte 128.105.214.163:8080 A17A40775FBD2CA1184BF80BFC330A77ECF9D0E9");
pref("extensions.torlauncher.default_bridge.obfs4.1", "obfs4 154.35.22.10:15937 8FB9F4319E89E5C6223052AA525A192AFBC85D55 cert=GGGS1TX4R81m3r0HBl79wKy1OtPPNR2CZUIrHjkRg65Vc2VR8fOyo64f9kmT1UAFG7j0HQ iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.2", "obfs4 198.245.60.50:443 752CF7825B3B9EA6A98C83AC41F7099D67007EA5 cert=xpmQtKUqQ/6v5X7ijgYE/f03+l2/EuQ1dexjyUhh16wQlu/cpXUGalmhDIlhuiQPNEKmKw iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.3", "obfs4 192.99.11.54:443 7B126FAB960E5AC6A629C729434FF84FB5074EC2 cert=VW5f8+IBUWpPFxF+rsiVy2wXkyTQG7vEd+rHeN2jV5LIDNu8wMNEOqZXPwHdwMVEBdqXEw iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.4", "obfs4 109.105.109.165:10527 8DFCD8FB3285E855F5A55EDDA35696C743ABFC4E cert=Bvg/itxeL4TWKLP6N1MaQzSOC6tcRIBv6q57DYAZc3b2AzuM+/TfB7mqTFEfXILCjEwzVA iat-mode=1");
-pref("extensions.torlauncher.default_bridge.obfs4.5", "obfs4 83.212.101.3:50002 A09D536DD1752D542E1FBB3C9CE4449D51298239 cert=lPRQ/MXdD1t5SRZ9MquYQNT9m5DV757jtdXdlePmRCudUU9CFUOX1Tm7/meFSyPOsud7Cw iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.6", "obfs4 109.105.109.147:13764 BBB28DF0F201E706BE564EFE690FE9577DD8386D cert=KfMQN/tNMFdda61hMgpiMI7pbwU1T+wxjTulYnfw+4sgvG0zSH7N7fwT10BI8MUdAD7iJA iat-mode=2");
-pref("extensions.torlauncher.default_bridge.obfs4.7", "obfs4 154.35.22.11:16488 A832D176ECD5C7C6B58825AE22FC4C90FA249637 cert=YPbQqXPiqTUBfjGFLpm9JYEFTBvnzEJDKJxXG5Sxzrr/v2qrhGU4Jls9lHjLAhqpXaEfZw iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.8", "obfs4 154.35.22.12:80 00DC6C4FA49A65BD1472993CF6730D54F11E0DBB cert=N86E9hKXXXVz6G7w2z8wFfhIDztDAzZ/3poxVePHEYjbKDWzjkRDccFMAnhK75fc65pYSg iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.9", "obfs4 154.35.22.13:443 FE7840FE1E21FE0A0639ED176EDA00A3ECA1E34D cert=fKnzxr+m+jWXXQGCaXe4f2gGoPXMzbL+bTBbXMYXuK0tMotd+nXyS33y2mONZWU29l81CA iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.10", "obfs4 154.35.22.10:80 8FB9F4319E89E5C6223052AA525A192AFBC85D55 cert=GGGS1TX4R81m3r0HBl79wKy1OtPPNR2CZUIrHjkRg65Vc2VR8fOyo64f9kmT1UAFG7j0HQ iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.11", "obfs4 154.35.22.10:443 8FB9F4319E89E5C6223052AA525A192AFBC85D55 cert=GGGS1TX4R81m3r0HBl79wKy1OtPPNR2CZUIrHjkRg65Vc2VR8fOyo64f9kmT1UAFG7j0HQ iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.12", "obfs4 154.35.22.11:443 A832D176ECD5C7C6B58825AE22FC4C90FA249637 cert=YPbQqXPiqTUBfjGFLpm9JYEFTBvnzEJDKJxXG5Sxzrr/v2qrhGU4Jls9lHjLAhqpXaEfZw iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.13", "obfs4 154.35.22.11:80 A832D176ECD5C7C6B58825AE22FC4C90FA249637 cert=YPbQqXPiqTUBfjGFLpm9JYEFTBvnzEJDKJxXG5Sxzrr/v2qrhGU4Jls9lHjLAhqpXaEfZw iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.14", "obfs4 154.35.22.9:12166 C73ADBAC8ADFDBF0FC0F3F4E8091C0107D093716 cert=gEGKc5WN/bSjFa6UkG9hOcft1tuK+cV8hbZ0H6cqXiMPLqSbCh2Q3PHe5OOr6oMVORhoJA iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.15", "obfs4 154.35.22.9:80 C73ADBAC8ADFDBF0FC0F3F4E8091C0107D093716 cert=gEGKc5WN/bSjFa6UkG9hOcft1tuK+cV8hbZ0H6cqXiMPLqSbCh2Q3PHe5OOr6oMVORhoJA iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.16", "obfs4 154.35.22.9:443 C73ADBAC8ADFDBF0FC0F3F4E8091C0107D093716 cert=gEGKc5WN/bSjFa6UkG9hOcft1tuK+cV8hbZ0H6cqXiMPLqSbCh2Q3PHe5OOr6oMVORhoJA iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.17", "obfs4 154.35.22.12:4304 00DC6C4FA49A65BD1472993CF6730D54F11E0DBB cert=N86E9hKXXXVz6G7w2z8wFfhIDztDAzZ/3poxVePHEYjbKDWzjkRDccFMAnhK75fc65pYSg iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.18", "obfs4 154.35.22.13:16815 FE7840FE1E21FE0A0639ED176EDA00A3ECA1E34D cert=fKnzxr+m+jWXXQGCaXe4f2gGoPXMzbL+bTBbXMYXuK0tMotd+nXyS33y2mONZWU29l81CA iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.19", "obfs4 192.95.36.142:443 CDF2E852BF539B82BD10E27E9115A31734E378C2 cert=qUVQ0srL1JI/vO6V6m/24anYXiJD3QP2HgzUKQtQ7GRqqUvs7P+tG43RtAqdhLOALP7DJQ iat-mode=1");
-pref("extensions.torlauncher.default_bridge.obfs4.20", "obfs4 85.17.30.79:443 FC259A04A328A07FED1413E9FC6526530D9FD87A cert=RutxZlu8BtyP+y0NX7bAVD41+J/qXNhHUrKjFkRSdiBAhIHIQLhKQ2HxESAKZprn/lR3KA iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.21", "obfs4 38.229.1.78:80 C8CBDB2464FC9804A69531437BCF2BE31FDD2EE4 cert=Hmyfd2ev46gGY7NoVxA9ngrPF2zCZtzskRTzoWXbxNkzeVnGFPWmrTtILRyqCTjHR+s9dg iat-mode=1");
-/**/pref/**/(/**/"extensions.torlauncher.default_bridge.obfs4.22"/**/, /**/"obfs4 38.229.33.83:80 0BAC39417268B96B9F514E7F63FA6FBA1A788955 cert=VwEFpk9F/UN9JED7XpG1XOjm/O8ZCXK80oPecgWnNDZDv5pdkhq1OpbAH0wNqOT6H6BmRQ iat-mode=1");
-pref("extensions.torlauncher.default_bridge.obfs4.23", "obfs4 [2001:470:b381:bfff:216:3eff:fe23:d6c3]:443 CDF2E852BF539B82BD10E27E9115A31734E378C2 cert=qUVQ0srL1JI/vO6V6m/24anYXiJD3QP2HgzUKQtQ7GRqqUvs7P+tG43RtAqdhLOALP7DJQ iat-mode=1");
-pref("extensions.torlauncher.default_bridge.obfs4.24", "obfs4 37.218.240.34:40035 88CD36D45A35271963EF82E511C8827A24730913 cert=eGXYfWODcgqIdPJ+rRupg4GGvVGfh25FWaIXZkit206OSngsp7GAIiGIXOJJROMxEqFKJg iat-mode=1");
-pref("extensions.torlauncher.default_bridge.obfs4.25", "obfs4 37.218.245.14:38224 D9A82D2F9C2F65A18407B1D2B764F130847F8B5D cert=bjRaMrr1BRiAW8IE9U5z27fQaYgOhX1UCmOpg2pFpoMvo6ZgQMzLsaTzzQNTlm7hNcb+Sg iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.2", "obfs4 192.99.11.54:443 7B126FAB960E5AC6A629C729434FF84FB5074EC2 cert=VW5f8+IBUWpPFxF+rsiVy2wXkyTQG7vEd+rHeN2jV5LIDNu8wMNEOqZXPwHdwMVEBdqXEw iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.3", "obfs4 109.105.109.165:10527 8DFCD8FB3285E855F5A55EDDA35696C743ABFC4E cert=Bvg/itxeL4TWKLP6N1MaQzSOC6tcRIBv6q57DYAZc3b2AzuM+/TfB7mqTFEfXILCjEwzVA iat-mode=1");
+pref("extensions.torlauncher.default_bridge.obfs4.4", "obfs4 83.212.101.3:50002 A09D536DD1752D542E1FBB3C9CE4449D51298239 cert=lPRQ/MXdD1t5SRZ9MquYQNT9m5DV757jtdXdlePmRCudUU9CFUOX1Tm7/meFSyPOsud7Cw iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.5", "obfs4 109.105.109.147:13764 BBB28DF0F201E706BE564EFE690FE9577DD8386D cert=KfMQN/tNMFdda61hMgpiMI7pbwU1T+wxjTulYnfw+4sgvG0zSH7N7fwT10BI8MUdAD7iJA iat-mode=2");
+pref("extensions.torlauncher.default_bridge.obfs4.6", "obfs4 154.35.22.11:16488 A832D176ECD5C7C6B58825AE22FC4C90FA249637 cert=YPbQqXPiqTUBfjGFLpm9JYEFTBvnzEJDKJxXG5Sxzrr/v2qrhGU4Jls9lHjLAhqpXaEfZw iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.7", "obfs4 154.35.22.12:80 00DC6C4FA49A65BD1472993CF6730D54F11E0DBB cert=N86E9hKXXXVz6G7w2z8wFfhIDztDAzZ/3poxVePHEYjbKDWzjkRDccFMAnhK75fc65pYSg iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.8", "obfs4 154.35.22.13:443 FE7840FE1E21FE0A0639ED176EDA00A3ECA1E34D cert=fKnzxr+m+jWXXQGCaXe4f2gGoPXMzbL+bTBbXMYXuK0tMotd+nXyS33y2mONZWU29l81CA iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.9", "obfs4 154.35.22.10:80 8FB9F4319E89E5C6223052AA525A192AFBC85D55 cert=GGGS1TX4R81m3r0HBl79wKy1OtPPNR2CZUIrHjkRg65Vc2VR8fOyo64f9kmT1UAFG7j0HQ iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.10", "obfs4 154.35.22.10:443 8FB9F4319E89E5C6223052AA525A192AFBC85D55 cert=GGGS1TX4R81m3r0HBl79wKy1OtPPNR2CZUIrHjkRg65Vc2VR8fOyo64f9kmT1UAFG7j0HQ iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.11", "obfs4 154.35.22.11:443 A832D176ECD5C7C6B58825AE22FC4C90FA249637 cert=YPbQqXPiqTUBfjGFLpm9JYEFTBvnzEJDKJxXG5Sxzrr/v2qrhGU4Jls9lHjLAhqpXaEfZw iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.12", "obfs4 154.35.22.11:80 A832D176ECD5C7C6B58825AE22FC4C90FA249637 cert=YPbQqXPiqTUBfjGFLpm9JYEFTBvnzEJDKJxXG5Sxzrr/v2qrhGU4Jls9lHjLAhqpXaEfZw iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.13", "obfs4 154.35.22.9:12166 C73ADBAC8ADFDBF0FC0F3F4E8091C0107D093716 cert=gEGKc5WN/bSjFa6UkG9hOcft1tuK+cV8hbZ0H6cqXiMPLqSbCh2Q3PHe5OOr6oMVORhoJA iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.14", "obfs4 154.35.22.9:80 C73ADBAC8ADFDBF0FC0F3F4E8091C0107D093716 cert=gEGKc5WN/bSjFa6UkG9hOcft1tuK+cV8hbZ0H6cqXiMPLqSbCh2Q3PHe5OOr6oMVORhoJA iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.15", "obfs4 154.35.22.9:443 C73ADBAC8ADFDBF0FC0F3F4E8091C0107D093716 cert=gEGKc5WN/bSjFa6UkG9hOcft1tuK+cV8hbZ0H6cqXiMPLqSbCh2Q3PHe5OOr6oMVORhoJA iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.16", "obfs4 154.35.22.12:4304 00DC6C4FA49A65BD1472993CF6730D54F11E0DBB cert=N86E9hKXXXVz6G7w2z8wFfhIDztDAzZ/3poxVePHEYjbKDWzjkRDccFMAnhK75fc65pYSg iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.17", "obfs4 154.35.22.13:16815 FE7840FE1E21FE0A0639ED176EDA00A3ECA1E34D cert=fKnzxr+m+jWXXQGCaXe4f2gGoPXMzbL+bTBbXMYXuK0tMotd+nXyS33y2mONZWU29l81CA iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.18", "obfs4 192.95.36.142:443 CDF2E852BF539B82BD10E27E9115A31734E378C2 cert=qUVQ0srL1JI/vO6V6m/24anYXiJD3QP2HgzUKQtQ7GRqqUvs7P+tG43RtAqdhLOALP7DJQ iat-mode=1");
+pref("extensions.torlauncher.default_bridge.obfs4.19", "obfs4 85.17.30.79:443 FC259A04A328A07FED1413E9FC6526530D9FD87A cert=RutxZlu8BtyP+y0NX7bAVD41+J/qXNhHUrKjFkRSdiBAhIHIQLhKQ2HxESAKZprn/lR3KA iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.20", "obfs4 38.229.1.78:80 C8CBDB2464FC9804A69531437BCF2BE31FDD2EE4 cert=Hmyfd2ev46gGY7NoVxA9ngrPF2zCZtzskRTzoWXbxNkzeVnGFPWmrTtILRyqCTjHR+s9dg iat-mode=1");
+/**/pref/**/(/**/"extensions.torlauncher.default_bridge.obfs4.21"/**/, /**/"obfs4 38.229.33.83:80 0BAC39417268B96B9F514E7F63FA6FBA1A788955 cert=VwEFpk9F/UN9JED7XpG1XOjm/O8ZCXK80oPecgWnNDZDv5pdkhq1OpbAH0wNqOT6H6BmRQ iat-mode=1");
+pref("extensions.torlauncher.default_bridge.obfs4.22", "obfs4 [2001:470:b381:bfff:216:3eff:fe23:d6c3]:443 CDF2E852BF539B82BD10E27E9115A31734E378C2 cert=qUVQ0srL1JI/vO6V6m/24anYXiJD3QP2HgzUKQtQ7GRqqUvs7P+tG43RtAqdhLOALP7DJQ iat-mode=1");
+pref("extensions.torlauncher.default_bridge.obfs4.23", "obfs4 37.218.240.34:40035 88CD36D45A35271963EF82E511C8827A24730913 cert=eGXYfWODcgqIdPJ+rRupg4GGvVGfh25FWaIXZkit206OSngsp7GAIiGIXOJJROMxEqFKJg iat-mode=1");
+pref("extensions.torlauncher.default_bridge.obfs4.24", "obfs4 37.218.245.14:38224 D9A82D2F9C2F65A18407B1D2B764F130847F8B5D cert=bjRaMrr1BRiAW8IE9U5z27fQaYgOhX1UCmOpg2pFpoMvo6ZgQMzLsaTzzQNTlm7hNcb+Sg iat-mode=0");
pref("extensions.torlauncher.default_bridge.meek-amazon.1", "meek 0.0.2.0:2 B9E7141C594AF25699E0079C1F0146F409495296 url=https://d2cly7j4zqgua7.cloudfront.net/ front=a0.awsstatic.com");
pref("extensions.torlauncher.default_bridge.meek-azure.1", "meek 0.0.2.0:3 97700DFE9F483596DDA6264C4D7DF7641E1E39CE url=https://meek.azureedge.net/ front=ajax.aspnetcdn.com");
1
0
[tor-browser-bundle/master] Bug 22829: Remove default obfs4 bridge riemann.
by gk@torproject.org 11 Jul '17
by gk@torproject.org 11 Jul '17
11 Jul '17
commit d3a6c3533c5f506df5471153057e53c502bf73ae
Author: David Fifield <david(a)bamsoftware.com>
Date: Wed Jul 5 18:34:23 2017 -0700
Bug 22829: Remove default obfs4 bridge riemann.
---
Bundle-Data/PTConfigs/bridge_prefs.js | 47 +++++++++++++++++------------------
1 file changed, 23 insertions(+), 24 deletions(-)
diff --git a/Bundle-Data/PTConfigs/bridge_prefs.js b/Bundle-Data/PTConfigs/bridge_prefs.js
index d2f4236..2f68a1f 100644
--- a/Bundle-Data/PTConfigs/bridge_prefs.js
+++ b/Bundle-Data/PTConfigs/bridge_prefs.js
@@ -14,30 +14,29 @@ pref("extensions.torlauncher.default_bridge.fte.3", "fte 128.105.214.162:8080 FC
pref("extensions.torlauncher.default_bridge.fte.4", "fte 128.105.214.163:8080 A17A40775FBD2CA1184BF80BFC330A77ECF9D0E9");
pref("extensions.torlauncher.default_bridge.obfs4.1", "obfs4 154.35.22.10:15937 8FB9F4319E89E5C6223052AA525A192AFBC85D55 cert=GGGS1TX4R81m3r0HBl79wKy1OtPPNR2CZUIrHjkRg65Vc2VR8fOyo64f9kmT1UAFG7j0HQ iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.2", "obfs4 198.245.60.50:443 752CF7825B3B9EA6A98C83AC41F7099D67007EA5 cert=xpmQtKUqQ/6v5X7ijgYE/f03+l2/EuQ1dexjyUhh16wQlu/cpXUGalmhDIlhuiQPNEKmKw iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.3", "obfs4 192.99.11.54:443 7B126FAB960E5AC6A629C729434FF84FB5074EC2 cert=VW5f8+IBUWpPFxF+rsiVy2wXkyTQG7vEd+rHeN2jV5LIDNu8wMNEOqZXPwHdwMVEBdqXEw iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.4", "obfs4 109.105.109.165:10527 8DFCD8FB3285E855F5A55EDDA35696C743ABFC4E cert=Bvg/itxeL4TWKLP6N1MaQzSOC6tcRIBv6q57DYAZc3b2AzuM+/TfB7mqTFEfXILCjEwzVA iat-mode=1");
-pref("extensions.torlauncher.default_bridge.obfs4.5", "obfs4 83.212.101.3:50002 A09D536DD1752D542E1FBB3C9CE4449D51298239 cert=lPRQ/MXdD1t5SRZ9MquYQNT9m5DV757jtdXdlePmRCudUU9CFUOX1Tm7/meFSyPOsud7Cw iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.6", "obfs4 109.105.109.147:13764 BBB28DF0F201E706BE564EFE690FE9577DD8386D cert=KfMQN/tNMFdda61hMgpiMI7pbwU1T+wxjTulYnfw+4sgvG0zSH7N7fwT10BI8MUdAD7iJA iat-mode=2");
-pref("extensions.torlauncher.default_bridge.obfs4.7", "obfs4 154.35.22.11:16488 A832D176ECD5C7C6B58825AE22FC4C90FA249637 cert=YPbQqXPiqTUBfjGFLpm9JYEFTBvnzEJDKJxXG5Sxzrr/v2qrhGU4Jls9lHjLAhqpXaEfZw iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.8", "obfs4 154.35.22.12:80 00DC6C4FA49A65BD1472993CF6730D54F11E0DBB cert=N86E9hKXXXVz6G7w2z8wFfhIDztDAzZ/3poxVePHEYjbKDWzjkRDccFMAnhK75fc65pYSg iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.9", "obfs4 154.35.22.13:443 FE7840FE1E21FE0A0639ED176EDA00A3ECA1E34D cert=fKnzxr+m+jWXXQGCaXe4f2gGoPXMzbL+bTBbXMYXuK0tMotd+nXyS33y2mONZWU29l81CA iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.10", "obfs4 154.35.22.10:80 8FB9F4319E89E5C6223052AA525A192AFBC85D55 cert=GGGS1TX4R81m3r0HBl79wKy1OtPPNR2CZUIrHjkRg65Vc2VR8fOyo64f9kmT1UAFG7j0HQ iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.11", "obfs4 154.35.22.10:443 8FB9F4319E89E5C6223052AA525A192AFBC85D55 cert=GGGS1TX4R81m3r0HBl79wKy1OtPPNR2CZUIrHjkRg65Vc2VR8fOyo64f9kmT1UAFG7j0HQ iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.12", "obfs4 154.35.22.11:443 A832D176ECD5C7C6B58825AE22FC4C90FA249637 cert=YPbQqXPiqTUBfjGFLpm9JYEFTBvnzEJDKJxXG5Sxzrr/v2qrhGU4Jls9lHjLAhqpXaEfZw iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.13", "obfs4 154.35.22.11:80 A832D176ECD5C7C6B58825AE22FC4C90FA249637 cert=YPbQqXPiqTUBfjGFLpm9JYEFTBvnzEJDKJxXG5Sxzrr/v2qrhGU4Jls9lHjLAhqpXaEfZw iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.14", "obfs4 154.35.22.9:12166 C73ADBAC8ADFDBF0FC0F3F4E8091C0107D093716 cert=gEGKc5WN/bSjFa6UkG9hOcft1tuK+cV8hbZ0H6cqXiMPLqSbCh2Q3PHe5OOr6oMVORhoJA iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.15", "obfs4 154.35.22.9:80 C73ADBAC8ADFDBF0FC0F3F4E8091C0107D093716 cert=gEGKc5WN/bSjFa6UkG9hOcft1tuK+cV8hbZ0H6cqXiMPLqSbCh2Q3PHe5OOr6oMVORhoJA iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.16", "obfs4 154.35.22.9:443 C73ADBAC8ADFDBF0FC0F3F4E8091C0107D093716 cert=gEGKc5WN/bSjFa6UkG9hOcft1tuK+cV8hbZ0H6cqXiMPLqSbCh2Q3PHe5OOr6oMVORhoJA iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.17", "obfs4 154.35.22.12:4304 00DC6C4FA49A65BD1472993CF6730D54F11E0DBB cert=N86E9hKXXXVz6G7w2z8wFfhIDztDAzZ/3poxVePHEYjbKDWzjkRDccFMAnhK75fc65pYSg iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.18", "obfs4 154.35.22.13:16815 FE7840FE1E21FE0A0639ED176EDA00A3ECA1E34D cert=fKnzxr+m+jWXXQGCaXe4f2gGoPXMzbL+bTBbXMYXuK0tMotd+nXyS33y2mONZWU29l81CA iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.19", "obfs4 192.95.36.142:443 CDF2E852BF539B82BD10E27E9115A31734E378C2 cert=qUVQ0srL1JI/vO6V6m/24anYXiJD3QP2HgzUKQtQ7GRqqUvs7P+tG43RtAqdhLOALP7DJQ iat-mode=1");
-pref("extensions.torlauncher.default_bridge.obfs4.20", "obfs4 85.17.30.79:443 FC259A04A328A07FED1413E9FC6526530D9FD87A cert=RutxZlu8BtyP+y0NX7bAVD41+J/qXNhHUrKjFkRSdiBAhIHIQLhKQ2HxESAKZprn/lR3KA iat-mode=0");
-pref("extensions.torlauncher.default_bridge.obfs4.21", "obfs4 38.229.1.78:80 C8CBDB2464FC9804A69531437BCF2BE31FDD2EE4 cert=Hmyfd2ev46gGY7NoVxA9ngrPF2zCZtzskRTzoWXbxNkzeVnGFPWmrTtILRyqCTjHR+s9dg iat-mode=1");
-/**/pref/**/(/**/"extensions.torlauncher.default_bridge.obfs4.22"/**/, /**/"obfs4 38.229.33.83:80 0BAC39417268B96B9F514E7F63FA6FBA1A788955 cert=VwEFpk9F/UN9JED7XpG1XOjm/O8ZCXK80oPecgWnNDZDv5pdkhq1OpbAH0wNqOT6H6BmRQ iat-mode=1");
-pref("extensions.torlauncher.default_bridge.obfs4.23", "obfs4 [2001:470:b381:bfff:216:3eff:fe23:d6c3]:443 CDF2E852BF539B82BD10E27E9115A31734E378C2 cert=qUVQ0srL1JI/vO6V6m/24anYXiJD3QP2HgzUKQtQ7GRqqUvs7P+tG43RtAqdhLOALP7DJQ iat-mode=1");
-pref("extensions.torlauncher.default_bridge.obfs4.24", "obfs4 37.218.240.34:40035 88CD36D45A35271963EF82E511C8827A24730913 cert=eGXYfWODcgqIdPJ+rRupg4GGvVGfh25FWaIXZkit206OSngsp7GAIiGIXOJJROMxEqFKJg iat-mode=1");
-pref("extensions.torlauncher.default_bridge.obfs4.25", "obfs4 37.218.245.14:38224 D9A82D2F9C2F65A18407B1D2B764F130847F8B5D cert=bjRaMrr1BRiAW8IE9U5z27fQaYgOhX1UCmOpg2pFpoMvo6ZgQMzLsaTzzQNTlm7hNcb+Sg iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.2", "obfs4 192.99.11.54:443 7B126FAB960E5AC6A629C729434FF84FB5074EC2 cert=VW5f8+IBUWpPFxF+rsiVy2wXkyTQG7vEd+rHeN2jV5LIDNu8wMNEOqZXPwHdwMVEBdqXEw iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.3", "obfs4 109.105.109.165:10527 8DFCD8FB3285E855F5A55EDDA35696C743ABFC4E cert=Bvg/itxeL4TWKLP6N1MaQzSOC6tcRIBv6q57DYAZc3b2AzuM+/TfB7mqTFEfXILCjEwzVA iat-mode=1");
+pref("extensions.torlauncher.default_bridge.obfs4.4", "obfs4 83.212.101.3:50002 A09D536DD1752D542E1FBB3C9CE4449D51298239 cert=lPRQ/MXdD1t5SRZ9MquYQNT9m5DV757jtdXdlePmRCudUU9CFUOX1Tm7/meFSyPOsud7Cw iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.5", "obfs4 109.105.109.147:13764 BBB28DF0F201E706BE564EFE690FE9577DD8386D cert=KfMQN/tNMFdda61hMgpiMI7pbwU1T+wxjTulYnfw+4sgvG0zSH7N7fwT10BI8MUdAD7iJA iat-mode=2");
+pref("extensions.torlauncher.default_bridge.obfs4.6", "obfs4 154.35.22.11:16488 A832D176ECD5C7C6B58825AE22FC4C90FA249637 cert=YPbQqXPiqTUBfjGFLpm9JYEFTBvnzEJDKJxXG5Sxzrr/v2qrhGU4Jls9lHjLAhqpXaEfZw iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.7", "obfs4 154.35.22.12:80 00DC6C4FA49A65BD1472993CF6730D54F11E0DBB cert=N86E9hKXXXVz6G7w2z8wFfhIDztDAzZ/3poxVePHEYjbKDWzjkRDccFMAnhK75fc65pYSg iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.8", "obfs4 154.35.22.13:443 FE7840FE1E21FE0A0639ED176EDA00A3ECA1E34D cert=fKnzxr+m+jWXXQGCaXe4f2gGoPXMzbL+bTBbXMYXuK0tMotd+nXyS33y2mONZWU29l81CA iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.9", "obfs4 154.35.22.10:80 8FB9F4319E89E5C6223052AA525A192AFBC85D55 cert=GGGS1TX4R81m3r0HBl79wKy1OtPPNR2CZUIrHjkRg65Vc2VR8fOyo64f9kmT1UAFG7j0HQ iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.10", "obfs4 154.35.22.10:443 8FB9F4319E89E5C6223052AA525A192AFBC85D55 cert=GGGS1TX4R81m3r0HBl79wKy1OtPPNR2CZUIrHjkRg65Vc2VR8fOyo64f9kmT1UAFG7j0HQ iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.11", "obfs4 154.35.22.11:443 A832D176ECD5C7C6B58825AE22FC4C90FA249637 cert=YPbQqXPiqTUBfjGFLpm9JYEFTBvnzEJDKJxXG5Sxzrr/v2qrhGU4Jls9lHjLAhqpXaEfZw iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.12", "obfs4 154.35.22.11:80 A832D176ECD5C7C6B58825AE22FC4C90FA249637 cert=YPbQqXPiqTUBfjGFLpm9JYEFTBvnzEJDKJxXG5Sxzrr/v2qrhGU4Jls9lHjLAhqpXaEfZw iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.13", "obfs4 154.35.22.9:12166 C73ADBAC8ADFDBF0FC0F3F4E8091C0107D093716 cert=gEGKc5WN/bSjFa6UkG9hOcft1tuK+cV8hbZ0H6cqXiMPLqSbCh2Q3PHe5OOr6oMVORhoJA iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.14", "obfs4 154.35.22.9:80 C73ADBAC8ADFDBF0FC0F3F4E8091C0107D093716 cert=gEGKc5WN/bSjFa6UkG9hOcft1tuK+cV8hbZ0H6cqXiMPLqSbCh2Q3PHe5OOr6oMVORhoJA iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.15", "obfs4 154.35.22.9:443 C73ADBAC8ADFDBF0FC0F3F4E8091C0107D093716 cert=gEGKc5WN/bSjFa6UkG9hOcft1tuK+cV8hbZ0H6cqXiMPLqSbCh2Q3PHe5OOr6oMVORhoJA iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.16", "obfs4 154.35.22.12:4304 00DC6C4FA49A65BD1472993CF6730D54F11E0DBB cert=N86E9hKXXXVz6G7w2z8wFfhIDztDAzZ/3poxVePHEYjbKDWzjkRDccFMAnhK75fc65pYSg iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.17", "obfs4 154.35.22.13:16815 FE7840FE1E21FE0A0639ED176EDA00A3ECA1E34D cert=fKnzxr+m+jWXXQGCaXe4f2gGoPXMzbL+bTBbXMYXuK0tMotd+nXyS33y2mONZWU29l81CA iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.18", "obfs4 192.95.36.142:443 CDF2E852BF539B82BD10E27E9115A31734E378C2 cert=qUVQ0srL1JI/vO6V6m/24anYXiJD3QP2HgzUKQtQ7GRqqUvs7P+tG43RtAqdhLOALP7DJQ iat-mode=1");
+pref("extensions.torlauncher.default_bridge.obfs4.19", "obfs4 85.17.30.79:443 FC259A04A328A07FED1413E9FC6526530D9FD87A cert=RutxZlu8BtyP+y0NX7bAVD41+J/qXNhHUrKjFkRSdiBAhIHIQLhKQ2HxESAKZprn/lR3KA iat-mode=0");
+pref("extensions.torlauncher.default_bridge.obfs4.20", "obfs4 38.229.1.78:80 C8CBDB2464FC9804A69531437BCF2BE31FDD2EE4 cert=Hmyfd2ev46gGY7NoVxA9ngrPF2zCZtzskRTzoWXbxNkzeVnGFPWmrTtILRyqCTjHR+s9dg iat-mode=1");
+/**/pref/**/(/**/"extensions.torlauncher.default_bridge.obfs4.21"/**/, /**/"obfs4 38.229.33.83:80 0BAC39417268B96B9F514E7F63FA6FBA1A788955 cert=VwEFpk9F/UN9JED7XpG1XOjm/O8ZCXK80oPecgWnNDZDv5pdkhq1OpbAH0wNqOT6H6BmRQ iat-mode=1");
+pref("extensions.torlauncher.default_bridge.obfs4.22", "obfs4 [2001:470:b381:bfff:216:3eff:fe23:d6c3]:443 CDF2E852BF539B82BD10E27E9115A31734E378C2 cert=qUVQ0srL1JI/vO6V6m/24anYXiJD3QP2HgzUKQtQ7GRqqUvs7P+tG43RtAqdhLOALP7DJQ iat-mode=1");
+pref("extensions.torlauncher.default_bridge.obfs4.23", "obfs4 37.218.240.34:40035 88CD36D45A35271963EF82E511C8827A24730913 cert=eGXYfWODcgqIdPJ+rRupg4GGvVGfh25FWaIXZkit206OSngsp7GAIiGIXOJJROMxEqFKJg iat-mode=1");
+pref("extensions.torlauncher.default_bridge.obfs4.24", "obfs4 37.218.245.14:38224 D9A82D2F9C2F65A18407B1D2B764F130847F8B5D cert=bjRaMrr1BRiAW8IE9U5z27fQaYgOhX1UCmOpg2pFpoMvo6ZgQMzLsaTzzQNTlm7hNcb+Sg iat-mode=0");
pref("extensions.torlauncher.default_bridge.meek-amazon.1", "meek 0.0.2.0:2 B9E7141C594AF25699E0079C1F0146F409495296 url=https://d2cly7j4zqgua7.cloudfront.net/ front=a0.awsstatic.com");
pref("extensions.torlauncher.default_bridge.meek-azure.1", "meek 0.0.2.0:3 97700DFE9F483596DDA6264C4D7DF7641E1E39CE url=https://meek.azureedge.net/ front=ajax.aspnetcdn.com");
1
0
[tor-browser-bundle/master] Bugs 22832: Only include objects under out/Release/obj in libwebrtc-magic.a.
by gk@torproject.org 10 Jul '17
by gk@torproject.org 10 Jul '17
10 Jul '17
commit 781da76f120f849416c772cef45a9a9a103b4eef
Author: David Fifield <david(a)bamsoftware.com>
Date: Wed Jul 5 23:11:03 2017 -0700
Bugs 22832: Only include objects under out/Release/obj in libwebrtc-magic.a.
Object files from elsewhere under out/ should never have been included,
because they are not part of webrtc itself, but rather side-effect build
artifacts like gn. Including those extraneous .o files was mostly
harmless (except for library size), because on linux they happened to be
the same architecture as the webrtc.o files. However it won't work for
the mac build (because libwebrtc-magic.a would include a mix of linux
ELF and mac Mach-O objects). Additionally, build_time.o, part of the gn
build, embeds a timestamp with month resolution, causing a failure of
reproducibility, as found at https://bugs.torproject.org/22832.
---
gitian/descriptors/linux/gitian-webrtc.yml | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/gitian/descriptors/linux/gitian-webrtc.yml b/gitian/descriptors/linux/gitian-webrtc.yml
index 9e7808c..8bb6129 100644
--- a/gitian/descriptors/linux/gitian-webrtc.yml
+++ b/gitian/descriptors/linux/gitian-webrtc.yml
@@ -103,9 +103,12 @@ script: |
rm -rf out/Release
"$GN" gen out/Release --args="$GN_ARGS"
ninja -C out/Release webrtc field_trial metrics_default pc_test_utils
- # https://github.com/keroserene/go-webrtc/issues/23#issuecomment-175312648
- # libwebrtc-linux-386-magic.a(dump_syms_regtest.o): unsupported ELF file type 2
- ar crs libwebrtc-magic.a $(find . -name '*.o' -not -name '*.main.o' -not -name 'dump_syms_regtest.o' | sort)
+ # .o files under out/Release/obj/ are the build outputs. Don't include .o
+ # files from elsewhere under out/ because they are build helpers and things
+ # like that, not necessarily of the target architecture, and anyway are not
+ # needed.
+ # https://bugs.torproject.org/22832
+ ar crs libwebrtc-magic.a $(find out/Release/obj -name '*.o' | sort)
cd ../..
# Grabbing the result
1
0
commit f47d812d86c40f349ce113eee5783522a1d9cc13
Author: Georg Koppen <gk(a)torproject.org>
Date: Fri Jul 7 12:22:04 2017 +0000
Fold in stable changelogs
---
Bundle-Data/Docs/ChangeLog.txt | 150 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 150 insertions(+)
diff --git a/Bundle-Data/Docs/ChangeLog.txt b/Bundle-Data/Docs/ChangeLog.txt
index 45210dd..2e52d7c 100644
--- a/Bundle-Data/Docs/ChangeLog.txt
+++ b/Bundle-Data/Docs/ChangeLog.txt
@@ -5,6 +5,11 @@ Tor Browser 7.5a2 -- July 6 2017
* Linux
* Update sandboxed-tor-browser to 0.0.9
+Tor Browser 7.0.2 -- July 3 2017
+ * All Platforms
+ * Update Tor to 0.3.0.9, fixing bug #22753
+ * Update HTTPS-Everywhere to 5.2.19
+
Tor Browser 7.5a1 -- June 14 2017
* All Platforms
* Update Firefox to 52.2.0esr
@@ -58,6 +63,151 @@ Tor Browser 7.5a1 -- June 14 2017
* Android
* Bug 19078: Disable RtspMediaResource stuff in Orfox
+Tor Browser 7.0.1 -- June 13 2017
+ * All Platforms
+ * Update Firefox to 52.2.0esr
+ * Update Tor to 0.3.0.8
+ * Update Torbutton to 1.9.7.4
+ * Bug 22542: Security Settings window too small on macOS 10.12
+ * Update HTTPS-Everywhere to 5.2.18
+ * Bug 22362: NoScript's XSS filter freezes the browser
+ * OS X
+ * Bug 22558: Don't update OS X 10.7.x and 10.8.x users to Tor Browser 7.0
+
+Tor Browser 7.0 -- June 7 2017
+ * All Platforms
+ * Update Firefox to 52.1.2esr
+ * Update Tor to 0.3.0.7
+ * Update Torbutton to 1.9.7.3
+ * Bug 22104: Adjust our content policy whitelist for ff52-esr
+ * Bug 22457: Allow resources loaded by view-source://
+ * Bug 21627: Ignore HTTP 304 responses when checking redirects
+ * Bug 22459: Adapt our use of the nsIContentPolicy to e10s mode
+ * Bug 21865: Update our JIT preferences in the security slider
+ * Bug 21747: Make 'New Tor Circuit for this Site' work in ESR52
+ * Bug 21745: Fix handling of catch-all circuit
+ * Bug 21547: Fix circuit display under e10s
+ * Bug 21268: e10s compatibility for New Identity
+ * Bug 21267: Remove window resize implementation for now
+ * Bug 21201: Make Torbutton multiprocess compatible
+ * Translations update
+ * Update Tor Launcher to 0.2.12.2
+ * Bug 22283: Linux 7.0a4 broken after update due to unix: lines in torrc
+ * Bug 20761: Don't ignore additional SocksPorts
+ * Bug 21920: Don't show locale selection dialog
+ * Bug 21546: Mark Tor Launcher as multiprocess compatible
+ * Bug 21264: Add a README file
+ * Translations update
+ * Update HTTPS-Everywhere to 5.2.17
+ * Update NoScript to 5.0.5
+ * Update Go to 1.8.3 (bug 22398)
+ * Bug 21962: Fix crash on about:addons page
+ * Bug 21766: Fix crash when the external application helper dialog is invoked
+ * Bug 21886: Download is stalled in non-e10s mode
+ * Bug 21778: Canvas prompt is not shown in Tor Browser based on ESR52
+ * Bug 21569: Add first-party domain to Permissions key
+ * Bug 22165: Don't allow collection of local IP addresses
+ * Bug 13017: Work around audio fingerprinting by disabling the Web Audio API
+ * Bug 10286: Disable Touch API and add fingerprinting resistance as fallback
+ * Bug 13612: Disable Social API
+ * Bug 10283: Disable SpeechSynthesis API
+ * Bug 22333: Disable WebGL2 API for now
+ * Bug 21861: Disable additional mDNS code to avoid proxy bypasses
+ * Bug 21684: Don't expose navigator.AddonManager to content
+ * Bug 21431: Clean-up system extensions shipped in Firefox 52
+ * Bug 22320: Use preference name 'referer.hideOnionSource' everywhere
+ * Bug 16285: Don't ship ClearKey EME system and update EME preferences
+ * Bug 21675: Spoof window.navigator.hardwareConcurrency
+ * Bug 21792: Suppress MediaError.message
+ * Bug 16337: Round times exposed by Animation API to nearest 100ms
+ * Bug 21972: about:support is partially broken
+ * Bug 21726: Keep Graphite support disabled
+ * Bug 21323: Enable Mixed Content Blocking
+ * Bug 21685: Disable remote new tab pages
+ * Bug 21790: Disable captive portal detection
+ * Bug 21686: Disable Microsoft Family Safety support
+ * Bug 22073: Make sure Mozilla's experiments are disabled
+ * Bug 21683: Disable newly added Safebrowsing capabilities
+ * Bug 22071: Disable Kinto-based blocklist update mechanism
+ * Bug 22415: Fix format error in our pipeline patch
+ * Bug 22072: Hide TLS error reporting checkbox
+ * Bug 20761: Don't ignore additional SocksPorts
+ * Bug 21862: Rip out potentially unsafe Rust code
+ * Bug 16485: Improve about:cache page
+ * Bug 22462: Backport of patch for bug 1329521 to fix assertion failure
+ * Bug 21340: Identify and backport new patches from Firefox
+ * Bug 22153: Fix broken feeds on higher security levels
+ * Bug 22025: Fix broken certificate error pages on higher security levels
+ * Bug 21887: Fix broken error pages on higher security levels
+ * Bug 22458: Fix broken `about:cache` page on higher security levels
+ * Bug 21876: Enable e10s by default on all supported platforms
+ * Bug 21876: Always use esr policies for e10s
+ * Bug 20905: Fix resizing issues after moving to a direct Firefox patch
+ * Bug 21875: Modal dialogs are maximized in ESR52 nightly builds
+ * Bug 21885: SVG is not disabled in Tor Browser based on ESR52
+ * Bug 17334: Hide Referer when leaving a .onion domain (improved patch)
+ * Bug 18531: Uncaught exception when opening ip-check.info
+ * Bug 18574: Uncaught exception when clicking items in Library
+ * Bug 22327: Isolate Page Info media previews to first party domain
+ * Bug 22452: Isolate tab list menuitem favicons to first party domain
+ * Bug 15555: View-source requests are not isolated by first party domain
+ * Bug 3246: Double-key cookies
+ * Bug 8842: Fix XML parsing error
+ * Bug 5293: Neuter fingerprinting with Battery API
+ * Bug 16886: 16886: "Add-on compatibility check dialog" contains Firefox logo
+ * Bug 19645: TBB zooms text when resizing browser window
+ * Bug 19192: Untrust Blue Coat CA
+ * Bug 19955: Avoid confusing warning that favicon load request got cancelled
+ * Bug 20005: Backport fixes for memory leaks investigation
+ * Bug 20755: ltn.com.tw is broken in Tor Browser
+ * Bug 21896: Commenting on website is broken due to CAPTCHA not being displayed
+ * Bug 20680: Rebase Tor Browser patches to 52 ESR
+ * Bug 22429: Add IPv6 address for Lisbeth:443 obfs4 bridge
+ * Bug 22468: Add default obfs4 bridges frosty and dragon
+ * Windows
+ * Bug 22419: Prevent access to file://
+ * Bug 12426: Make use of HeapEnableTerminationOnCorruption
+ * Bug 19316: Make sure our Windows updates can deal with the SSE2 requirement
+ * Bug 21868: Fix build bustage with FIREFOX_52_0_2esr_RELEASE for Windows
+ * OS X
+ * Bug 21940: Don't allow privilege escalation during update
+ * Bug 22044: Fix broken default search engine on macOS
+ * Bug 21879: Use our default bookmarks on OSX
+ * Bug 21779: Non-admin users can't access Tor Browser on macOS
+ * Bug 21723: Fix inconsistent generation of MOZ_MACBUNDLE_ID
+ * Bug 21724: Make Firefox and Tor Browser distinct macOS apps
+ * Bug 21931: Backport OSX SetupMacCommandLine updater fixes
+ * Bug 15910: Don't download GMPs via the local fallback
+ * Linux
+ * Bug 16285: Remove ClearKey related library stripping
+ * Bug 22041: Fix update error during update to 7.0a3
+ * Bug 22238: Fix use of hardened wrapper for Firefox build
+ * Bug 21907: Fix runtime error on CentOS 6
+ * Bug 15910: Don't download GMPs via the local fallback
+ * Android
+ * Bug 19078: Disable RtspMediaResource stuff in Orfox
+ * Build system
+ * Windows
+ * Bug 21837: Fix reproducibility of accessibility code for Windows
+ * Bug 21240: Create patches to fix mingw-w64 compilation of Firefox ESR 52
+ * Bug 21904: Bump mingw-w64 commit to help with sandbox compilation
+ * Bug 18831: Use own Yasm for Firefox cross-compilation
+ * OS X
+ * Bug 21328: Updating to clang 3.8.0
+ * Bug 21754: Remove old GCC toolchain and macOS SDK
+ * Bug 19783: Remove unused macOS helper scripts
+ * Bug 10369: Don't use old GCC toolchain anymore for utils
+ * Bug 21753: Replace our old GCC toolchain in PT descriptor
+ * Bug 18530: ESR52 based Tor Browser only runs on macOS 10.9+
+ * Bug 22328: Remove clang PIE wrappers
+ * Linux
+ * Bug 21930: NSS libraries are missing from mar-tools archive
+ * Bug 21239: Adapt Linux Firefox descriptor to ESR52 (use GTK2)
+ * Bug 21960: Linux bundles based on ESR 52 are not reproducible anymore
+ * Bug 21629: Fix broken ASan builds when switching to ESR 52
+ * Bug 22444: Use hardening-wrapper when building GCC
+ * Bug 22361: Fix hardening of libraries built in linux/gitian-utils.yml
+
Tor Browser 7.0a4 -- May 15 2017
* All Platforms
* Update Firefox to 52.1.1esr
1
0
[torbutton/master] Bug 18913: about:tor should not have chrome privileges
by gk@torproject.org 05 Jul '17
by gk@torproject.org 05 Jul '17
05 Jul '17
commit 32f9cf56c89ccd2e24924975dc5515e4198d28c3
Author: Kathy Brade <brade(a)pearlcrescent.com>
Date: Sat Jun 24 08:52:19 2017 -0400
Bug 18913: about:tor should not have chrome privileges
Rearchitect our implementation so that about:tor pages are always
loaded in a content process. This also fixes:
Bug 22535: Searching brings me to duckduckgo but my query is discarded.
Bug 21948: Going back to about:tor page gives "Address isn't valid" error.
Most of the code that initializes and updates about:tor content has
been moved to a content script. When necessary, IPC is used to pass
data from the chrome process to the content script.
Removed old, no-longer-used m_tb_orig_BrowserOnAboutPageLoad variable
from torbutton.js.
Also, update the about:tor newChannel() implementation to accept an
nsILoadInfo parameter.
---
src/chrome.manifest | 3 -
src/chrome/content/aboutTor/aboutTor-content.js | 328 ++++++++++++++++++++++++
src/chrome/content/aboutTor/aboutTor.xhtml | 143 +----------
src/chrome/content/torbutton.js | 257 ++++++-------------
src/chrome/skin/aboutTor.css | 11 +-
src/components/aboutTor.js | 21 +-
src/components/startup-observer.js | 7 +-
7 files changed, 441 insertions(+), 329 deletions(-)
diff --git a/src/chrome.manifest b/src/chrome.manifest
index 75bef4e..272401b 100644
--- a/src/chrome.manifest
+++ b/src/chrome.manifest
@@ -152,9 +152,6 @@ contract @torproject.org/startup-observer;1 {06322def-6fde-4c06-aef6-47ae8e79962
component {e6204253-b690-4159-bfe8-d4eedab6b3be} components/cookie-jar-selector.js
contract @torproject.org/cookie-jar-selector;1 {e6204253-b690-4159-bfe8-d4eedab6b3be}
-component {84d47da6-79c3-4661-aa9f-8049476f7bf5} components/aboutTor.js
-contract @mozilla.org/network/protocol/about;1?what=tor {84d47da6-79c3-4661-aa9f-8049476f7bf5}
-
component {5d57312b-5d8c-4169-b4af-e80d6a28a72e} components/torCheckService.js
contract @torproject.org/torbutton-torCheckService;1 {5d57312b-5d8c-4169-b4af-e80d6a28a72e}
diff --git a/src/chrome/content/aboutTor/aboutTor-content.js b/src/chrome/content/aboutTor/aboutTor-content.js
new file mode 100644
index 0000000..ec515bb
--- /dev/null
+++ b/src/chrome/content/aboutTor/aboutTor-content.js
@@ -0,0 +1,328 @@
+/*************************************************************************
+ * Copyright (c) 2017, The Tor Project, Inc.
+ * See LICENSE for licensing information.
+ *
+ * vim: set sw=2 sts=2 ts=8 et syntax=javascript:
+ *
+ * about:tor content script
+ *************************************************************************/
+
+/*
+ * The following about:tor IPC messages are exchanged by this code and
+ * the code in torbutton.js:
+ * AboutTor:Loaded page loaded content -> chrome
+ * AboutTor:ChromeData privileged data chrome -> content
+ * AboutTor:GetToolbarData request toolbar info content -> chrome
+ * AboutTor:ToolbarData toolbar info chrome -> content
+ */
+
+var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+
+
+Cu.import("resource://gre/modules/Services.jsm");
+let { bindPrefAndInit } = Cu.import("resource://torbutton/modules/utils.js", {});
+
+
+var AboutTorListener = {
+ kAboutTorMessages: [ "AboutTor:ChromeData", "AboutTor:ToolbarData" ],
+
+ get isAboutTor() {
+ return content.document.documentURI.toLowerCase() == "about:tor";
+ },
+
+ init: function(aChromeGlobal) {
+ aChromeGlobal.addEventListener("AboutTorLoad", this, false, true);
+ },
+
+ handleEvent: function(aEvent) {
+ if (!this.isAboutTor)
+ return;
+
+ switch (aEvent.type) {
+ case "AboutTorLoad":
+ this.onPageLoad();
+ break;
+ case "pagehide":
+ this.onPageHide();
+ break;
+ case "resize":
+ sendAsyncMessage("AboutTor:GetToolbarData");
+ break;
+ }
+ },
+
+ receiveMessage: function(aMessage) {
+ if (!this.isAboutTor)
+ return;
+
+ switch (aMessage.name) {
+ case "AboutTor:ChromeData":
+ this.onChromeDataUpdate(aMessage.data);
+ break;
+ case "AboutTor:ToolbarData":
+ this.onToolbarDataUpdate(aMessage.data);
+ break;
+ }
+ },
+
+ onPageLoad: function() {
+ // Arrange to update localized text and links.
+ bindPrefAndInit("general.useragent.locale", aNewVal => {
+ this.onLocaleChange(aNewVal);
+ });
+
+ // Add message and event listeners.
+ this.kAboutTorMessages.forEach(aMsg => addMessageListener(aMsg, this));
+ addMessageListener("AboutTor:ChromeData", this);
+ addEventListener("pagehide", this, false);
+ addEventListener("resize", this, false);
+
+ sendAsyncMessage("AboutTor:Loaded");
+ },
+
+ onPageHide: function() {
+ removeEventListener("resize", this, false);
+ removeEventListener("pagehide", this, false);
+ this.kAboutTorMessages.forEach(aMsg => removeMessageListener(aMsg, this));
+ },
+
+ onChromeDataUpdate: function(aData) {
+ let body = content.document.body;
+
+ // Update status: tor on/off, update needed, Tor Browser manual shown.
+ if (aData.torOn)
+ body.setAttribute("toron", "yes");
+ else
+ body.removeAttribute("toron");
+
+ if (aData.updateNeeded)
+ body.setAttribute("torNeedsUpdate", "yes");
+ else
+ body.removeAttribute("torNeedsUpdate");
+
+ if (aData.showManual)
+ body.setAttribute("showmanual", "yes");
+ else
+ body.removeAttribute("showmanual");
+
+ // Setting body.initialized="yes" displays the body, which must be done
+ // at this point because our remaining initialization depends on elements
+ // being visible so that their size and position are accurate.
+ body.setAttribute("initialized", "yes");
+
+ let containerName = "torstatus-" + (aData.torOn ? "on" : "off") +
+ "-container";
+ this.adjustFontSizes(containerName);
+
+ this.onToolbarDataUpdate(aData);
+ },
+
+ onToolbarDataUpdate: function(aData) {
+ this.adjustArrow(aData.toolbarButtonXPos);
+ },
+
+ onLocaleChange: function(aLocale) {
+ this.insertPropertyStrings();
+
+ // Set Tor Browser manual link.
+ content.document.getElementById("manualLink").href =
+ "https://tb-manual.torproject.org/" + aLocale;
+
+ // Insert "Test Tor Network Settings" url.
+ let elem = content.document.getElementById("testTorSettings");
+ if (elem) {
+ let url = Services.prefs.getCharPref(
+ "extensions.torbutton.test_url_interactive");
+ elem.href = url.replace(/__LANG__/g, aLocale.replace(/-/g, '_'));
+ }
+
+ // Display the Tor Browser product name and version.
+ try {
+ const kBrandBundle = "chrome://branding/locale/brand.properties";
+ let brandBundle = Cc["@mozilla.org/intl/stringbundle;1"]
+ .getService(Ci.nsIStringBundleService)
+ .createBundle(kBrandBundle);
+ let productName = brandBundle.GetStringFromName("brandFullName");
+ let tbbVersion = Services.prefs.getCharPref("torbrowser.version");
+ elem = content.document.getElementById("torstatus-version");
+
+ while (elem.firstChild)
+ elem.removeChild(elem.firstChild);
+ elem.appendChild(content.document.createTextNode(productName + '\n'
+ + tbbVersion));
+ } catch (e) {}
+ },
+
+ insertPropertyStrings: function() {
+ try {
+ let kPropertiesURL = "chrome://torbutton/locale/aboutTor.properties";
+
+ let stringBundle = Services.strings.createBundle(kPropertiesURL);
+ let s1 = stringBundle.GetStringFromName("aboutTor.searchDDG.privacy.link");
+ let s2 = stringBundle.GetStringFromName("aboutTor.searchDDG.search.link");
+ let result = stringBundle.formatStringFromName(
+ "aboutTor.searchDDG.privacy", [s1, s2], 2);
+ if (result) {
+ let elem = content.document.getElementById("searchProviderInfo");
+ if (elem)
+ elem.innerHTML = result;
+ }
+ } catch(e) {}
+ },
+
+ // Ensure that text in top area does not overlap the tor on/off (onion) image.
+ // This is done by reducing the font sizes as necessary.
+ adjustFontSizes: function(aContainerName)
+ {
+ let imgElem = content.document.getElementById("torstatus-image");
+ let containerElem = content.document.getElementById(aContainerName);
+ if (!imgElem || !containerElem)
+ return;
+
+ try
+ {
+ let imgRect = imgElem.getBoundingClientRect();
+
+ for (let textElem = containerElem.firstChild; textElem;
+ textElem = textElem.nextSibling)
+ {
+ if ((textElem.nodeType != textElem.ELEMENT_NODE) ||
+ (textElem.nodeName.toLowerCase() == "br"))
+ {
+ continue;
+ }
+
+ let textRect = textElem.getBoundingClientRect();
+ if (0 == textRect.width)
+ continue;
+
+ // Reduce font to 90% of previous size, repeating the process up to 7
+ // times. This allows for a maximum reduction to just less than 50% of
+ // the original size.
+ let maxTries = 7;
+ while ((textRect.left < imgRect.right) && (--maxTries >= 0))
+ {
+ let style = content.document.defaultView
+ .getComputedStyle(textElem, null);
+ let fontSize = parseFloat(style.getPropertyValue("font-size"));
+ textElem.style.fontSize = (fontSize * 0.9) + "px";
+ textRect = textElem.getBoundingClientRect();
+ }
+ }
+
+ } catch (e) {}
+ },
+
+ adjustArrow: function(aToolbarButtonXPos)
+ {
+ let win = content;
+ let doc = content.document;
+ let textElem = doc.getElementById("updatePrompt");
+ let arrowHeadDiv = doc.getElementById("toolbarIconArrowHead");
+ let vertExtDiv = doc.getElementById("toolbarIconArrowVertExtension");
+ let bendDiv = doc.getElementById("toolbarIconArrowBend");
+ let horzExtDiv = doc.getElementById("toolbarIconArrowHorzExtension");
+ if (!textElem || !arrowHeadDiv || !vertExtDiv || !bendDiv || !horzExtDiv)
+ return;
+
+ let arrowTailElems = [ vertExtDiv, bendDiv, horzExtDiv ];
+ if (!aToolbarButtonXPos || isNaN(aToolbarButtonXPos) ||
+ (aToolbarButtonXPos < 0))
+ {
+ arrowHeadDiv.style.display = "none";
+ for (let elem of arrowTailElems)
+ elem.style.display = "none";
+ return;
+ }
+
+ const kArrowMargin = 6; // Horizontal margin between line and text.
+ const kArrowHeadExtraWidth = 9; // Horizontal margin to the line.
+ const kArrowLineThickness = 11;
+ const kBendWidth = 22;
+ const kBendHeight = 22;
+
+ try {
+ // Compensate for any content zoom that may be in effect on about:tor.
+ // Because window.devicePixelRatio always returns 1.0 for non-Chrome
+ // windows (see bug 13875), we use screenPixelsPerCSSPixel for the
+ // content window.
+ let pixRatio = content.QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIDOMWindowUtils)
+ .screenPixelsPerCSSPixel;
+ let tbXpos = Math.round(aToolbarButtonXPos / pixRatio);
+
+ arrowHeadDiv.style.display = "block"; // Must be visible to get offsetWidth.
+ let arrowHalfWidth = Math.round(arrowHeadDiv.offsetWidth / 2);
+ let leftAnchor = textElem.offsetLeft - kArrowMargin
+ - kBendWidth + Math.round(kArrowLineThickness / 2);
+ let rightAnchor = textElem.offsetLeft + textElem.offsetWidth
+ + kArrowMargin + arrowHalfWidth;
+
+ let isArrowOnLeft = (tbXpos < leftAnchor);
+ let isArrowOnRight = (tbXpos > rightAnchor) &&
+ (tbXpos < (win.innerWidth - arrowHalfWidth));
+ let isArrowInMiddle = (tbXpos >= leftAnchor) && (tbXpos <= rightAnchor);
+
+ if (isArrowOnLeft || isArrowOnRight || isArrowInMiddle)
+ {
+ // Position the arrow head.
+ let arrowHeadLeft = tbXpos - arrowHalfWidth;
+ arrowHeadDiv.style.left = arrowHeadLeft + "px";
+ if (isArrowOnLeft || isArrowOnRight)
+ {
+ let horzExtBottom = textElem.offsetTop +
+ Math.round((textElem.offsetHeight + kArrowLineThickness) / 2);
+
+ // Position the vertical (extended) line.
+ let arrowHeadBottom = arrowHeadDiv.offsetTop +
+ arrowHeadDiv.offsetHeight;
+ vertExtDiv.style.top = arrowHeadBottom + "px";
+ vertExtDiv.style.left = (arrowHeadLeft + kArrowHeadExtraWidth) + "px";
+ let ht = horzExtBottom - kBendHeight - arrowHeadBottom;
+ vertExtDiv.style.height = ht + "px";
+
+ // Position the bend (elbow).
+ bendDiv.style.top = (horzExtBottom - kBendHeight) + "px";
+ let bendDivLeft;
+ if (isArrowOnLeft)
+ {
+ bendDiv.setAttribute("pos", "left");
+ bendDivLeft = arrowHeadLeft + kArrowHeadExtraWidth;
+ }
+ else if (isArrowOnRight)
+ {
+ bendDiv.setAttribute("pos", "right");
+ bendDivLeft = arrowHeadLeft + kArrowHeadExtraWidth
+ + kArrowLineThickness - kBendWidth;
+ }
+ bendDiv.style.left = bendDivLeft + "px";
+
+ // Position the horizontal (extended) line.
+ horzExtDiv.style.top = (horzExtBottom - kArrowLineThickness) + "px";
+ let horzExtLeft, w;
+ if (isArrowOnLeft)
+ {
+ horzExtLeft = bendDivLeft + kBendWidth;
+ w = (textElem.offsetLeft - horzExtLeft - kArrowMargin);
+ }
+ else
+ {
+ horzExtLeft = rightAnchor - arrowHalfWidth;
+ w = tbXpos - arrowHalfWidth - horzExtLeft;
+ }
+ horzExtDiv.style.left = horzExtLeft + "px";
+ horzExtDiv.style.width = w + "px";
+ }
+ }
+
+ let headDisplay = (isArrowOnLeft || isArrowInMiddle || isArrowOnRight)
+ ? "block" : "none";
+ arrowHeadDiv.style.display = headDisplay;
+ let tailDisplay = (isArrowOnLeft || isArrowOnRight) ? "block" : "none";
+ for (let elem of arrowTailElems)
+ elem.style.display = tailDisplay;
+ } catch (e) {}
+ }
+};
+
+AboutTorListener.init(this);
diff --git a/src/chrome/content/aboutTor/aboutTor.xhtml b/src/chrome/content/aboutTor/aboutTor.xhtml
index e4050fc..7ae4b8b 100644
--- a/src/chrome/content/aboutTor/aboutTor.xhtml
+++ b/src/chrome/content/aboutTor/aboutTor.xhtml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- - Copyright (c) 2016, The Tor Project, Inc.
+ - Copyright (c) 2017, The Tor Project, Inc.
- See LICENSE for licensing information.
- vim: set sw=2 sts=2 ts=8 et syntax=xml:
-->
@@ -20,154 +20,17 @@
<head>
<title>&aboutTor.title;</title>
<link rel="stylesheet" type="text/css" media="all"
- href="chrome://torbutton/skin/aboutTor.css"/>
+ href="resource://torbutton/chrome/skin/aboutTor.css"/>
<script type="text/javascript;version=1.7">
<![CDATA[
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-function onLoad()
-{
- insertPropertyStrings();
-
- let locale = Services.prefs.getCharPref("general.useragent.locale");
- document.getElementById("manualLink").href = "https://tb-manual.torproject.org/" + locale;
-
- document.addEventListener("AboutTorAdjustArrow", function() {
- adjustToolbarIconArrow();
- }, false);
-
- window.setTimeout( function() {
- adjustToolbarIconArrow();
- }, 0);
-}
-
-function adjustToolbarIconArrow()
-{
- let textElem = document.getElementById("updatePrompt");
- let arrowHeadDiv = document.getElementById("toolbarIconArrowHead");
- let vertExtDiv = document.getElementById("toolbarIconArrowVertExtension");
- let bendDiv = document.getElementById("toolbarIconArrowBend");
- let horzExtDiv = document.getElementById("toolbarIconArrowHorzExtension");
- if (!textElem || !arrowHeadDiv || !vertExtDiv || !bendDiv || !horzExtDiv)
- return;
-
- let arrowTailElems = [ vertExtDiv, bendDiv, horzExtDiv ];
- let tbXpos;
- if (document.body.hasAttribute("torbutton-xpos"))
- tbXpos = parseInt(document.body.getAttribute("torbutton-xpos"), 10);
-
- if (!tbXpos || isNaN(tbXpos) || (tbXpos < 0))
- {
- arrowHeadDiv.style.display = "none";
- for (let elem of arrowTailElems)
- elem.style.display = "none";
- return;
- }
-
- const kArrowMargin = 6; // Horizontal margin between line and text.
- const kArrowHeadExtraWidth = 9; // Horizontal margin to the line.
- const kArrowLineThickness = 11;
- const kBendWidth = 22;
- const kBendHeight = 22;
-
- arrowHeadDiv.style.display = "block"; // Must be visible to get offsetWidth.
- let arrowHalfWidth = Math.round(arrowHeadDiv.offsetWidth / 2);
- let leftAnchor = textElem.offsetLeft - kArrowMargin
- - kBendWidth + Math.round(kArrowLineThickness / 2);
- let rightAnchor = textElem.offsetLeft + textElem.offsetWidth
- + kArrowMargin + arrowHalfWidth;
-
- let isArrowOnLeft = (tbXpos < leftAnchor);
- let isArrowOnRight = (tbXpos > rightAnchor) &&
- (tbXpos < (window.innerWidth - arrowHalfWidth));
- let isArrowInMiddle = (tbXpos >= leftAnchor) && (tbXpos <= rightAnchor);
-
- if (isArrowOnLeft || isArrowOnRight || isArrowInMiddle)
- {
- // Position the arrow head.
- let arrowHeadLeft = tbXpos - arrowHalfWidth;
- arrowHeadDiv.style.left = arrowHeadLeft + "px";
- if (isArrowOnLeft || isArrowOnRight)
- {
- let horzExtBottom = textElem.offsetTop +
- Math.round((textElem.offsetHeight + kArrowLineThickness) / 2);
-
- // Position the vertical (extended) line.
- let arrowHeadBottom = arrowHeadDiv.offsetTop + arrowHeadDiv.offsetHeight;
- vertExtDiv.style.top = arrowHeadBottom + "px";
- vertExtDiv.style.left = (arrowHeadLeft + kArrowHeadExtraWidth) + "px";
- let ht = horzExtBottom - kBendHeight - arrowHeadBottom;
- vertExtDiv.style.height = ht + "px";
-
- // Position the bend (elbow).
- bendDiv.style.top = (horzExtBottom - kBendHeight) + "px";
- let bendDivLeft;
- if (isArrowOnLeft)
- {
- bendDiv.setAttribute("pos", "left");
- bendDivLeft = arrowHeadLeft + kArrowHeadExtraWidth;
- }
- else if (isArrowOnRight)
- {
- bendDiv.setAttribute("pos", "right");
- bendDivLeft = arrowHeadLeft + kArrowHeadExtraWidth
- + kArrowLineThickness - kBendWidth;
- }
- bendDiv.style.left = bendDivLeft + "px";
-
- // Position the horizontal (extended) line.
- horzExtDiv.style.top = (horzExtBottom - kArrowLineThickness) + "px";
- let horzExtLeft, w;
- if (isArrowOnLeft)
- {
- horzExtLeft = bendDivLeft + kBendWidth;
- w = (textElem.offsetLeft - horzExtLeft - kArrowMargin);
- }
- else
- {
- horzExtLeft = rightAnchor - arrowHalfWidth;
- w = tbXpos - arrowHalfWidth - horzExtLeft;
- }
- horzExtDiv.style.left = horzExtLeft + "px";
- horzExtDiv.style.width = w + "px";
- }
- }
-
- let headDisplay = (isArrowOnLeft || isArrowInMiddle || isArrowOnRight)
- ? "block" : "none";
- arrowHeadDiv.style.display = headDisplay;
- let tailDisplay = (isArrowOnLeft || isArrowOnRight) ? "block" : "none";
- for (let elem of arrowTailElems)
- elem.style.display = tailDisplay;
-}
-
-function insertPropertyStrings()
-{
- try {
- let kPropertiesURL = "chrome://torbutton/locale/aboutTor.properties";
-
- let gStringBundle = Services.strings.createBundle(kPropertiesURL);
- let s1 = gStringBundle.GetStringFromName("aboutTor.searchDDG.privacy.link");
- let s2 = gStringBundle.GetStringFromName("aboutTor.searchDDG.search.link");
- let result = gStringBundle.formatStringFromName("aboutTor.searchDDG.privacy",
- [s1, s2], 2);
- if (result) {
- let elem = document.getElementById("searchProviderInfo");
- if (elem)
- elem.innerHTML = result;
- }
- } catch(e) {};
-}
-
window.addEventListener("pageshow", function() {
let evt = new CustomEvent("AboutTorLoad", { bubbles: true });
document.dispatchEvent(evt);
});
-
]]>
</script>
</head>
-<body dir="&locale.dir;" onload="onLoad();">
+<body dir="&locale.dir;">
<div id="torstatus" class="top">
<div id="torstatus-version"/>
<div id="torstatus-image"/>
diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index ae705a3..3999bd4 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -40,8 +40,6 @@ var m_tb_control_host = null; // Set if using TCP.
var m_tb_control_pass = null;
var m_tb_control_desc = null; // For logging.
-var m_tb_orig_BrowserOnAboutPageLoad = null;
-
var m_tb_domWindowUtils = window.QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIDOMWindowUtils);
@@ -203,15 +201,24 @@ var torbutton_tor_check_observer = {
// Update toolbar icon and tooltip.
torbutton_update_toolbutton();
- // Update all open about:tor pages. If the user does not have an
- // about:tor page open in the front most window, open one.
- if (torbutton_update_all_abouttor_pages(undefined, false) < 1) {
- var wm = Cc["@mozilla.org/appshell/window-mediator;1"]
+ // Update all open about:tor pages.
+ torbutton_abouttor_message_handler.updateAllOpenPages();
+
+ // If the user does not have an about:tor tab open in the front most
+ // window, open one.
+ var wm = Cc["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
- var win = wm.getMostRecentWindow("navigator:browser");
- if (win == window) {
- gBrowser.selectedTab = gBrowser.addTab("about:tor");
+ var win = wm.getMostRecentWindow("navigator:browser");
+ if (win == window) {
+ let foundTab = false;
+ let tabBrowser = top.getBrowser();
+ for (let i = 0; !foundTab && (i < tabBrowser.browsers.length); ++i) {
+ let b = tabBrowser.getBrowserAtIndex(i);
+ foundTab = (b.currentURI.spec.toLowerCase() == "about:tor");
}
+
+ if (!foundTab)
+ gBrowser.selectedTab = gBrowser.addTab("about:tor");
}
}
}
@@ -332,10 +339,10 @@ function torbutton_init() {
}
}
- // Add event listener for about:tor page loads.
- document.addEventListener("AboutTorLoad", function(aEvent) {
- torbutton_on_abouttor_load(aEvent.target);
- }, false, true);
+ // Add about:tor IPC message listeners.
+ let aboutTorMessages = [ "AboutTor:Loaded", "AboutTor:GetToolbarData" ];
+ aboutTorMessages.forEach(aMsg => window.messageManager.addMessageListener(
+ aMsg, torbutton_abouttor_message_handler));
// XXX: Get rid of the cached asmjs (or IndexedDB) files on disk in case we
// don't allow things saved to disk. This is an ad-hoc fix to work around
@@ -365,7 +372,7 @@ function torbutton_init() {
// Detect toolbar customization and update arrow on about:tor pages.
window.addEventListener("aftercustomization", function() {
- torbutton_update_all_abouttor_pages(undefined, undefined);
+ torbutton_abouttor_message_handler.updateAllOpenPages();
}, false);
//setting up context menu
@@ -404,9 +411,58 @@ function torbutton_init() {
torbutton_init_user_manual_links();
+ // Arrange for our about:tor content script to be loaded in each frame.
+ window.messageManager.loadFrameScript(
+ "chrome://torbutton/content/aboutTor/aboutTor-content.js", true);
+
torbutton_log(3, 'init completed');
}
+var torbutton_abouttor_message_handler = {
+ // Receive IPC messages from the about:tor content script.
+ receiveMessage: function(aMessage) {
+ switch(aMessage.name) {
+ case "AboutTor:Loaded":
+ torbutton_show_sec_slider_notification();
+ aMessage.target.messageManager.sendAsyncMessage("AboutTor:ChromeData",
+ this.chromeData);
+ break;
+ case "AboutTor:GetToolbarData":
+ aMessage.target.messageManager.sendAsyncMessage("AboutTor:ToolbarData",
+ this.toolbarData);
+ break;
+ }
+ },
+
+ // Send privileged data to all of the about:tor content scripts.
+ updateAllOpenPages: function() {
+ window.messageManager.broadcastAsyncMessage("AboutTor:ChromeData",
+ this.chromeData);
+ },
+
+ // The chrome data contains all of the data needed by the about:tor
+ // content process that is only available here (in the chrome process).
+ // It is sent to the content process when an about:tor window is opened
+ // and in response to events such as the browser noticing that an update
+ // is available.
+ get chromeData() {
+ return {
+ torOn: torbutton_tor_check_ok(),
+ updateNeeded: torbutton_update_is_needed(),
+ showManual: torbutton_show_torbrowser_manual(),
+ toolbarButtonXPos: torbutton_get_toolbarbutton_xpos()
+ };
+ },
+
+ // The toolbar data only contains the x coordinate of Torbutton's toolbar
+ // item; it is sent back to the content process as the about:tor window
+ // is resized.
+ get toolbarData() {
+ return {
+ toolbarButtonXPos: torbutton_get_toolbarbutton_xpos()
+ };
+ }
+};
function torbutton_should_prompt_for_language_preference() {
return torbutton_get_general_useragent_locale().substring(0, 2) != "en" &&
@@ -570,7 +626,7 @@ function torbutton_notify_if_update_needed() {
setOrClearAttribute(btn, "tbUpdateNeeded", updateNeeded);
// Update all open about:tor pages.
- torbutton_update_all_abouttor_pages(updateNeeded, undefined);
+ torbutton_abouttor_message_handler.updateAllOpenPages();
// Make the "check for update" menu item bold if an update is needed.
var item = document.getElementById("torbutton-checkForUpdate");
@@ -597,117 +653,11 @@ function torbutton_check_for_update() {
prompter.checkForUpdates();
}
-// Pass undefined for a parameter to have this function determine it.
-// Returns a count of open pages that were updated,
-function torbutton_update_all_abouttor_pages(aUpdateNeeded, aTorIsOn) {
- if (aUpdateNeeded === undefined)
- aUpdateNeeded = torbutton_update_is_needed();
- if (aTorIsOn === undefined)
- aTorIsOn = torbutton_tor_check_ok();
-
- var count = 0;
- var tabBrowser = top.getBrowser();
- var tabs = tabBrowser.mTabs;
- if (tabs && (tabs.length > 0)) {
- for (var tab = tabs[0]; tab != null; tab = tab.nextSibling) {
- try {
- let doc = tabBrowser.getBrowserForTab(tab).contentDocument;
- if (torbutton_update_abouttor_doc(doc, aTorIsOn, aUpdateNeeded))
- ++count;
- } catch(e) {}
- }
- }
-
- return count;
-}
-
-// Returns true if aDoc is an about:tor page.
-function torbutton_update_abouttor_doc(aDoc, aTorOn, aUpdateNeeded) {
- var isAboutTor = torbutton_is_abouttor_doc(aDoc);
- if (isAboutTor) {
- if (aTorOn)
- aDoc.body.setAttribute("toron", "yes");
- else
- aDoc.body.removeAttribute("toron");
-
- if (aUpdateNeeded)
- aDoc.body.setAttribute("torNeedsUpdate", "yes");
- else
- aDoc.body.removeAttribute("torNeedsUpdate");
-
- if (torbutton_show_torbrowser_manual())
- aDoc.body.setAttribute("showmanual", "yes");
- else
- aDoc.body.removeAttribute("showmanual");
-
- // Display product name and TBB version.
- try {
- const kBrandBundle = "chrome://branding/locale/brand.properties";
- let brandBundle = Cc["@mozilla.org/intl/stringbundle;1"]
- .getService(Ci.nsIStringBundleService)
- .createBundle(kBrandBundle);
- let productName = brandBundle.GetStringFromName("brandFullName");
- let tbbVersion = m_tb_prefs.getCharPref("torbrowser.version");
- let e = aDoc.getElementById("torstatus-version");
-
- while (e.firstChild)
- e.removeChild(e.firstChild);
- e.appendChild(aDoc.createTextNode(productName + '\n' + tbbVersion));
- } catch (e) {}
-
- let containerName = "torstatus-" + (aTorOn ? "on" : "off") + "-container";
- torbutton_adjust_abouttor_fontsizes(aDoc, containerName);
- torbutton_update_abouttor_arrow(aDoc);
- }
-
- return isAboutTor;
-}
-
-// Ensure that text in top area does not overlap the tor on/off (onion) image.
-// This is done by reducing the font sizes as necessary.
-function torbutton_adjust_abouttor_fontsizes(aDoc, aContainerName)
-{
- let imgElem = aDoc.getElementById("torstatus-image");
- let containerElem = aDoc.getElementById(aContainerName);
- if (!imgElem || !containerElem)
- return;
-
- try
- {
- let imgRect = imgElem.getBoundingClientRect();
-
- for (let textElem = containerElem.firstChild; textElem;
- textElem = textElem.nextSibling)
- {
- if ((textElem.nodeType != textElem.ELEMENT_NODE) ||
- (textElem.nodeName.toLowerCase() == "br"))
- {
- continue;
- }
-
- let textRect = textElem.getBoundingClientRect();
- if (0 == textRect.width)
- continue;
-
- // Reduce font to 90% of previous size, repeating the process up to 7
- // times. This allows for a maximum reduction to just less than 50% of
- // the original size.
- let maxTries = 7;
- while ((textRect.left < imgRect.right) && (--maxTries >= 0))
- {
- let style = aDoc.defaultView.getComputedStyle(textElem, null);
- let fontSize = parseFloat(style.getPropertyValue("font-size"));
- textElem.style.fontSize = (fontSize * 0.9) + "px";
- textRect = textElem.getBoundingClientRect();
- }
- }
- } catch (e) {}
-}
-
-// Determine X position of torbutton toolbar item and pass it through
-// to the xhtml document by setting a torbutton-xpos attribute on the body.
-// The value that is set takes retina displays and content zoom into account.
-function torbutton_update_abouttor_arrow(aDoc) {
+// Determine X position of Torbutton toolbar item. The value returned
+// accounts for retina but not content zoom.
+// undefined is returned if the value cannot be determined (e.g., if the
+// toolbar item is not on the toolbar).
+function torbutton_get_toolbarbutton_xpos() {
try {
let tbXpos = -1;
let tbItem = torbutton_get_toolbutton();
@@ -721,55 +671,16 @@ function torbutton_update_abouttor_arrow(aDoc) {
}
if (tbXpos >= 0) {
- // Convert to device-independent units, compensating for retina display
- // and content zoom that may be in effect on the about:tor page.
- // Because window.devicePixelRatio always returns 1.0 for non-Chrome
- // windows (see bug 13875), we use screenPixelsPerCSSPixel for the
- // content window.
+ // Convert to device-independent units, compensating for retina display.
tbXpos *= window.devicePixelRatio;
- let pixRatio = gBrowser.contentWindow
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils)
- .screenPixelsPerCSSPixel;
- tbXpos = Math.round(tbXpos / pixRatio);
- aDoc.body.setAttribute("torbutton-xpos", tbXpos);
- } else {
- aDoc.body.removeAttribute("torbutton-xpos");
+ return tbXpos;
}
-
- let evt = new Event("AboutTorAdjustArrow");
- aDoc.dispatchEvent(evt);
} catch(e) {}
-}
-
-function torbutton_on_abouttor_load(aDoc) {
- if (torbutton_is_abouttor_doc(aDoc) &&
- !aDoc.documentElement.hasAttribute("aboutTorLoaded")) {
- aDoc.documentElement.setAttribute("aboutTorLoaded", true);
-
- // Show correct Tor on/off and "update needed" status.
- let torOn = torbutton_tor_check_ok();
- let needsUpdate = torbutton_update_is_needed();
- torbutton_update_abouttor_doc(aDoc, torOn, needsUpdate);
-
- aDoc.defaultView.addEventListener("resize",
- function() { torbutton_update_abouttor_arrow(aDoc); },
- false);
-
- // Insert "Test Tor Network Settings" url.
- let elem = aDoc.getElementById("testTorSettings");
- if (elem) {
- let locale = m_tb_prefs.getCharPref("general.useragent.locale");
- locale = locale.replace(/-/g, '_');
- let url = m_tb_prefs.getCharPref(
- "extensions.torbutton.test_url_interactive");
- elem.href = url.replace(/__LANG__/g, locale);
- }
- }
- if (m_tb_orig_BrowserOnAboutPageLoad)
- m_tb_orig_BrowserOnAboutPageLoad(aDoc);
+ return undefined;
+}
+function torbutton_show_sec_slider_notification() {
// Show the notification about the new security slider.
if (m_tb_prefs.
getBoolPref("extensions.torbutton.show_slider_notification")) {
@@ -797,10 +708,6 @@ function torbutton_on_abouttor_load(aDoc) {
}
}
-function torbutton_is_abouttor_doc(aDoc) {
- return (aDoc && /^about:tor$/i.test(aDoc.documentURI.toLowerCase()));
-}
-
// Bug 1506 P4: Checking for Tor Browser updates is pretty important,
// probably even as a fallback if we ever do get a working updater.
function torbutton_do_async_versioncheck() {
@@ -2449,7 +2356,7 @@ function torbutton_init_user_manual_links() {
let menuitem = document.getElementById("torBrowserUserManual");
bindPrefAndInit("general.useragent.locale", val => {
menuitem.hidden = !torbutton_show_torbrowser_manual();
- torbutton_update_all_abouttor_pages(undefined, undefined);
+ torbutton_abouttor_message_handler.updateAllOpenPages();
});
}
diff --git a/src/chrome/skin/aboutTor.css b/src/chrome/skin/aboutTor.css
index 3f747a9..c0d2ebc 100644
--- a/src/chrome/skin/aboutTor.css
+++ b/src/chrome/skin/aboutTor.css
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, The Tor Project, Inc.
+ * Copyright (c) 2017, The Tor Project, Inc.
* See LICENSE for licensing information.
*
* vim: set sw=2 sts=2 ts=8 et syntax=css:
@@ -34,6 +34,15 @@ body[toron] {
background-image: -moz-linear-gradient(top, #ffffff, #ffffff 10%, #d5ffd5 50%, #d5ffd5);
}
+/* Hide the entire document by default to avoid showing the incorrect
+ * Tor on / off status (that info must be retrieved from the chrome
+ * process, which involves IPC when multiprocess mode is enabled). An
+ * initialized attribute will be added as soon as the status is known.
+ */
+body:not([initialized]) {
+ display: none;
+}
+
#torstatus-version {
position: fixed;
top: 6px;
diff --git a/src/components/aboutTor.js b/src/components/aboutTor.js
index 2a3431f..e3ee03d 100644
--- a/src/components/aboutTor.js
+++ b/src/components/aboutTor.js
@@ -1,9 +1,9 @@
/*************************************************************************
- * Copyright (c) 2013, The Tor Project, Inc.
+ * Copyright (c) 2017, The Tor Project, Inc.
* See LICENSE for licensing information.
*
* vim: set sw=2 sts=2 ts=8 et syntax=javascript:
- *
+ *
* about:tor component
*************************************************************************/
@@ -17,9 +17,9 @@ const kAboutTorURL = "chrome://torbutton/content/aboutTor/aboutTor.xhtml";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
-
+
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
+
function AboutTor()
{
}
@@ -35,11 +35,12 @@ AboutTor.prototype =
contractID: kMODULE_CONTRACTID,
// nsIAboutModule implementation:
- newChannel: function(aURI)
+ newChannel: function(aURI, aLoadInfo)
{
let ioSvc = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService);
- let channel = ioSvc.newChannel(kAboutTorURL, null, null);
+ let uri = ioSvc.newURI(kAboutTorURL, null, null);
+ let channel = ioSvc.newChannelFromURIWithLoadInfo(uri, aLoadInfo);
channel.originalURI = aURI;
return channel;
@@ -47,9 +48,13 @@ AboutTor.prototype =
getURIFlags: function(aURI)
{
- return Ci.nsIAboutModule.ALLOW_SCRIPT;
+ return Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT |
+ Ci.nsIAboutModule.URI_MUST_LOAD_IN_CHILD |
+ Ci.nsIAboutModule.ALLOW_SCRIPT;
}
};
-const NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutTor]);
+let factory = XPCOMUtils._getFactory(AboutTor);
+let reg = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
+reg.registerFactory(kMODULE_CID, "", kMODULE_CONTRACTID, factory);
diff --git a/src/components/startup-observer.js b/src/components/startup-observer.js
index 65ca659..dac7aff 100644
--- a/src/components/startup-observer.js
+++ b/src/components/startup-observer.js
@@ -61,12 +61,15 @@ function StartupObserver() {
this.logger.log(4, "Early proxy change failed. Will try again at profile load. Error: "+e);
}
- // Arrange for our nsIContentPolicy filter to be loaded in the
- // default (chrome) process as well as in each content process.
+ // Arrange for our nsIContentPolicy filter and about:tor handler to be
+ // loaded in the default (chrome) process as well as in each content
+ // process.
let ppmm = Cc["@mozilla.org/parentprocessmessagemanager;1"]
.getService(Ci.nsIProcessScriptLoader);
ppmm.loadProcessScript("resource://torbutton/components/content-policy.js",
true);
+ ppmm.loadProcessScript("resource://torbutton/components/aboutTor.js",
+ true);
}
StartupObserver.prototype = {
1
0