diff --git a/.eslintrc-ignores.js b/.eslintrc-ignores.js index c548d07a7bc374042536d6e410c2d6e193b3b810..9358dcd32d7b4de003a899d90f343ae469e87576 100644 --- a/.eslintrc-ignores.js +++ b/.eslintrc-ignores.js @@ -305,4 +305,11 @@ module.exports = [ // Support for Import attributes is only available in ESLint v9.19 // https://bugzilla.mozilla.org/show_bug.cgi?id=1944290 "netwerk/test/mochitests/test_import_json_module.mjs", + + "browser/app/profile/001-base-profile.js", + "browser/app/profile/000-tor-browser.js", + "mobile/android/app/000-tor-browser-android.js", + "toolkit/content/pt_config.json", + "toolkit/content/moat_contries_dev_build.json", + "toolkit/components/lox/lox_wasm.jsm", ]; diff --git a/.gitignore b/.gitignore index cf7458403f2484f5091804975d99635587422f39..dd47d3948683c4e4e67ecee2ab029ec2d46788e0 100644 --- a/.gitignore +++ b/.gitignore @@ -364,3 +364,15 @@ toolkit/crashreporter/minidump-analyzer/analyzer-test/target/ # Ignore mozperftest artifacts folder /artifacts/ + +# Ignore binary base of Tor Browser +.binaries + +# Other files modified at build time +mobile/android/.experimenter.json + +# Tor libraries for local builds +mobile/android/fenix/tools/nimbus-fml +mobile/android/fenix/app/tor-expert-bundle.aar +mobile/android/fenix/app/src/main/assets/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..af3c9bf5020f1c708c34464f33230dfbbd20274f --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,16 @@ +stages: + - update-container-images + - lint + - startup-test + - update-translations + +variables: + IMAGE_PATH: containers.torproject.org/tpo/applications/tor-browser/base:latest + LOCAL_REPO_PATH: /srv/apps-repos/tor-browser.git + +include: + - local: '.gitlab/ci/mixins.yml' + - local: '.gitlab/ci/jobs/lint/lint.yml' + - local: '.gitlab/ci/jobs/startup-test/startup-test.yml' + - local: '.gitlab/ci/jobs/update-containers.yml' + - local: '.gitlab/ci/jobs/update-translations.yml' diff --git a/.gitlab/ci/containers/base/Containerfile b/.gitlab/ci/containers/base/Containerfile new file mode 100644 index 0000000000000000000000000000000000000000..c10d1a45ad7b77569dcae9fc492eca860ca6cd6a --- /dev/null +++ b/.gitlab/ci/containers/base/Containerfile @@ -0,0 +1,51 @@ +# This image is published in containers.torproject.org/tpo/applications/tor-browser/base +# +# Whenever there are changes to this file, +# they are autopublished on merge to the tpo/applications/tor-browser repository. +# +# The image is updated roughly once a monce when the tor-browser repository is rebased. + +FROM containers.torproject.org/tpo/tpa/base-images/python:bookworm + +RUN apt-get update && apt-get install -y \ + clang \ + curl \ + git \ + libasound2-dev \ + libdbus-glib-1-dev \ + libgtk-3-dev \ + libpango1.0-dev \ + libpulse-dev \ + libx11-xcb-dev \ + libxcomposite-dev \ + libxcursor-dev \ + libxdamage-dev \ + libxi-dev \ + libxrandr-dev \ + libxtst-dev \ + make \ + m4 \ + mercurial \ + nasm \ + pkgconf \ + unzip \ + x11-utils \ + xvfb \ + xz-utils \ + wget && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +COPY taskcluster/docker/recipes/install-node.sh ./install-node.sh +RUN chmod +x install-node.sh +RUN ./install-node.sh +RUN rm ./install-node.sh + +COPY taskcluster/kinds/fetch/toolchains.yml ./toolchains.yml +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $(grep -oP 'rust-\K[0-9.]+(?=:)' ./toolchains.yml) +RUN $HOME/.cargo/bin/cargo install cbindgen --version $(grep -oP 'cbindgen-\K[0-9.]+(?=:)' ./toolchains.yml) +RUN rm ./toolchains.yml + +CMD ["/bin/bash"] diff --git a/.gitlab/ci/jobs/lint/helpers.py b/.gitlab/ci/jobs/lint/helpers.py new file mode 100755 index 0000000000000000000000000000000000000000..aa12aca59019c9c858787e87c5e98bb9b6381449 --- /dev/null +++ b/.gitlab/ci/jobs/lint/helpers.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python3 + +import argparse +import os +import re +import shlex +import subprocess + + +def git(command): + result = subprocess.run( + ["git"] + shlex.split(command), check=True, capture_output=True, text=True + ) + return result.stdout.strip() + + +def get_firefox_tag(reference): + """Extracts the Firefox tag associated with a branch or tag name. + + The "firefox tag" is the tag that marks + the end of the Mozilla commits and the start of the Tor Project commits. + + Know issue: If ever there is more than one tag per Firefox ESR version, + this function may return the incorrect reference number. + + Args: + reference: The branch or tag name to extract the Firefox tag from. + Expected format is tor-browser-91.2.0esr-11.0-1, + where 91.2.0esr is the Firefox version. + + Returns: + The reference specifier of the matching Firefox tag. + An exception will be raised if anything goes wrong. + """ + + # Extracts the version number from a branch or tag name. + firefox_version = "" + match = re.search(r"(?<=browser-)([^-]+)", reference) + if match: + # TODO: Validate that what we got is actually a valid semver string? + firefox_version = match.group(1) + else: + raise ValueError(f"Failed to extract version from reference '{reference}'.") + + major_version = firefox_version.split(".")[0] + minor_patch_version = "_".join(firefox_version.split(".")[1:]) + + remote_tags = git("ls-remote --tags origin") + + # Each line looks like: + # 9edd658bfd03a6b4743ecb75fd4a9ad968603715 refs/tags/FIREFOX_91_9_0esr_BUILD1 + pattern = ( + rf"(.*)FIREFOX_{re.escape(major_version)}_{re.escape(minor_patch_version)}(.*)$" + ) + match = re.search(pattern, remote_tags, flags=re.MULTILINE) + if not match: + # Attempt to match with a nightly tag, in case the ESR tag is not found + pattern = rf"(.*)FIREFOX_NIGHTLY_{re.escape(major_version)}(.*)$" + match = re.search(pattern, remote_tags, flags=re.MULTILINE) + + if match: + return match.group(0).split()[0] + else: + raise ValueError( + f"Failed to find reference specifier for Firefox tag of version '{firefox_version}' from '{reference}'." + ) + + +def get_list_of_changed_files(): + """Gets a list of files changed in the working directory. + + This function is meant to be run inside the Gitlab CI environment. + + When running in a default branch, get the list of changed files since the last Firefox tag. + When running for a new MR commit, get a list of changed files in the current MR. + + Returns: + A list of filenames of changed files (excluding deleted files). + An exception wil be raised if anything goes wrong. + """ + + base_reference = "" + + if os.getenv("CI_PIPELINE_SOURCE") == "merge_request_event": + # For merge requests, the base_reference is the common ancestor between the MR and the target branch + base_reference = os.getenv("CI_MERGE_REQUEST_DIFF_BASE_SHA") + else: + # When not in merge requests, the base reference is the Firefox tag + base_reference = get_firefox_tag(os.getenv("CI_COMMIT_BRANCH")) + + if not base_reference: + raise RuntimeError("No base reference found. There might be more errors above.") + + # Fetch the tag reference + git(f"fetch origin {base_reference} --depth=1 --filter=blob:none") + # Return but filter the issue_templates files because those file names have spaces which can cause issues + return git("diff --diff-filter=d --name-only FETCH_HEAD HEAD").split("\n") + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="") + + parser.add_argument( + "--get-firefox-tag", + help="Get the Firefox tag related to a given (tor-mullvad-base)-browser tag or branch name.", + type=str, + ) + parser.add_argument( + "--get-changed-files", + help="Get list of changed files." + "When running from a merge request get sthe list of changed files since the merge-base of the current branch." + "When running from a protected branch i.e. any branch that starts with -browser-, gets the list of files changed since the FIREFOX_ tag.", + action="store_true", + ) + + args = parser.parse_args() + + if args.get_firefox_tag: + print(get_firefox_tag(args.get_firefox_tag)) + elif args.get_changed_files: + print("\n".join(get_list_of_changed_files())) + else: + print("No valid option provided.") diff --git a/.gitlab/ci/jobs/lint/lint.yml b/.gitlab/ci/jobs/lint/lint.yml new file mode 100644 index 0000000000000000000000000000000000000000..767e6ce90bcc6da5496ce507f367028047ad50f4 --- /dev/null +++ b/.gitlab/ci/jobs/lint/lint.yml @@ -0,0 +1,296 @@ +.base: + extends: .with-local-repo-bash + stage: lint + image: $IMAGE_PATH + interruptible: true + variables: + MOZBUILD_STATE_PATH: "$CI_PROJECT_DIR/.cache/mozbuild" + cache: + paths: + - node_modules + - .cache/mozbuild + # Store the cache regardless on job outcome + when: 'always' + # Share the cache throughout all pipelines running for a given branch + key: $CI_COMMIT_REF_SLUG + tags: + # Run these jobs in the browser dedicated runners. + - firefox + +eslint: + extends: .base + script: + - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v -l eslint + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + changes: + # List copied from: taskcluster/ci/source-test/mozlint.yml + # + # Files that are likely audited. + - '**/*.js' + - '**/*.jsm' + - '**/*.json' + - '**/*.jsx' + - '**/*.mjs' + - '**/*.sjs' + - '**/*.html' + - '**/*.xhtml' + - '**/*.xml' + - 'tools/lint/eslint.yml' + # Run when eslint policies change. + - '**/.eslintignore' + - '**/*eslintrc*' + # The plugin implementing custom checks. + - 'tools/lint/eslint/eslint-plugin-mozilla/**' + - 'tools/lint/eslint/eslint-plugin-spidermonkey-js/**' + # Run job whenever a commit is merged to a protected branch + - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push') + +stylelint: + extends: .base + script: + - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v -l stylelint + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + changes: + # List copied from: taskcluster/ci/source-test/mozlint.yml + # + # Files that are likely audited. + - '**/*.css' + - 'tools/lint/styleint.yml' + # Run when stylelint policies change. + - '**/.stylelintignore' + - '**/*stylelintrc*' + # Run job whenever a commit is merged to a protected branch + - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push') + +py-black: + extends: .base + script: + - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v -l black + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + changes: + # List copied from: taskcluster/ci/source-test/mozlint.yml + # + # The list of extensions should match tools/lint/black.yml + - '**/*.py' + - '**/moz.build' + - '**/*.configure' + - '**/*.mozbuild' + - 'pyproject.toml' + - 'tools/lint/black.yml' + # Run job whenever a commit is merged to a protected branch + - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push') + +py-ruff: + extends: .base + script: + - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v -l ruff + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + changes: + # List copied from: taskcluster/ci/source-test/mozlint.yml + # + - '**/*.py' + - '**/*.configure' + - '**/.ruff.toml' + - 'pyproject.toml' + - 'tools/lint/ruff.yml' + - 'tools/lint/python/ruff.py' + - 'tools/lint/python/ruff_requirements.txt' + # Run job whenever a commit is merged to a protected branch + - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push') + +yaml: + extends: .base + script: + - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v -l yaml + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + changes: + # List copied from: taskcluster/ci/source-test/mozlint.yml + # + - '**/*.yml' + - '**/*.yaml' + - '**/.ymllint' + # Run job whenever a commit is merged to a protected branch + - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push') + +shellcheck: + extends: .base + script: + - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v -l shellcheck + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + changes: + # List copied from: taskcluster/ci/source-test/mozlint.yml + # + - '**/*.sh' + - 'tools/lint/shellcheck.yml' + # Run job whenever a commit is merged to a protected branch + - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push') + +clang-format: + extends: .base + script: + - ./mach configure --without-wasm-sandboxed-libraries --with-base-browser-version=0.0.0 + - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v -l clang-format + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + changes: + # List copied from: taskcluster/ci/source-test/mozlint.yml + # + - '**/*.cpp' + - '**/*.c' + - '**/*.cc' + - '**/*.h' + - '**/*.m' + - '**/*.mm' + - 'tools/lint/clang-format.yml' + # Run job whenever a commit is merged to a protected branch + - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push') + +rustfmt: + extends: .base + script: + - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v -l rustfmt + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + changes: + # List copied from: taskcluster/ci/source-test/mozlint.yml + # + - '**/*.rs' + - 'tools/lint/rustfmt.yml' + # Run job whenever a commit is merged to a protected branch + - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push') + +fluent-lint: + extends: .base + script: + - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v -l fluent-lint + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + changes: + # List copied from: taskcluster/ci/source-test/mozlint.yml + # + - '**/*.ftl' + - 'tools/lint/fluent-lint.yml' + - 'tools/lint/fluent-lint/exclusions.yml' + # Run job whenever a commit is merged to a protected branch + - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push') + +localization: + extends: .base + script: + - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v -l l10n + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + changes: + # List copied from: taskcluster/ci/source-test/mozlint.yml + # + - '**/locales/en-US/**' + - '**/l10n.toml' + - 'third_party/python/compare-locales/**' + - 'third_party/python/fluent/**' + - 'tools/lint/l10n.yml' + # Run job whenever a commit is merged to a protected branch + - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push') + +mingw-capitalization: + extends: .base + script: + - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v -l mingw-capitalization + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + changes: + # List copied from: taskcluster/ci/source-test/mozlint.yml + # + - '**/*.cpp' + - '**/*.cc' + - '**/*.c' + - '**/*.h' + - 'tools/lint/mingw-capitalization.yml' + # Run job whenever a commit is merged to a protected branch + - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push') + +mscom-init: + extends: .base + script: + - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v -l mscom-init + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + changes: + # List copied from: taskcluster/ci/source-test/mozlint.yml + # + - '**/*.cpp' + - '**/*.cc' + - '**/*.c' + - '**/*.h' + - 'tools/lint/mscom-init.yml' + # Run job whenever a commit is merged to a protected branch + - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push') + +file-whitespace: + extends: .base + script: + - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v -l file-whitespace + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + changes: + # List copied from: taskcluster/ci/source-test/mozlint.yml + # + - '**/*.c' + - '**/*.cc' + - '**/*.cpp' + - '**/*.css' + - '**/*.dtd' + - '**/*.idl' + - '**/*.ftl' + - '**/*.h' + - '**/*.html' + - '**/*.md' + - '**/*.properties' + - '**/*.py' + - '**/*.rs' + - '**/*.rst' + - '**/*.webidl' + - '**/*.xhtml' + - '**/*.java' + - 'tools/lint/file-whitespace.yml' + # Run job whenever a commit is merged to a protected branch + - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push') + +test-manifest: + extends: .base + script: + - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v -l test-manifest-alpha -l test-manifest-disable -l test-manifest-skip-if + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + changes: + # List copied from: taskcluster/ci/source-test/mozlint.yml + # + - '**/*.ini' + - 'python/mozlint/**' + - 'tools/lint/**' + # Run job whenever a commit is merged to a protected branch + - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push') + +trojan-source: + extends: .base + script: + - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v -l trojan-source + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + changes: + # List copied from: taskcluster/ci/source-test/mozlint.yml + # + - '**/*.c' + - '**/*.cc' + - '**/*.cpp' + - '**/*.h' + - '**/*.py' + - '**/*.rs' + - 'tools/lint/trojan-source.yml' + # Run job whenever a commit is merged to a protected branch + - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push') diff --git a/.gitlab/ci/jobs/startup-test/startup-test-android.py b/.gitlab/ci/jobs/startup-test/startup-test-android.py new file mode 100644 index 0000000000000000000000000000000000000000..81a39cbb9199b7d3742b16518e6ad38dc2cf1bff --- /dev/null +++ b/.gitlab/ci/jobs/startup-test/startup-test-android.py @@ -0,0 +1,231 @@ +#!/usr/bin/env python3 +import argparse +import json +import os +import sys +import time +from datetime import datetime, timedelta +from enum import Enum + +import requests + +""" +This script runs Android tests on BrowserStack using the BrowserStack App Automate Espresso API. + +Usage: + startup-test-android.py --devices [--tests ] [--app_file_path ] [--test_file_path ] + +Arguments: + --devices: Comma-separated list of devices to test on (required). + --tests: Comma-separated list of tests to run (optional). If not provided, all tests will run. + --app_file_path: Path to the app file (optional). If not provided, yesterday's nightly will be downloaded. + --test_file_path: Path to the test file (optional). If not provided, yesterday's nightly will be downloaded. + +Environment Variables: + BROWSERSTACK_USERNAME: BrowserStack username (required). + BROWSERSTACK_API_KEY: BrowserStack API key (required). + +Description: + - If app and test file paths are not provided, the script downloads the latest nightly build from the Tor Project. + - Uploads the app and test files to BrowserStack. + - Triggers the test run on the specified devices. + - Polls for the test status until completion or timeout. + - Prints the test results and exits with an appropriate status code. +""" + +parser = argparse.ArgumentParser( + description="Run Android startup tests on BrowserStack." +) +parser.add_argument( + "--devices", + type=str, + help="Comma-separated list of devices to test on", + required=True, +) +parser.add_argument("--tests", type=str, help="Comma-separated list of tests to run") +parser.add_argument("--app_file_path", type=str, help="Path to the app file") +parser.add_argument("--test_file_path", type=str, help="Path to the test file") + +args = parser.parse_args() + +if args.app_file_path: + app_file_path = args.app_file_path + test_file_path = args.test_file_path + if not test_file_path: + print( + "\033[1;31mIf either app or test file paths are provided, both must be provided.\033[0m" + ) +else: + + def download_file(url, dest_path): + try: + response = requests.get(url, stream=True) + response.raise_for_status() + with open(dest_path, "wb") as f: + for chunk in response.iter_content(chunk_size=8192): + f.write(chunk) + except Exception as e: + print(f"\033[1;31mFailed to download file from {url}.\033[0m") + print(e) + sys.exit(1) + + yesterday = (datetime.now() - timedelta(days=1)).strftime("%Y.%m.%d") + download_url_base = f"https://nightlies.tbb.torproject.org/nightly-builds/tor-browser-builds/tbb-nightly.{yesterday}/nightly-android-aarch64" + print( + f"No file paths provided, downloading yesterday's nightly from {download_url_base}" + ) + + app_file_url = f"{download_url_base}/tor-browser-noopt-android-aarch64-tbb-nightly.{yesterday}.apk" + test_file_url = ( + f"{download_url_base}/tor-browser-tbb-nightly.{yesterday}-androidTest.apk" + ) + + # BrowserStack will fail if there are `.` in the file name other than before the extension. + yesterday = yesterday.replace(".", "-") + app_file_path = f"/tmp/nightly-{yesterday}.apk" + test_file_path = f"/tmp/nightly-test-{yesterday}.apk" + + download_file(app_file_url, app_file_path) + download_file(test_file_url, test_file_path) + +devices = [device.strip() for device in args.devices.split(",")] +tests = args.tests.split(",") if args.tests else [] + +browserstack_username = os.getenv("BROWSERSTACK_USERNAME") +browserstack_api_key = os.getenv("BROWSERSTACK_API_KEY") +if not browserstack_username or not browserstack_api_key: + print( + "\033[1;31mEnvironment variables BROWSERSTACK_USERNAME and BROWSERSTACK_API_KEY must be set.\033[0m" + ) + sys.exit(1) + +# Upload app file +with open(app_file_path, "rb") as app_file: + response = requests.post( + "https://api-cloud.browserstack.com/app-automate/espresso/v2/app", + auth=(browserstack_username, browserstack_api_key), + files={"file": app_file}, + ) + +if response.status_code != 200: + print("\033[1;31mFailed to upload app file.\033[0m") + print(response.text) + sys.exit(1) + +bs_app_url = response.json().get("app_url") +print("\033[1;32mSuccessfully uploaded app file.\033[0m") +print(f"App URL: {bs_app_url}") + +# Upload test file +with open(test_file_path, "rb") as test_file: + response = requests.post( + "https://api-cloud.browserstack.com/app-automate/espresso/v2/test-suite", + auth=(browserstack_username, browserstack_api_key), + files={"file": test_file}, + ) + +if response.status_code != 200: + print("\033[1;31mFailed to upload test file.\033[0m") + print(response.text) + sys.exit(1) + +bs_test_url = response.json().get("test_suite_url") +print("\033[1;32mSuccessfully uploaded test file.\033[0m") +print(f"Test URL: {bs_test_url}") + +# Trigger tests +test_params = { + "app": bs_app_url, + "testSuite": bs_test_url, + "devices": devices, + "class": tests, +} + +response = requests.post( + "https://api-cloud.browserstack.com/app-automate/espresso/v2/build", + auth=(browserstack_username, browserstack_api_key), + headers={"Content-Type": "application/json"}, + data=json.dumps(test_params), +) + +if response.status_code != 200: + print("\033[1;31mFailed to trigger test run.\033[0m") + print(response.text) + sys.exit(1) + +build_id = response.json().get("build_id") +print("\033[1;32mSuccessfully triggered test run.\033[0m") +print( + f"Test status also available at: https://app-automate.browserstack.com/builds/{build_id}\n===" +) + +# Poll for status +POLLING_TIMEOUT = 30 * 60 # 30min +POLLING_INTERVAL = 30 # 30s + + +class TestStatus(Enum): + QUEUED = "queued" + RUNNING = "running" + ERROR = "error" + FAILED = "failed" + PASSED = "passed" + TIMED_OUT = "timed out" + SKIPPED = "skipped" + + @classmethod + def from_string(cls, s): + try: + return cls[s.upper().replace(" ", "_")] + except KeyError: + raise ValueError(f"\033[1;31m'{s}' is not a valid test status.\033[0m") + + def is_terminal(self): + return self not in {TestStatus.QUEUED, TestStatus.RUNNING} + + def is_success(self): + return self in {TestStatus.PASSED, TestStatus.SKIPPED} + + def color_print(self): + if self == TestStatus.PASSED: + return f"\033[1;32m{self.value}\033[0m" + + if self in {TestStatus.ERROR, TestStatus.FAILED, TestStatus.TIMED_OUT}: + return f"\033[1;31m{self.value}\033[0m" + + if self == TestStatus.SKIPPED: + return f"\033[1;33m{self.value}\033[0m" + + return self.value + + +start_time = time.time() +elapsed_time = 0 +test_status = None +while elapsed_time <= POLLING_TIMEOUT: + response = requests.get( + f"https://api-cloud.browserstack.com/app-automate/espresso/v2/builds/{build_id}", + auth=(browserstack_username, browserstack_api_key), + ) + + if response.status_code != 200: + print("\033[1;31mFailed to get test status.\033[0m") + print(response.text) + sys.exit(1) + + test_status = TestStatus.from_string(response.json().get("status")) + if test_status.is_terminal(): + print(f"===\nTest finished. Result: {test_status.color_print()}") + break + else: + elapsed_time = time.time() - start_time + print(f"Test status: {test_status.value} ({elapsed_time:.2f}s)") + + if elapsed_time > POLLING_TIMEOUT: + print("===\n\033[1;33mWaited for tests for too long.\033[0m") + break + + time.sleep(POLLING_INTERVAL) + +if test_status is None or not test_status.is_success(): + sys.exit(1) diff --git a/.gitlab/ci/jobs/startup-test/startup-test.py b/.gitlab/ci/jobs/startup-test/startup-test.py new file mode 100644 index 0000000000000000000000000000000000000000..65e3bc33bae6000fa9ce6bd5baf036c94912dd1c --- /dev/null +++ b/.gitlab/ci/jobs/startup-test/startup-test.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python3 + +import argparse +import subprocess +from datetime import datetime, timedelta + +PLATFORM_TO_ARCH = { + "linux": ["x86_64", "i686"], + "macos": ["x86_64", "aarch64"], + "windows": ["x86_64", "i686"], +} + + +class DynamicArchAction(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + platform = getattr(namespace, "platform", None) + if not platform: + raise argparse.ArgumentError( + self, "The --platform argument must be provided before --arch." + ) + + valid_archs = PLATFORM_TO_ARCH.get(platform, []) + if values not in valid_archs: + raise argparse.ArgumentError( + self, + f"Invalid architecture '{values}' for platform '{platform}'. " + f"Valid options are: {', '.join(valid_archs)}", + ) + setattr(namespace, self.dest, values) + + +parser = argparse.ArgumentParser( + description="Downloads and executes yesterday's build of Tor or Mullvad browser nightly." +) + +parser.add_argument( + "--platform", + required=True, + help="Specify the platform (linux, macos or windows). Must be provided before --arch.", + choices=PLATFORM_TO_ARCH.keys(), +) +parser.add_argument( + "--arch", + required=True, + help="Specify the architecture (validated dynamically based on --platform).", + action=DynamicArchAction, +) +parser.add_argument( + "--browser", + required=True, + choices=["tor", "mullvad"], + help="Specify the browser (tor or mullvad)", +) + +args = parser.parse_args() +arch = f"-{args.arch}" +extra = "" + +if args.platform == "linux": + archive_extension = "tar.xz" + binary = f"Browser/start-{args.browser}-browser" +elif args.platform == "macos": + archive_extension = "dmg" + # The URL doesn't include the architecture for MacOS, + # because it's a universal build. + arch = "" + if args.browser == "tor": + binary = "Contents/MacOS/firefox" + else: + binary = "Contents/MacOS/mullvadbrowser" +elif args.platform == "windows": + archive_extension = "exe" + + if args.browser == "tor": + extra = "-portable" + binary = "Browser/firefox.exe" + else: + binary = "mullvadbrowser.exe" + +yesterday = (datetime.now() - timedelta(days=1)).strftime("%Y.%m.%d") + +download_url_base = ( + "https://nightlies.tbb.torproject.org/nightly-builds/tor-browser-builds" +) +if args.browser == "tor": + download_url = f"{download_url_base}/tbb-nightly.{yesterday}/nightly-{args.platform}{arch}/{args.browser}-browser-{args.platform}{arch}{extra}-tbb-nightly.{yesterday}.{archive_extension}" +else: + download_url = f"{download_url_base}/tbb-nightly.{yesterday}/mullvadbrowser-nightly-{args.platform}{arch}/{args.browser}-browser-{args.platform}{arch}-tbb-nightly.{yesterday}.{archive_extension}" + +subprocess.run( + [ + "python3", + "testing/mozharness/scripts/does_it_crash.py", + "--run-for", + "30", + "--thing-url", + download_url, + "--thing-to-run", + binary, + ] +) diff --git a/.gitlab/ci/jobs/startup-test/startup-test.yml b/.gitlab/ci/jobs/startup-test/startup-test.yml new file mode 100644 index 0000000000000000000000000000000000000000..cb4d15395342917488a5201fc61eae011a9b6a7f --- /dev/null +++ b/.gitlab/ci/jobs/startup-test/startup-test.yml @@ -0,0 +1,63 @@ +# startup-test-windows: +# extends: .with-local-repo-pwsh +# variables: +# LOCAL_REPO_PATH: "C:\\Users\\windoes\\tor-browser.git" +# stage: startup-test +# interruptible: true +# parallel: +# matrix: +# - BROWSER: ["tor", "mullvad"] +# tags: +# - x86-win11 +# script: +# - ./mach python testing/mozbase/setup_development.py +# - ./mach python .gitlab/ci/jobs/startup-test/startup-test.py --platform windows --arch x86_64 --browser $BROWSER +# rules: +# - if: $CI_PIPELINE_SOURCE == "schedule" + +# startup-test-macos: +# extends: .with-local-repo-bash +# variables: +# LOCAL_REPO_PATH: "/Users/gitlab-runner/tor-browser.git" +# stage: startup-test +# interruptible: true +# parallel: +# matrix: +# - BROWSER: ["tor", "mullvad"] +# tags: +# - x86-macos +# script: +# - ./mach python testing/mozbase/setup_development.py +# - ./mach python .gitlab/ci/jobs/startup-test/startup-test.py --platform macos --arch x86_64 --browser $BROWSER +# rules: +# - if: $CI_PIPELINE_SOURCE == "schedule" + +startup-test-linux: + extends: .with-local-repo-bash + image: $IMAGE_PATH + stage: startup-test + interruptible: true + parallel: + matrix: + - BROWSER: ["tor", "mullvad"] + tags: + - firefox + script: + - Xvfb :99 -screen 0 1400x900x24 & + - export DISPLAY=:99 + - ./mach python testing/mozbase/setup_development.py + - ./mach python .gitlab/ci/jobs/startup-test/startup-test.py --platform linux --arch x86_64 --browser $BROWSER + rules: + - if: $CI_PIPELINE_SOURCE == "schedule" + +startup-test-android: + extends: .with-local-repo-bash + image: $IMAGE_PATH + stage: startup-test + interruptible: true + tags: + - firefox + script: + - ./mach python .gitlab/ci/jobs/startup-test/startup-test-android.py --devices "Samsung Galaxy S23-13.0, Samsung Galaxy S8-7.0" --tests org.mozilla.fenix.LaunchTest + rules: + - if: $CI_PIPELINE_SOURCE == "schedule" diff --git a/.gitlab/ci/jobs/update-containers.yml b/.gitlab/ci/jobs/update-containers.yml new file mode 100644 index 0000000000000000000000000000000000000000..3ec72cad27f6f74d0935e31a21a7033d77a0a944 --- /dev/null +++ b/.gitlab/ci/jobs/update-containers.yml @@ -0,0 +1,16 @@ +build-base-image: + stage: update-container-images + interruptible: true + image: containers.torproject.org/tpo/tpa/base-images/podman:bookworm + script: + - export TAG="${CI_REGISTRY_IMAGE}/base:latest" + - podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - podman build --layers=false $IMAGE -t ${TAG} -f .gitlab/ci/containers/base/Containerfile . + - | + echo -e "\e[33mPushing new image to registry as ${TAG}\e[0m" + podman push ${TAG} + rules: + - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PROJECT_NAMESPACE == 'tpo/applications' && $CI_PIPELINE_SOURCE == 'push') + changes: + - '.gitlab/ci/containers/base/Containerfile' + - '.gitlab-ci.yml' diff --git a/.gitlab/ci/jobs/update-translations.yml b/.gitlab/ci/jobs/update-translations.yml new file mode 100644 index 0000000000000000000000000000000000000000..1bff9eb7b021e616d856159bf19d574181408164 --- /dev/null +++ b/.gitlab/ci/jobs/update-translations.yml @@ -0,0 +1,116 @@ +.update-translation-base: + stage: update-translations + rules: + - if: ($TRANSLATION_FILES != "" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push") + changes: + - "**/*.ftl" + - "**/*.properties" + - "**/*.dtd" + - "**/*strings.xml" + - "**/update-translations.yml" + - "**/l10n/combine/combine.py" + - "**/l10n/combine-translation-versions.py" + - if: ($TRANSLATION_FILES != "" && $FORCE_UPDATE_TRANSLATIONS == "true") + variables: + COMBINED_FILES_JSON: "combined-translation-files.json" + TRANSLATION_FILES: '[ + { + "name": "brand.ftl", + "where": ["browser/branding/tb-release", "toolkit/torbutton"], + "branding": { + "versions": [ + { + "name": "Alpha", + "suffix": "_alpha", + "where": ["browser/branding/tb-alpha"] + }, + { + "name": "Nightly", + "suffix": "_nightly", + "where": ["browser/branding/tb-nightly"] + } + ], + "ids": [ + "-brand-short-name", + "-brand-full-name" + ] + }, + "branch": "tor-browser", + "directory": "branding" + }, + { + "name": "brand.properties", + "where": ["browser/branding/tb-release", "toolkit/torbutton"], + "branding": { + "versions": [ + { + "name": "Alpha", + "suffix": "_alpha", + "where": ["browser/branding/tb-alpha"] + }, + { + "name": "Nightly", + "suffix": "_nightly", + "where": ["browser/branding/tb-nightly"] + } + ], + "ids": [ + "brandShortName", + "brandFullName" + ] + }, + "branch": "tor-browser" + }, + { "name": "tor-browser.ftl", "branch": "tor-browser" }, + { "name": "aboutTBUpdate.dtd", "branch": "tor-browser" }, + { "name": "torbutton.dtd", "branch": "tor-browser" }, + { "name": "onionLocation.properties", "branch": "tor-browser" }, + { "name": "settings.properties", "branch": "tor-browser" }, + { "name": "torbutton.properties", "branch": "tor-browser" }, + { "name": "torConnect.properties", "branch": "tor-browser" }, + { "name": "torlauncher.properties", "branch": "tor-browser" }, + { "name": "base-browser.ftl", "branch": "base-browser" }, + { + "name": "torbrowser_strings.xml", + "branch": "fenix-torbrowserstringsxml", + "exclude-legacy": true + } + ]' + TRANSLATION_INCLUDE_LEGACY: "true" + + +combine-en-US-translations: + extends: .update-translation-base + needs: [] + image: python + variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" + cache: + paths: + - .cache/pip + # Artifact is for translation project job + artifacts: + paths: + - "$COMBINED_FILES_JSON" + expire_in: "60 min" + reports: + dotenv: job_id.env + # Don't load artifacts for this job. + dependencies: [] + script: + # Save this CI_JOB_ID to the dotenv file to be used in the variables for the + # push-en-US-translations job. + - echo 'COMBINE_TRANSLATIONS_JOB_ID='"$CI_JOB_ID" >job_id.env + - pip install compare_locales + - python ./tools/base-browser/l10n/combine-translation-versions.py "$CI_COMMIT_BRANCH" "$TRANSLATION_FILES" "$COMBINED_FILES_JSON" + +push-en-US-translations: + extends: .update-translation-base + needs: + - job: combine-en-US-translations + variables: + COMBINED_FILES_JSON_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/${COMBINE_TRANSLATIONS_JOB_ID}/artifacts/${COMBINED_FILES_JSON}" + trigger: + strategy: depend + project: tor-browser-translation-bot/translation + branch: tor-browser-ci diff --git a/.gitlab/ci/mixins.yml b/.gitlab/ci/mixins.yml new file mode 100644 index 0000000000000000000000000000000000000000..d9e71fb1698aab1a642718f1ad092250dbf0dead --- /dev/null +++ b/.gitlab/ci/mixins.yml @@ -0,0 +1,91 @@ +.with-local-repo-bash: + variables: + GIT_STRATEGY: "none" + FETCH_TIMEOUT: 180 # 3 minutes + before_script: + - git init + - git remote add local "$LOCAL_REPO_PATH" + - | + # Determine the reference of the target branch in the local repository copy. + # + # 1. List all references in the local repository + # 2. Filter the references to the target branch + # 3. Remove tags + # 4. Keep a single line, in case there are too many matches + # 5. Clean up the output + # 6. Remove everything before the last two slashes, because the output is like `refs/heads/...` or `refs/remotes/...` + TARGET_BRANCH=$(git ls-remote local | grep ${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_TARGET_BRANCH_NAME} | grep -v 'refs/tags/' | awk '{print $2}' | tail -1 | sed 's|[^/]*/[^/]*/||') + if [ -z "$TARGET_BRANCH" ]; then + echo "Target branch $TARGET_BRANCH is not yet in local repository. Stopping the pipeline." + exit 1 + fi + - git fetch --depth 500 local $TARGET_BRANCH + - git --no-pager log FETCH_HEAD --oneline -n 5 + - git remote add origin "$CI_REPOSITORY_URL" + - | + if [ -z "${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" ]; then + echo "No branch specified. Stopping the pipeline." + exit 1 + fi + - echo "Fetching from remote branch ${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} with a ${FETCH_TIMEOUT}s timeout." + - | + fetch_with_timeout() { + local remote=$1 + local branch=$2 + + set +e + timeout ${FETCH_TIMEOUT} git fetch "$remote" "$branch" + local fetch_exit=$? + set -e + + if [ "$fetch_exit" -eq 124 ]; then + echo "Fetching failed for branch ${remote}/${branch} due to a timeout. Try again later." + echo "Gitlab may be experiencing slowness or the local copy of the repository on the CI server may be oudated." + return 1 + fi + + return $fetch_exit + } + + if ! fetch_with_timeout origin "${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"; then + echo "Fetching failed for branch ${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}." + echo "Attempting to fetch the merge request branch, assuming this pipeline is not running in a fork." + + fetch_with_timeout origin "merge-requests/${CI_MERGE_REQUEST_IID}/head" || exit 1 + fi + - git checkout FETCH_HEAD + +.with-local-repo-pwsh: + variables: + GIT_STRATEGY: "none" + before_script: + - git init + - git remote add local $env:LOCAL_REPO_PATH + - | + $branchName = $env:CI_COMMIT_BRANCH + if ([string]::IsNullOrEmpty($branchName)) { + $branchName = $env:CI_MERGE_REQUEST_TARGET_BRANCH_NAME + } + $TARGET_BRANCH = git ls-remote local | Select-String -Pattern $branchName | Select-String -Pattern -NotMatch 'refs/tags/' | Select-Object -Last 1 | ForEach-Object { $_.ToString().Split()[1] -replace '^[^/]*/[^/]*/', '' } + if ([string]::IsNullOrEmpty($TARGET_BRANCH)) { + Write-Output "Target branch $TARGET_BRANCH is not yet in local repository. Stopping the pipeline." + exit 1 + } + - git remote add origin $env:CI_REPOSITORY_URL + - | + $branchName = $env:CI_COMMIT_BRANCH + if ([string]::IsNullOrEmpty($branchName)) { + $branchName = $env:CI_MERGE_REQUEST_SOURCE_BRANCH_NAME + } + if ([string]::IsNullOrEmpty($branchName)) { + Write-Output "No branch specified. Stopping the pipeline." + exit 1 + } + - Write-Output "Fetching from remote branch $branchName" + - | + if (! git fetch origin $branchName) { + Write-Output "Fetching failed for branch $branchName from $env:CI_REPOSITORY_URL." + Write-Output "Attempting to fetch the merge request branch, assuming this pipeline is not running in a fork." + git fetch origin "merge-requests/$env:CI_MERGE_REQUEST_IID/head" + } + - git checkout FETCH_HEAD diff --git a/.gitlab/issue_templates/000 Bug Report.md b/.gitlab/issue_templates/000 Bug Report.md new file mode 100644 index 0000000000000000000000000000000000000000..3b42b63e5e23447cd14d5b39539ad1d6962af5cb --- /dev/null +++ b/.gitlab/issue_templates/000 Bug Report.md @@ -0,0 +1,121 @@ +# 🐞 Bug Report + + +## Reproduction steps + + +## Expected behaviour + + +## Actual behaviour + + +## Bookkeeping + + +- Browser version: +- Browser channel: + - [ ] Release + - [ ] Alpha + - [ ] Nightly +- Distribution method: + - [ ] Installer/archive from torproject.org + - [ ] tor-browser-launcher + - [ ] homebrew + - [ ] other (please specify): +- Operating System: + - [ ] Windows + - [ ] macOS + - [ ] Linux + - [ ] Android + - [ ] Tails + - [ ] Other (please specify): +- Operating System Version: + +### Browser UI language + + +### Have you modified any of the settings in `about:preferences` or `about:config`? If yes, which ones? + + +### Do you have any extra extensions installed? + + +## Troubleshooting + + +### Does this bug occur in a fresh installation? + +### Is this bug new? If it is a regression, in which version of the browser did this bug first appear? + + +### Does this bug occur in the Alpha release channel? + + +### Does this bug occur in Firefox ESR (Desktop only)? + + +### Does this bug occur in Firefox Rapid Release? + + + + +--- + +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Type::Bug" diff --git a/.gitlab/issue_templates/010 Proposal.md b/.gitlab/issue_templates/010 Proposal.md new file mode 100644 index 0000000000000000000000000000000000000000..ad6e80d64f1916c2436c2420390618eca69bd4c8 --- /dev/null +++ b/.gitlab/issue_templates/010 Proposal.md @@ -0,0 +1,70 @@ +# 💡 Proposal + + +## User Story + + +## Security and Privacy Implications + + +### Security + + +### Privacy + + +## Accessibility Implications + + +## Other Trade-Offs + + +## Prior Art + +### Does this feature exist in other browsers? +- [ ] Yes + - [ ] Firefox + - [ ] Firefox ESR + - [ ] Other (please specify) +- [ ] No + +### Does this feature exist as an extension? If yes, which one provides this functionality? + + + +--- + +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Type::Proposal" diff --git a/.gitlab/issue_templates/020 Web Compatibility.md b/.gitlab/issue_templates/020 Web Compatibility.md new file mode 100644 index 0000000000000000000000000000000000000000..b42b0aa419eb053713f2fa2463550e7024f4d836 --- /dev/null +++ b/.gitlab/issue_templates/020 Web Compatibility.md @@ -0,0 +1,112 @@ +# 🌍 Web Compatibility + + +## URL + + +## Expected behaviour + + +## Actual behaviour + + +## Reproduction steps + + +## Bookkeeping + + +- Browser version: +- Browser channel: + - [ ] Release + - [ ] Alpha + - [ ] Nightly +- Distribution method: + - [ ] Installer/archive from torproject.org + - [ ] tor-browser-launcher + - [ ] homebrew + - [ ] other (please specify): +- Operating System: + - [ ] Windows + - [ ] macOS + - [ ] Linux + - [ ] Android + - [ ] Tails + - [ ] Other (please specify): +- Operating System Version: + +### Have you modified any of the settings in `about:preferences` or `about:config`? If yes, which ones? + + +### Do you have any extra extensions installed? + + +## Troubleshooting + + +### Does this bug occur in a fresh installation? + +### Is this bug new? If it is a regression, in which version of the browser did this bug first appear? + + +### Does this bug occur in the Alpha release channel? + + +### Does this bug occur in Firefox ESR (Desktop only)? + + +### Does this bug occur in Firefox Rapid Release? + + + + +--- + +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Type::WebCompatibility" diff --git a/.gitlab/issue_templates/030 Test.md b/.gitlab/issue_templates/030 Test.md new file mode 100644 index 0000000000000000000000000000000000000000..54f56652471551db5e443e0bcd1bba29866d0f71 --- /dev/null +++ b/.gitlab/issue_templates/030 Test.md @@ -0,0 +1,29 @@ +# 💣 Test + + +## Description + + +## Scenarios + + + + +--- + +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Type::Test" diff --git a/.gitlab/issue_templates/040 Feature.md b/.gitlab/issue_templates/040 Feature.md new file mode 100644 index 0000000000000000000000000000000000000000..da64b445a1dadc39920b117a8de3728c8c3abced --- /dev/null +++ b/.gitlab/issue_templates/040 Feature.md @@ -0,0 +1,32 @@ +# ✨ Feature + + +## Description + + +## Bookkeeping + +### Proposal + +- tor-browser#12345 + +### Design + +- tpo/UX/Design#123 + + + +--- + +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Type::Feature" diff --git a/.gitlab/issue_templates/050 Backport.md b/.gitlab/issue_templates/050 Backport.md new file mode 100644 index 0000000000000000000000000000000000000000..e9380a5cee7c12698e3e166ac0e95a79bda664cc --- /dev/null +++ b/.gitlab/issue_templates/050 Backport.md @@ -0,0 +1,39 @@ +# ⬅️ Backport Patchset + + +## Bookkeeping + +### Issue(s) +- tor-browser#12345 +- mullvad-browser#123 +- https://bugzilla.mozilla.org/show_bug.cgi?id=1234567 + +### Merge Request(s) +- tor-browser!123 + +### Target Channels + +- [ ] Alpha +- [ ] Stable +- [ ] Legacy + +## Notes + + + + + + +--- + +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Type::Backport" diff --git a/.gitlab/issue_templates/060 Rebase - Alpha.md b/.gitlab/issue_templates/060 Rebase - Alpha.md new file mode 100644 index 0000000000000000000000000000000000000000..fe8dc649222fd2a2e2e0732a751e0f3918c15bdc --- /dev/null +++ b/.gitlab/issue_templates/060 Rebase - Alpha.md @@ -0,0 +1,163 @@ +# ⤵️ Rebase Alpha + +**NOTE:** All examples in this template reference the rebase from 102.7.0esr to 102.8.0esr + +
+ Explanation of Variables + +- `$(ESR_VERSION)`: the Mozilla defined ESR version, used in various places for building tor-browser tags, labels, etc + - **Example**: `102.8.0` +- `$(ESR_TAG)`: the Mozilla defined hg (Mercurial) tag associated with `$(ESR_VERSION)` + - **Example**: `FIREFOX_102_8_0esr_RELEASE` +- `$(ESR_TAG_PREV)`: the Mozilla defined hg (Mercurial) tag associated with the previous ESR version when rebasing (ie, the ESR version we are rebasing from) + - **Example**: `FIREFOX_102_7_0esr_BUILD1` +- `$(BROWSER_MAJOR)`: the browser major version + - **Example**: `12` +- `$(BROWSER_MINOR)`: the browser minor version + - **Example**: either `0` or `5`; Alpha's is always `(Stable + 5) % 10` +- `$(BASE_BROWSER_BRANCH)`: the full name of the current `base-browser` branch + - **Example**: `base-browser-102.8.0esr-12.5-1` +- `$(BASE_BROWSER_BRANCH_PREV)`: the full name of the previous `base-browser` branch + - **Example**: `base-browser-102.7.0esr-12.5-1` +- `$(TOR_BROWSER_BRANCH)`: the full name of the current `tor-browser` branch + - **Example**: `tor-browser-102.8.0esr-12.5-1` +- `$(TOR_BROWSER_BRANCH_PREV)`: the full name of the previous `tor-browser` branch + - **Example**: `tor-browser-102.7.0esr-12.5-1` +
+ +**NOTE:** It is assumed that we've already identified the new ESR branch during the tor-browser stable rebase + +### **Bookkeeping** + +- [ ] Link this issue to the appropriate [Release Prep](https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/issues/?sort=updated_desc&state=opened&label_name%5B%5D=Apps%3A%3AType%3A%3AReleasePreparation) issue. + +### Update Branch Protection Rules + +- [ ] In [Repository Settings](https://gitlab.torproject.org/tpo/applications/tor-browser/-/settings/repository): + - [ ] Remove previous alpha `base-browser` and `tor-browser` branch protection rules (this will prevent pushing new changes to the branches being rebased) + - [ ] Create new `base-browser` and `tor-browser` branch protection rule: + - **Branch**: `*-$(ESR_VERSION)esr-$(BROWSER_MAJOR).$(BROWSER_MINOR)-1*` + - **Example**: `*-102.8.0esr-12.5-1*` + - **Allowed to merge**: `Maintainers` + - **Allowed to push and merge**: `Maintainers` + - **Allowed to force push**: `false` + - If you copied and pasted from old rules, double check you didn't add spaces at the end, as GitLab will not trim them! + +### **Create New Branches** + +- [ ] Find the Firefox mercurial tag `$(ESR_TAG)` + - If `$(BROWSER_MINOR)` is 5, the tag should already exist from the stable release + - Otherwise: + - [ ] Go to `https://hg.mozilla.org/releases/mozilla-esr$(ESR_MAJOR)/tags` + - [ ] Find and inspect the commit tagged with `$(ESR_TAG)` + - Tags are in yellow in the Mercurial web UI + - [ ] Find the equivalent commit in `https://github.com/mozilla/gecko-dev/commits/esr$(ESR_MAJOR)` + - The tag should be very close to `HEAD` (usually the second, before a `No bug - Tagging $(HG_HASH) with $(ESR_TAG)`) + - **Notice**: GitHub sorts commits by time, you might want to use `git log gecko-dev/esr$(ESR_MAJOR)` locally, instead + - [ ] Sign/Tag the `gecko-dev` commit: `git tag -as $(ESR_TAG) $(GIT_HASH) -m "Hg tag $(ESR_TAG)"` +- [ ] Create new alpha `base-browser` branch from Firefox mercurial tag + - Branch name in the form: `base-browser-$(ESR_VERSION)esr-$(BROWSER_MAJOR).$(BROWSER_MINOR)-1` + - **Example**: `base-browser-102.8.0esr-12.5-1` +- [ ] Create new alpha `tor-browser` branch from Firefox mercurial tag + - Branch name in the form: `tor-browser-$(ESR_VERSION)esr-$(BROWSER_MAJOR).$(BROWSER_MINOR)-1` + - **Example**: `tor-browser-102.8.0esr-12.5-1` +- [ ] Push new `base-browser` branch to `upstream` +- [ ] Push new `tor-browser` branch to `upstream` + +### **Rebase tor-browser** + +- [ ] Checkout a new local branch for the `tor-browser` rebase + - **Example**: `git branch tor-browser-rebase FIREFOX_102_8_0esr_BUILD1` +- [ ] **(Optional)** `base-browser` rebase and autosquash + - **NOTE** This step may be skipped if the `HEAD` of the previous `base-browser` branch is a `-buildN` tag + - [ ] Cherry-pick the previous `base-browser` commits up to `base-browser`'s `buildN` tag onto new `base-browser` rebase branch + - **Example**: `git cherry-pick FIREFOX_102_7_0esr_BUILD1..base-browser-102.7.0esr-12.5-1-build1` + - [ ] Rebase and autosquash these cherry-picked commits + - **Example**: `git rebase --autosquash --interactive FIREFOX_102_8_0esr_BUILD1 HEAD` + - [ ] Cherry-pick remainder of patches after the `buildN` tag + - **Example**: `git cherry-pick base-browser-102.7.0esr-12.5-1-build1..upstream/base-browser-102.7.0esr-12.5-1` + +- [ ] `tor-browser` rebase and autosquash + - [ ] Note the current git hash of `HEAD` for `tor-browser` rebase+autosquash step: `git rev-parse HEAD` + - [ ] Cherry-pick the appropriate previous `tor-browser` branch's commit range up to the last `tor-browser` `buildN` tag + - **Example**: `git cherry-pick base-browser-102.7.0esr-12.5-1-build1..tor-browser-102.7.0esr-12.5-1-build1` + - **Example (if separate base-browser rebase was skipped)**: `git cherry-pick FIREFOX_102_7_0esr_BUILD1..tor-browser-102.7.0esr-12.5-1-build1` + - [ ] Rebase and autosquash **ONLY** these newly cherry-picked commits using the commit noted previously: `git rebase --autosquash --interactive $(PREV_HEAD)` + - **Example**: `git rebase --autosquash --interactive FIREFOX_102_8_0esr_RELEASE` + - [ ] **(Optional)** Patch reordering + - **NOTE**: We typically want to do this after new features or bug fix commits which are not !fixups to an existing commit have been merged and are just sitting at the end of the commit history + - Relocate new `base-browser` patches in the patch-set to enforce this rough thematic ordering: + - **MOZILLA BACKPORTS** - official Firefox patches we have backported to our ESR branch: Android-specific security updates, critical bug fixes, worthwhile features, etc + - **MOZILLA REVERTS** - revert commits of official Firefox patches + - **UPLIFT CANDIDATES** - patches which stand on their own and should be uplifted to `mozilla-central` + - **BUILD CONFIGURATION** - tools/scripts, gitlab templates, etc + - **BROWSER CONFIGURATION** - branding, mozconfigs, preference overrides, etc + - **SECURITY PATCHES** - security improvements, hardening, etc + - **PRIVACY PATCHES** - fingerprinting, linkability, proxy bypass, etc + - **FEATURES** - new functionality: updater, UX, letterboxing, security level, add-on + - Relocate new `tor-browser` patches in the patch-set to enforce this rough thematic ordering: + - **BUILD CONFIGURATION** - tools/scripts, gitlab templates, etc + - **BROWSER CONFIGURATION** - branding, mozconfigs, preference overrides, etc + - **UPDATER PATCHES** - updater tweaks, signing keys, etc + - **SECURITY PATCHES** - non tor-dependent security improvements, hardening, etc + - **PRIVACY PATCHES** - non tor-dependent fingerprinting, linkability, proxy bypass, etc + - **FEAURES** - non tor-dependent features + - **TOR INTEGRATION** - legacy tor-launcher/torbutton, tor modules, bootstrapping, etc + - **TOR SECURITY PATCHES** - tor-specific security improvements + - **TOR PRIVACY PATCHES** - tor-specific privacy improvements + - **TOR FEATURES** - new tor-specific functionality: manual, onion-location, onion service client auth, etc + - [ ] Cherry-pick remainder of patches after the last `tor-browser` `buildN` tag + - **Example**: `git cherry-pick tor-browser-102.7.0esr-12.5-1-build1..upstream/tor-browser-102.7.0esr-12.5-1` + - [ ] Rebase and autosquash again, this time replacing all `fixup` and `squash` commands with `pick`. The goal here is to have all of the `fixup` and `squash` commits beside the commit which they modify, but kept un-squashed for easy debugging/bisecting. + - **Example**: `git rebase --autosquash --interactive FIREFOX_102_8_0esr_RELEASE` +- [ ] Compare patch sets to ensure nothing *weird* happened during conflict resolution: + - [ ] diff of diffs: + - Do the diff between `current_patchset.diff` and `rebased_patchset.diff` with your preferred difftool and look at differences on lines that starts with + or - + - `git diff $(ESR_TAG_PREV)..$(BROWSER_BRANCH_PREV) > current_patchset.diff` + - `git diff $(ESR_TAG)..$(BROWSER_BRANCH) > rebased_patchset.diff` + - diff `current_patchset.diff` and `rebased_patchset.diff` + - If everything went correctly, the only lines which should differ should be the lines starting with `index abc123...def456` (unless the previous `base-browser` branch includes changes not included in the previous `tor-browser` branch) + - [ ] rangediff: `git range-diff $(ESR_TAG_PREV)..$(TOR_BROWSER_BRANCH_PREV) $(ESR_TAG)..HEAD` + - **Example**: `git range-dif FIREFOX_102_7_0esr_BUILD1..upstream/tor-browser-102.7.0esr-12.5-1 FIREFOX_102_8_0esr_BUILD1..HEAD` +- [ ] Open MR for the `tor-browser` rebase +- [ ] Merge +- Update and push `base-browser` branch + - [ ] Reset the new `base-browser` branch to the appropriate commit in this new `tor-browser` branch + - [ ] Push these commits to `upstream` +- [ ] Set `$(TOR_BROWSER_BRANCH)` as the default GitLab branch + - [ ] Go to [Repository Settings](https://gitlab.torproject.org/tpo/applications/tor-browser/-/settings/repository) + - [ ] Expand `Branch defaults` + - [ ] Set the branch and leave the `Auto-close` checkbox unchecked + - [ ] Save changes + +### **Sign and Tag** + +- [ ] Sign/Tag `HEAD` of the merged `tor-browser` branch: + - In **tor-browser.git**, checkout the new alpha `tor-browser` branch + - In **tor-browser-build.git**, run signing script: + ```bash + ./tools/browser/sign-tag.torbrowser alpha build1 + ``` + - [ ] Push tag to `upstream` +- [ ] Sign/Tag HEAD of the merged `base-browser` branch: + - In **tor-browser.git**, checkout the new alpha `base-browser` branch + - In **tor-browser-build.git**, run signing script: + ```bash + ./tools/browser/sign-tag.basebrowser alpha build1 + ``` + - [ ] Push tag to `upstream` +- [ ] Update tor-browser-build's `main` branch (no MR required, you can just push it if you have the permissions) + - [ ] Update `projects/firefox/config` + - [ ] Update `firefox_platform_version` + - [ ] Set `browser_build` to 1 (to prevent failures in alpha testbuilds) + - [ ] Update `projects/geckoview/config` + - [ ] Update `firefox_platform_version` + - [ ] Set `browser_build` to 1 (to prevent failures in alpha testbuilds) + + + +--- + +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Type::Rebase" +/label ~"Apps::Priority::Blocker" diff --git a/.gitlab/issue_templates/061 Rebase - Stable.md b/.gitlab/issue_templates/061 Rebase - Stable.md new file mode 100644 index 0000000000000000000000000000000000000000..a324c2059faccea82ace601cdc0b5f5f5709ae54 --- /dev/null +++ b/.gitlab/issue_templates/061 Rebase - Stable.md @@ -0,0 +1,125 @@ +# ⤵️ Rebase Stable + +**NOTE:** All examples in this template reference the rebase from 102.7.0esr to 102.8.0esr + +
+ Explanation of Variables + +- `$(ESR_VERSION)`: the Mozilla defined ESR version, used in various places for building tor-browser tags, labels, etc + - **Example**: `102.8.0` +- `$(ESR_TAG)`: the Mozilla defined hg (Mercurial) tag associated with `$(ESR_VERSION)` + - **Example**: `FIREFOX_102_8_0esr_RELEASE` +- `$(ESR_TAG_PREV)`: the Mozilla defined hg (Mercurial) tag associated with the previous ESR version when rebasing (ie, the ESR version we are rebasing from) + - **Example**: `FIREFOX_102_7_0esr_BUILD1` +- `$(BROWSER_MAJOR)`: the browser major version + - **Example**: `12` +- `$(BROWSER_MINOR)`: the browser minor version + - **Example**: either `0` or `5`; Alpha's is always `(Stable + 5) % 10` +- `$(BASE_BROWSER_BRANCH)`: the full name of the current `base-browser` branch + - **Example**: `base-browser-102.8.0esr-12.0-1` +- `$(BASE_BROWSER_BRANCH_PREV)`: the full name of the previous `base-browser` branch + - **Example**: `base-browser-102.7.0esr-12.0-1` +- `$(TOR_BROWSER_BRANCH)`: the full name of the current `tor-browser` branch + - **Example**: `tor-browser-102.8.0esr-12.0-1` +- `$(TOR_BROWSER_BRANCH_PREV)`: the full name of the previous `tor-browser` branch + - **Example**: `tor-browser-102.7.0esr-12.0-1` +
+ +### **Bookkeeping** + +- [ ] Link this issue to the appropriate [Release Prep](https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/issues/?sort=updated_desc&state=opened&label_name%5B%5D=Apps%3A%3AType%3A%3AReleasePreparation) issue. + +### Update Branch Protection Rules + +- [ ] In [Repository Settings](https://gitlab.torproject.org/tpo/applications/tor-browser/-/settings/repository): + - [ ] Remove previous stable `base-browser` and `tor-browser` branch protection rules (this will prevent pushing new changes to the branches being rebased) + - [ ] Create new `base-browser` and `tor-browser` branch protection rule: + - **Branch**: `*-$(ESR_VERSION)esr-$(BROWSER_MAJOR).$(BROWSER_MINOR)-1*` + - **Example**: `*-102.8.0esr-12.0-1*` + - **Allowed to merge**: `Maintainers` + - **Allowed to push and merge**: `Maintainers` + - **Allowed to force push**: `false` + +### **Identify the Firefox Tagged Commit and Create New Branches** + +- [ ] Find the Firefox mercurial tag here: https://hg.mozilla.org/releases/mozilla-esr102/tags + - **Example**: `FIREFOX_102_8_0esr_BUILD1` +- [ ] Find the analogous `gecko-dev` commit: https://github.com/mozilla/gecko-dev + - **Tip**: Search for unique string (like the Differential Revision ID) found in the mercurial commit in the `gecko-dev/esr102` branch to find the equivalent commit + - **Example**: `3a3a96c9eedd02296d6652dd50314fccbc5c4845` +- [ ] Sign and Tag `gecko-dev` commit + - Sign/Tag `gecko-dev` commit : + - **Tag**: `$(ESR_TAG)` + - **Message**: `Hg tag $(ESR_TAG)` +- [ ] Create new stable `base-browser` branch from tag + - Branch name in the form: `base-browser-$(ESR_VERSION)esr-$(BROWSER_MAJOR).$(BROWSER_MINOR)-1` + - **Example**: `base-browser-102.8.0esr-12.0-1` +- [ ] Create new stable `tor-browser` branch from + - Branch name in the form: `tor-browser-$(ESR_VERSION)esr-$(BROWSER_MAJOR).$(BROWSER_MINOR)-1` + - **Example**: `tor-browser-102.8.0esr-12.0-1` +- [ ] Push new `base-browser` branch to `upstream` +- [ ] Push new `tor-browser` branch to `upstream` +- [ ] Push new `$(ESR_TAG)` to `upstream` + +### **Rebase tor-browser** + +- [ ] Checkout a new local branch for the `tor-browser` rebase + - **Example**: `git branch tor-browser-rebase FIREFOX_102_8_0esr_BUILD1` +- [ ] **(Optional)** `base-browser` rebase + - **NOTE** This step may be skipped if the `HEAD` of the previous `base-browser` branch is a `-buildN` tag + - [ ] Cherry-pick the previous `base-browser` commits up to `base-browser`'s `buildN` tag onto new `base-browser` rebase branch + - **Example**: `git cherry-pick FIREFOX_102_7_0esr_BUILD1..base-browser-102.7.0esr-12.0-1-build1` + - [ ] Rebase and autosquash these cherry-picked commits + - **Example**: `git rebase --autosquash --interactive FIREFOX_102_8_0esr_BUILD1 HEAD` + - [ ] Cherry-pick remainder of patches after the `buildN` tag + - **Example**: `git cherry-pick base-browser-102.7.0esr-12.0-1-build1..upstream/base-browser-102.7.0esr-12.0-1` +- [ ] `tor-browser` rebase + - [ ] Note the current git hash of `HEAD` for `tor-browser` rebase+autosquash step: `git rev-parse HEAD` + - [ ] Cherry-pick the appropriate previous `tor-browser` branch's commit range up to the last `tor-browser` `buildN` tag + - **Example**: `git cherry-pick base-browser-102.7.0esr-12.0-1-build1..tor-browser-102.7.0esr-12.0-1-build1` + - **Example (if separate base-browser rebase was skipped)**: `git cherry-pick FIREFOX_102_7_0esr_BUILD1..tor-browser-102.7.0esr-12.0-1-build1` + - [ ] Rebase and autosquash these newly cherry-picked commits: `git rebase --autosquash --interactive $(PREV_HEAD)` + - **Example**: `git rebase --autosquash --interactive FIREFOX_102_8_0esr_RELEASE` + - [ ] Cherry-pick remainder of patches after the last `tor-browser` `buildN` tag + - **Example**: `git cherry-pick tor-browser-102.7.0esr-12.0-1-build1..upstream/tor-browser-102.7.0esr-12.0-1` + - [ ] Rebase and autosquash again, this time replacing all `fixup` and `squash` commands with `pick`. The goal here is to have all of the `fixup` and `squash` commits beside the commit which they modify, but kept un-squashed for easy debugging/bisecting. + - **Example**: `git rebase --autosquash --interactive FIREFOX_102_8_0esr_RELEASE` +- [ ] Compare patch sets to ensure nothing *weird* happened during conflict resolution: + - [ ] diff of diffs: + - Do the diff between `current_patchset.diff` and `rebased_patchset.diff` with your preferred difftool and look at differences on lines that starts with + or - + - `git diff $(ESR_TAG_PREV)..$(BROWSER_BRANCH_PREV) > current_patchset.diff` + - `git diff $(ESR_TAG)..$(BROWSER_BRANCH) > rebased_patchset.diff` + - diff `current_patchset.diff` and `rebased_patchset.diff` + - If everything went correctly, the only lines which should differ should be the lines starting with `index abc123...def456` (unless the previous `base-browser` branch includes changes not included in the previous `tor-browser` branch) + - [ ] rangediff: `git range-diff $(ESR_TAG_PREV)..$(TOR_BROWSER_BRANCH_PREV) $(ESR_TAG)..HEAD` + - **Example**: `git range-dif FIREFOX_102_7_0esr_BUILD1..upstream/tor-browser-102.7.0esr-12.0-1 FIREFOX_102_8_0esr_BUILD1..HEAD` +- [ ] Open MR for the `tor-browser` rebase +- [ ] Merge +- Update and push `base-browser` branch + - [ ] Reset the new `base-browser` branch to the appropriate commit in this new `tor-browser` branch + - [ ] Push these commits to `upstream` + +### **Sign and Tag** + +- [ ] Sign/Tag `HEAD` of the merged `tor-browser` branch: + - In **tor-browser.git**, checkout the new stable `tor-browser` branch + - In **tor-browser-build.git**, run signing script: + ```bash + ./tools/browser/sign-tag.torbrowser stable build1 + ``` + - [ ] Push tag to `upstream` +- [ ] Sign/Tag HEAD of the merged `base-browser` branch: + - In **tor-browser.git**, checkout the new stable `base-browser` branch + - In **tor-browser-build.git**, run signing script: + ```bash + ./tools/browser/sign-tag.basebrowser stable build1 + ``` + - [ ] Push tag to `upstream` + + + +--- + +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Type::Rebase" +/label ~"Apps::Priority::Blocker" diff --git a/.gitlab/issue_templates/062 Rebase - Legacy.md b/.gitlab/issue_templates/062 Rebase - Legacy.md new file mode 100644 index 0000000000000000000000000000000000000000..4b6ddac948a2371daef99dbdcc90e8f7378ef44b --- /dev/null +++ b/.gitlab/issue_templates/062 Rebase - Legacy.md @@ -0,0 +1,121 @@ +# ⤵️ Rebase Legacy + +**NOTE:** All examples in this template reference the rebase from 115.17.0esr to 115.18.0esr + +
+ Explanation of Variables + +- `$(ESR_VERSION)`: the Mozilla defined ESR version, used in various places for building tor-browser tags, labels, etc + - **Example**: `115.18.0` +- `$(ESR_TAG)`: the Mozilla defined hg (Mercurial) tag associated with `$(ESR_VERSION)` + - **Example**: `FIREFOX_115_18_0esr_BUILD1` +- `$(ESR_TAG_PREV)`: the Mozilla defined hg (Mercurial) tag associated with the previous ESR version when rebasing (ie, the ESR version we are rebasing from) + - **Example**: `FIREFOX_115_17_0esr_BUILD1` +- `$(BASE_BROWSER_BRANCH)`: the full name of the current `base-browser` branch + - **Example**: `base-browser-115.18.0esr-13.5-1` +- `$(BASE_BROWSER_BRANCH_PREV)`: the full name of the previous `base-browser` branch + - **Example**: `base-browser-115.17.0esr-13.5-1` +- `$(TOR_BROWSER_BRANCH)`: the full name of the current `tor-browser` branch + - **Example**: `tor-browser-115.18.0esr-13.5-1` +- `$(TOR_BROWSER_BRANCH_PREV)`: the full name of the previous `tor-browser` branch + - **Example**: `tor-browser-115.17.0esr-13.5-1` +
+ +### **Bookkeeping** + +- [ ] Link this issue to the appropriate [Release Prep](https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/issues/?sort=updated_desc&state=opened&label_name%5B%5D=Apps%3A%3AType%3A%3AReleasePreparation) issue. + +### Update Branch Protection Rules + +- [ ] In [Repository Settings](https://gitlab.torproject.org/tpo/applications/tor-browser/-/settings/repository): + - [ ] Remove previous legacy `base-browser` and `tor-browser` branch protection rules (this will prevent pushing new changes to the branches being rebased) + - [ ] Create new `base-browser` and `tor-browser` branch protection rule: + - **Branch**: `*-$(ESR_VERSION)esr-13.5-1*` + - **Example**: `*-115.18.0esr-13.5-1*` + - **Allowed to merge**: `Maintainers` + - **Allowed to push and merge**: `Maintainers` + - **Allowed to force push**: `false` + +### **Identify the Firefox Tagged Commit and Create New Branches** + +- [ ] Find the Firefox mercurial tag here: https://hg.mozilla.org/releases/mozilla-esr102/tags + - **Example**: `FIREFOX_115_18_0esr_BUILD1` +- [ ] Find the analogous `gecko-dev` commit: https://github.com/mozilla/gecko-dev + - **Tip**: Search for unique string (like the Differential Revision ID) found in the mercurial commit in the `gecko-dev/esr115` branch to find the equivalent commit + - **Example**: `293d490d2e8d9fbb91c76336288f1287cbe285fb` +- [ ] Sign and Tag `gecko-dev` commit + - Sign/Tag `gecko-dev` commit : + - **Tag**: `$(ESR_TAG)` + - **Message**: `Hg tag $(ESR_TAG)` +- [ ] Create new legacy `base-browser` branch from tag + - Branch name in the form: `base-browser-$(ESR_VERSION)esr-13.5-1` + - **Example**: `base-browser-115.18.0esr-13.5-1` +- [ ] Create new legacy `tor-browser` branch from + - Branch name in the form: `tor-browser-$(ESR_VERSION)esr-13.5-1` + - **Example**: `tor-browser-115.18.0esr-13.5-1` +- [ ] Push new `base-browser` branch to `upstream` +- [ ] Push new `tor-browser` branch to `upstream` +- [ ] Push new `$(ESR_TAG)` to `upstream` + +### **Rebase tor-browser** + +- [ ] Checkout a new local branch for the `tor-browser` rebase + - **Example**: `git branch tor-browser-rebase FIREFOX_115_18_0esr_BUILD1` +- [ ] **(Optional)** `base-browser` rebase + - **NOTE** This step may be skipped if the `HEAD` of the previous `base-browser` branch is a `-buildN` tag + - [ ] Cherry-pick the previous `base-browser` commits up to `base-browser`'s `buildN` tag onto new `base-browser` rebase branch + - **Example**: `git cherry-pick FIREFOX_115_17_0esr_BUILD1..base-browser-115.17.0esr-13.5-1-build2` + - [ ] Rebase and autosquash these cherry-picked commits + - **Example**: `git rebase --autosquash --interactive FIREFOX_115_18_0esr_BUILD1 HEAD` + - [ ] Cherry-pick remainder of patches after the `buildN` tag + - **Example**: `git cherry-pick base-browser-115.17.0esr-13.5-1-build21..upstream/base-browser-115.17.0esr-13.5-1` +- [ ] `tor-browser` rebase + - [ ] Note the current git hash of `HEAD` for `tor-browser` rebase+autosquash step: `git rev-parse HEAD` + - [ ] Cherry-pick the appropriate previous `tor-browser` branch's commit range up to the last `tor-browser` `buildN` tag + - **Example**: `git cherry-pick base-browser-115.17.0esr-13.5-1-build1..tor-browser-115.17.0esr-13.5-1-build2 + - **Example (if separate base-browser rebase was skipped)**: `git cherry-pick FIREFOX_115_17_0esr_BUILD1..tor-browser-115.17.0esr-13.5-1-build2` + - [ ] Rebase and autosquash these newly cherry-picked commits: `git rebase --autosquash --interactive $(PREV_HEAD)` + - **Example**: `git rebase --autosquash --interactive FIREFOX_115_18_0esr_BUILD1` + - [ ] Cherry-pick remainder of patches after the last `tor-browser` `buildN` tag + - **Example**: `git cherry-pick tor-browser-115.17.0esr-13.5-1-build1..upstream/tor-browser-115.17.0esr-13.5-1` + - [ ] Rebase and autosquash again, this time replacing all `fixup` and `squash` commands with `pick`. The goal here is to have all of the `fixup` and `squash` commits beside the commit which they modify, but kept un-squashed for easy debugging/bisecting. + - **Example**: `git rebase --autosquash --interactive FIREFOX_115_18_0esr_BUILD1` +- [ ] Compare patch sets to ensure nothing *weird* happened during conflict resolution: + - [ ] diff of diffs: + - Do the diff between `current_patchset.diff` and `rebased_patchset.diff` with your preferred difftool and look at differences on lines that starts with + or - + - `git diff $(ESR_TAG_PREV)..$(BROWSER_BRANCH_PREV) > current_patchset.diff` + - `git diff $(ESR_TAG)..$(BROWSER_BRANCH) > rebased_patchset.diff` + - diff `current_patchset.diff` and `rebased_patchset.diff` + - If everything went correctly, the only lines which should differ should be the lines starting with `index abc123...def456` (unless the previous `base-browser` branch includes changes not included in the previous `tor-browser` branch) + - [ ] rangediff: `git range-diff $(ESR_TAG_PREV)..$(TOR_BROWSER_BRANCH_PREV) $(ESR_TAG)..HEAD` + - **Example**: `git range-dif FIREFOX_115_17_0esr_BUILD1..upstream/tor-browser-115.17.0esr-13.5-1 FIREFOX_115_18_0esr_BUILD1..HEAD` +- [ ] Open MR for the `tor-browser` rebase +- [ ] Merge +- Update and push `base-browser` branch + - [ ] Reset the new `base-browser` branch to the appropriate commit in this new `tor-browser` branch + - [ ] Push these commits to `upstream` + +### **Sign and Tag** + +- [ ] Sign/Tag `HEAD` of the merged `tor-browser` branch: + - In **tor-browser.git**, checkout the new legacy `tor-browser` branch + - In **tor-browser-build.git**, run signing script: + ```bash + ./tools/browser/sign-tag.torbrowser legacy build1 + ``` + - [ ] Push tag to `upstream` +- [ ] Sign/Tag HEAD of the merged `base-browser` branch: + - In **tor-browser.git**, checkout the new legacy `base-browser` branch + - In **tor-browser-build.git**, run signing script: + ```bash + ./tools/browser/sign-tag.basebrowser legacy build1 + ``` + - [ ] Push tag to `upstream` + + + +--- + +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Type::Rebase" +/label ~"Apps::Priority::Blocker" diff --git a/.gitlab/issue_templates/063 Rebase - Rapid.md b/.gitlab/issue_templates/063 Rebase - Rapid.md new file mode 100644 index 0000000000000000000000000000000000000000..96a18252486698ffeb9c6bdf56d663cf43b5169f --- /dev/null +++ b/.gitlab/issue_templates/063 Rebase - Rapid.md @@ -0,0 +1,300 @@ +# ⤵️ Rebase Rapid + +- **NOTE**: All examples in this template reference the rebase from Firefox 129.0a1 to 130.0a1 +- **TODO**: + - Documentation step for any difficulties or noteworthy things for each rapid rebase + +
+ Explanation of Channels + + There are unfortunately some collisions between how we and Mozilla name our release channels which can make things confusing: + - **Firefox**: + - **Nightly**: \_START and \_END tags, version in the format `$(MAJOR).$(MINOR)a1` + - **Example**: Firefox Nightly 130 was `130.0a1` + - **Note**: Nightly is 2 major versions ahead of the current Release + - **Beta**: tagged each Monday, Wednesday, and Friday until release, version in the format `$(MAJOR).$(MINOR)b$(PATCH)` + - **Example**: the first Firefox Beta 130 was `130.0b1` + - **Note**: Beta is 1 major version ahead of the current Release, should be irrelevant to us + - **Release**: tagged monthly, version in the format `$(MAJOR).$(MINOR)` or `$(MAJOR).$(MINOR).$(PATCH)` + - **Example** Firefox Release 130 was `130.0` + - **ESR**: tagged monthly, version in the format `$(ESR_MAJOR).$(ESR_MINOR).$(ESR_PATCH)esr` + - **Example**: Firefox ESR 128.1 is `128.1.0esr` + - **Tor+Mullvad Browser**: + - **Rapid**: tagged monthly, based on the latest Firefox Nightly + - **Nightly**: not tagged, built nightly from our current Alpha branch's `HEAD` + - **Alpha**: tagged monthly, based on the latest Firefox ESR + - **Stable**: tagged monthly, based on oldest supported Firefox ESR + +
+ +
+ Branching Overview + + Rebasing Tor Browser Rapid onto the current Firefox Nightly is a bit more confusing/involved than rebasing Tor Browser Alpha or Stable from one minor ESR to the next minor ESR. + + The general process basically involves rebasing the previous Firefox Nightly-based Tor Browser Rapid onto the latest Firefox Nightly, and then cherry-picking all of the commits from the previous Firefox ESR-based Tor Browser Alpha after that channel's `build1` tag. This process presumes that the previous Tor Browser Alpha branch is locked and receiving no more changes. + + This diagram provides a high-level view of the overall code-flow for rebasing/cherry-picking commits from Tor Browser Alpha based on Firefox 128.1.0esr and Tor Browser Rapid based on Firefox 129.0a1 onto Firefox 130.0a1: + + ```mermaid +%%{init: { 'themeVariables': {'git0': '#0072b2', 'gitBranchLabel0': '#fff', 'git1': "#e69f00", 'gitBranchLabel1': '#fff', 'git2': '#009e73', 'gitBranchLabel2': '#fff', 'git3': '#cc79a7', 'gitBranchLabel3': '#fff'}, 'gitGraph': {'mainBranchName': 'tor-browser-128.1.0esr-14.5-1'}} }%% +gitGraph: + branch tor-browser-129.0a1-15.0-2 + branch tor-browser-130.0a1-15.0-1 + branch tor-browser-130.0a1-15.0-2 + + checkout tor-browser-128.1.0esr-14.5-1 + commit id: "FIREFOX_128_1_0esr_BUILD1" + commit id: "base-browser-128.1.0esr-14.5-1-build1" + commit id: "tor-browser-128.1.0esr-14.5-1-build1" + commit id: "tor-browser-128.1.0esr-14.5-1-build2" + + checkout tor-browser-129.0a1-15.0-2 + commit id: "FIREFOX_NIGHTLY_129_END" + %% commit id: "tor-browser-129.0a1-15.0-2-build1" + + checkout tor-browser-130.0a1-15.0-1 + commit id: "FIREFOX_NIGHTLY_130_END" + + checkout tor-browser-130.0a1-15.0-2 + commit id: "FIREFOX_NIGHTLY_130_END " + + checkout tor-browser-130.0a1-15.0-1 + merge tor-browser-129.0a1-15.0-2 + + checkout tor-browser-130.0a1-15.0-2 + merge tor-browser-130.0a1-15.0-1 + + + checkout tor-browser-129.0a1-15.0-2 + commit id: "tor-browser-129.0a1-15.0-2-build1" + + checkout tor-browser-130.0a1-15.0-1 + merge tor-browser-129.0a1-15.0-2 id: "tor-browser-130.0a1-15.0-1-build1" + + checkout tor-browser-130.0a1-15.0-2 + merge tor-browser-130.0a1-15.0-1 + + checkout tor-browser-130.0a1-15.0-1 + merge tor-browser-128.1.0esr-14.5-1 + + checkout tor-browser-130.0a1-15.0-2 + merge tor-browser-130.0a1-15.0-1 + + checkout tor-browser-128.1.0esr-14.5-1 + commit id: "tor-browser-128.1.0esr-14.5-1" + + checkout tor-browser-130.0a1-15.0-1 + merge tor-browser-128.1.0esr-14.5-1 id:"tor-browser-130.0a1-15.0-1-build2" + + checkout tor-browser-130.0a1-15.0-2 + + merge tor-browser-130.0a1-15.0-1 + commit id: "tor-browser-130.0a1-15.0-2-build1" + + ``` + + In this concrete example, the rebaser performs the following steps: + - create new `tor-browser-130.0a1-15.0-1`, and `tor-browser-130.0a1-15.0-2` branches from the `FIREFOX_NIGHTLY_130_END` tag. + - these will be the rebase review branches + - onto `tor-browser-130.0a1-15.0-1`, cherry-pick the range `FIREFOX_NIGHTLY_129_END..tor-browser-129.0a1-15.0-2-build1` (i.e. the Firefox Nightly 129-based Tor Browser Rapid commits) + - this updates the previous Tor Browser Rapid onto Firefox Nightly 130 + - cherry-pick the new alpha patches onto `tor-browser-130.0a1-15.0-1` (i.e. cherry-pick `tor-browser-128.1.0esr-14.5-1-build2..origin/tor-browser-128.1.0esr-14.5-1`) + - onto `tor-browser-130.0a1-15.0-2`, rebase and autosquash the `FIREFOX_NIGHTLY_130_END..tor-browser-130.0a1-15.0-2-build1` commit range + - onto `tor-browser-130.0a1-15.0-2`, cherry-pick the remaining commit range `tor-browser-130.0a1-15.0-2-build1..origin/tor-browser-130.0a1-15.0-2` + - re-order any remaining fixup! commits to be adjacent to their parents (i.e. the same rebase command queue as one would get from `git rebase --autosquash`, but with the `fixup!` commands replaced with `pick!` commands). + - this re-organises the branch in a nicely-bisectable way, and will ensure the rebase+autosquash step for the next release *should* succeed without any additional effort + +
+ +
+ Explanation of Variables + +- `$(NIGHTLY_VERSION)`: the Mozilla defined nightly version, used in various places for building tor-browser tags, labels, etc + - **Example**: `130.0a1` +- `$(NIGHTLY_TAG)`: the Mozilla defined hg (Mercurial) tag associated with `$(NIGHTLY_VERSION)` + - **Example**: `FIREFOX_NIGHTLY_130_END` +- `$(NIGHTLY_TAG_PREV)`: the Mozilla defined hg (Mercurial) tag associated with the previous nightly version when rebasing (ie, the nightly version we are rebasing from) + - **Example**: `FIREFOX_NIGHTLY_129_END` +- `$(BROWSER_VERSION)`: the browser version which will first be based on the next major ESR version this *Firefox* Nightly series is leading up to + - **Example**: `15` +- `$(TOR_BROWSER_BRANCH)`: the full name of the current `tor-browser` branch based off of the Firefox Nightly channel + - **Example**: `tor-browser-130.0a1-15.0-1` +- `$(TOR_BROWSER_BRANCH_PREV)`: the full name of the previous `tor-browser` branch based off of the Firefox Nightly channel + - **Example**: `tor-browser-129.0a1-15.0-1` +
+ +### Update Branch Protection Rules + +- [ ] In [Repository Settings](https://gitlab.torproject.org/tpo/applications/tor-browser/-/settings/repository): + - [ ] Remove previous nightly `tor-browser` branch protection rules (this will prevent pushing new changes to the branches being rebased) + - [ ] Create new `tor-browser` branch protection rule: + - **Branch**: `tor-browser-$(NIGHTLY_VERSION)-$(BROWSER_VERSION)-*` + - **Example**: `tor-browser-130.0a1-15.0-*` + - **Allowed to merge**: `Maintainers` + - **Allowed to push and merge**: `Maintainers` + - **Allowed to force push**: `false` + - ⚠️ **IMPORTANT**: If you copied and pasted from old rules, double check you didn't add spaces at the end, as GitLab will not trim them! + +### **Create New Branches** + +- [ ] Find the Firefox mercurial tag `$(NIGHTLY_TAG)` + - Go to https://hg.mozilla.org/mozilla-central/tags + - Find and inspect the commit tagged with `$(NIGHTLY_TAG)` + - Tags are in yellow in the Mercurial web UI + - Find the equivalent commit in https://github.com/mozilla/gecko-dev/commits/master + - **Notice**: GitHub sorts commits by time, you might want to use `git log gecko-dev/master` locally, instead + - Using the differential revision link is useful to quickly find the git commit + - Sign/Tag the `gecko-dev` commit: `git tag -as $(NIGHTLY_TAG) $(GIT_HASH) -m "Hg tag $(NIGHTLY_TAG)"` +- [ ] Create two new rapid `tor-browser` branches from Firefox mercurial tag + - Branch name in the form: `tor-browser-$(NIGHTLY_VERSION)-$(BROWSER_VERSION)-${BRANCH_NUM}` + - **Example**: `tor-browser-130.0a1-15.0-1` and `tor-browser-130.0a1-15.0-2` +- [ ] Push new `tor-browser` branches and the `firefox` tag to `upstream` + +### **Rebase previous `-2` rapid branch's HEAD onto current `-1` rapid branch** + +- **Desired outcome**: + - An easy to review branch with the previous rapid branch rebased onto the latest Firefox Nighty tag + - It must be possible to run `git range-diff` between the previous `-2` and the new branch + - We want to see only the effects of the rebase + - No autosquash should happen at this point + - **Expected difficulties**: + - Conflicts with upstream developments + - Sometimes it will be hard to keep a feature working. It's fine to drop it, and create an issue to restore it after a deeper investigation. +- [ ] Checkout a new local branch for the first part of the `-1` rebase + - **Example**: `git checkout -b rapid-rebase-part1 origin/tor-browser-130.0a1-15.0-1` +- [ ] Firefox Nightly-based `tor-browser` rebase: + - [ ] cherry-pick previous Tor Browser Rapid `-2` branch to new `-1` rebase branch + - **Example**: `git cherry-pick FIREFOX_NIGHTLY_129_END..origin/tor-browser-129.0a1-15.0-2` +- [ ] Rebase Verification: + - [ ] Clean range-diff between the previous rapid branch and current rebase branch + - **Example**: + ```bash + git range-diff FIREFOX_NIGHTLY_129_END..origin/tor-browser-129.0a1-15.0-2 FIREFOX_NIGHTLY_130_END..rapid-rebase-part1 + ``` + - [ ] Optional: clean diff of diffs between previous rapid branch and current rebase branch + - **Example**: + ```bash + git diff FIREFOX_NIGHTLY_129_END origin/tor-browser-129.0a1-15.0-2 > 129.diff + git diff FIREFOX_NIGHTLY_130_END HEAD > 130.diff + # A two-column diff tool is suggested rather than plain-diff, e.g., meld on Linux. + meld 129.diff 130.diff + ``` + - **Note**: Only differences should be due to resolving merge conflicts with upstream changes from Firefox Nightly +- [ ] Open MR +- [ ] Merge +- [ ] Sign/Tag `HEAD` of the merged `tor-browser` branch: + - In **tor-browser.git**, checkout the `-1` rapid `tor-browser` branch + - In **tor-browser-build.git**, run signing script: + ```bash + ./tools/browser/sign-tag.torbrowser rapid build1 + ``` + - [ ] Push tag to `upstream` + +### **Port new alpha patches to `-1`** + +- **Desired outcome**: + - The previous release-cycle's new alpha patches cherry-picked to the end of the current nightly + - It must be possible to run `git range-diff ESR-build1..ESR NIGHTLY-build1..` + - **Expected difficulties**: + - Conflicts with upstream developments (similar to the previous part) + - The range might contain cherry-picked upstream commits, which will result in empty commits: it's fine to skip them + - **Note**: The Tor Browser Alpha branch should be closed at this point and not receiving any more MRs +- [ ] Checkout a new local branch for the second part of the `-1` rebase + - **Example**: `git checkout -b rapid-rebase-part2 origin/tor-browser-130.0a1-15.0-1` +- [ ] Cherry-pick the new `tor-browser` alpha commits (i.e. the new dangling commits which did not appear in the previous Tor Browser Alpha release): + - **Example** `git cherry-pick tor-browser-128.1.0esr-14.5-1-build1..origin/tor-browser-128.1.0esr-14.5-1` +- [ ] Rebase Verification + - [ ] Clean range-diff between the alpha patch set ranges + - **Example**: + ```bash + git range-diff tor-browser-128.1.0esr-14.5-1-build1..origin/tor-browser-128.1.0esr-14.5-1 origin/tor-browser-130.0a1-15.0-1..HEAD + ``` + - [ ] Clean diff of diffs between the alpha patch set ranges + - **Example**: + ```bash + git diff tor-browser-128.1.0esr-14.5-1-build1 origin/tor-browser-128.1.0esr-14.5-1 > 128.1.0esr.diff + git diff origin/tor-browser-130.0a1-15.0-1 HEAD > 130.diff + # A two-column diff tool is suggested rather than plain-diff, e.g., meld on Linux. + meld 128.1.0esr.diff 130.diff + ``` + - **Note**: Only differences should be due to resolving merge conflicts with upstream changes from Firefox Nightly +- [ ] Open MR +- [ ] Merge +- [ ] Sign/Tag `HEAD` of the merged `tor-browser` branch: + - In **tor-browser.git**, checkout the `-1` rapid `tor-browser` branch + - In **tor-browser-build.git**, run signing script: + ```bash + ./tools/browser/sign-tag.torbrowser rapid build2 + ``` + - [ ] Push tag to `upstream` + +### **Squash and Reorder tor-browser `-1` branch to new `-2` branch** +- **Desired outcome**: + - The rapid branch from the previous step prepared for the next nightly + - **Rationale**: + - We squash a lot of commits. We want to keep them a little bit longer rather than squashing them immediately for troubleshooting and documentation purposes. + - Doing this as a separate pass helps to separate errors due to upstream changes from errors due to processes created by our workflow. + - **Expected difficulties**: + - our patches aren't disjoint, therefore we might have conflicts when shuffling them around. +- [ ] Checkout a new local branch for the `-2` rebase, aligned to -1-build1 + - **Example**: `git checkout -b rapid-rebase-part3 tor-browser-130.0a1-15.0-1-build1` +- [ ] Rebase with autosquash. This step should be trivial and not involve any conflicts. + - **Example**: `git rebase -i --autosquash FIREFOX_NIGHTLY_130_END` +- [ ] Cherry-pick the remaining commits + - **Example**: `git cherry-pick tor-browser-130.0a1-15.0-1-build1..upstream/tor-browser-130.0a1-15.0-1` +- [ ] Create a branch for self-reviewing purposes, or take note of the current commit hash somewhere + - **Example**: `git branch rapid-rebase-part3-review` + - You do not need to publish this, and you can delete it at the end of the process (`git branch -D rapid-rebase-part3-review`) + - When you are a reviewer, it might be useful to repeat these steps locally. They should not involve mental overhead (and PieroV has a script to automate this) +- [ ] Rebase and reorder commits (i.e. replace `fixup `, `fixup -C ` and `squash ` with `pick ` commands) + - Notice the space at the end, to avoid replacing `fixup!` with `pick!` in the commit subject, even though git will probably not care of such changes +- [ ] Rebase Verification + - [ ] Clean range-diff between the temporary review branch and the final branch + - **Example**: + ```bash + git range-diff FIREFOX_NIGHTLY_130_END..rapid-rebase-part3-review FIREFOX_NIGHTLY_130_END..rapid-rebase-part3 + ``` + - If you are the reviewer, it should be trivial to create such a branch on your own, as no shuffling is involved + - [ ] Clean diff of diffs between rapid branches + - **Example**: + ```bash + git diff FIREFOX_NIGHTLY_130_END tor-browser-130.0a1-15.0-1-build2 > 130-1.diff + git diff FIREFOX_NIGHTLY_130_END HEAD > 130-2.diff + ``` + - [ ] Understandable range-diff (i.e. `fixup!` patches are distributed from end of branch next to their parent) + - **Example**: + ```bash + git range-diff FIREFOX_NIGHTLY_130_END..tor-browser-130.0a1-15.0-1-build2 FIREFOX_NIGHTLY_130_END..HEAD + ``` +- [ ] Open MR +- [ ] Merge +- [ ] Sign/Tag `HEAD` of the merged `tor-browser` branch: + - In **tor-browser.git**, checkout the `-2` rapid `tor-browser` branch + - In **tor-browser-build.git**, run signing script: + ```bash + ./tools/browser/sign-tag.torbrowser rapid build1 + ``` + - [ ] Push tag to `upstream` + +### **Create and Tag base-browser `-2` branch** +- [ ] Find the last commit in the merged `-2` `tor-browser` branch with a `BB XXXXX...` subject +- [ ] Create new branch from this commit + - Branch name in the form: `base-browser-$(NIGHTLY_VERSION)-$(BROWSER_VERSION)-2` + - **Example**: `base-browser-130.0a1-15.0-2` +- [ ] Push branch to `upstream` +- [ ] Sign/Tag latest `HEAD` of the merged `base-browser` branch: + - In **tor-browser.git**, checkout the `-2` rapid `tor-browser` branch + - In **tor-browser-build.git**, run signing script: + ```bash + ./tools/browser/sign-tag.basebrowser rapid build1 ${COMMIT} + ``` + - [ ] Push tag to `upstream` + + + +--- + +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Type::Rebase" +/label ~"Apps::Priority::High" diff --git a/.gitlab/issue_templates/070 Uplift.md b/.gitlab/issue_templates/070 Uplift.md new file mode 100644 index 0000000000000000000000000000000000000000..849971a10ad3465344726bde4d55231fe78b1b86 --- /dev/null +++ b/.gitlab/issue_templates/070 Uplift.md @@ -0,0 +1,30 @@ +# ⬆️ **Uplift** + + +## Book-keeping + +### Gitlab Issue(s) +- tor-browser#12345 +- mullvad-browser#123 + +### Merge Request(s) +- tor-browser!123 + +### Upstream Mozilla Issue(s): +- https://bugzilla.mozilla.org/show_bug.cgi?id=12345 + +## Notes + + + + +--- + +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Type::Uplift" diff --git a/.gitlab/issue_templates/080 Security Backports.md b/.gitlab/issue_templates/080 Security Backports.md new file mode 100644 index 0000000000000000000000000000000000000000..46100677545e7146429519de4e93c23863f6b550 --- /dev/null +++ b/.gitlab/issue_templates/080 Security Backports.md @@ -0,0 +1,87 @@ +# 🛡️ **Security Backports** + +
+ Explanation of Variables + +- `$(ESR_VERSION)`: the Mozilla defined ESR version, used in various places for building tor-browser tags, labels, etc + - **Example**: `102.8.0` +- `$(RR_VERSION)`: the Mozilla defined Rapid-Release version; Tor Browser for Android is based off of the `$(ESR_VERSION)`, but Mozilla's Firefox for Android is based off of the `$(RR_VERSION)` so we need to keep track of security vulnerabilities to backport from the monthly Rapid-Release train and our frozen ESR train. + - **Example**: `110` +- `$(PROJECT_NAME)`: the name of the browser project, either `base-browser` or `tor-browser` +- `$(TOR_BROWSER_MAJOR)`: the Tor Browser major version + - **Example**: `12` +- `$(TOR_BROWSER_MINOR)`: the Tor Browser minor version + - **Example**: either `0` or `5`; Alpha's is always `(Stable + 5) % 10` +- `$(BUILD_N)`: a project's build revision within a its branch; many of the Firefox-related projects have a `$(BUILD_N)` suffix and may differ between projects even when they contribute to the same build. + - **Example**: `build1` +
+ +**NOTE:** It is assumed the `tor-browser` rebases (stable and alpha) have already happened and there exists a `build1` build tags for both `base-browser` and `tor-browser` (stable and alpha) + +## **Bookkeeping** + +- [ ] Link this issue to the appropriate [Release Prep](https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/issues/?sort=updated_desc&state=opened&label_name%5B%5D=Apps%3A%3AType%3A%3AReleasePreparation) issues (alpha, stable, and legacy). + +## **Security Vulnerabilities Report**: https://www.mozilla.org/en-US/security/advisories/ + +- Potentially Affected Components: + - `firefox`/`geckoview`: https://github.com/mozilla/gecko-dev + +- [ ] Go through the `Security Vulnerabilities fixed in Firefox $(RR_VERSION)` report and create a candidate list of CVEs which potentially need to be backported in this issue: + - CVEs which are explicitly labeled as 'Android' only + - CVEs which are fixed in Rapid Release but not in ESR + - 'Memory safety bugs' fixed in Rapid Release but not in ESR +- [ ] Foreach issue: + - Create link to the CVE on [mozilla.org](https://www.mozilla.org/en-US/security/advisories/) + - **Example**: https://www.mozilla.org/en-US/security/advisories/mfsa2023-05/#CVE-2023-25740 + - Create link to the associated Bugzilla issues (found in the CVE description) + - Create links to the relevant `gecko-dev`/other commit hashes which need to be backported OR a brief justification for why the fix does not need to be backported + - To find the `gecko-dev` version of a `mozilla-central`, search for a unique string in the relevant `mozilla-central` commit message in the `gecko-dev/release` branch log. + - **NOTE:** This process is unfortunately somewhat poorly defined/ad-hoc given the general variation in how Bugzilla issues are labeled and resolved. In general this is going to involve a bit of hunting to identify needed commits or determining whether or not the fix is relevant. + +## CVEs + + + +## **tor-browser**: https://gitlab.torproject.org/tpo/applications/tor-browser.git +- [ ] Backport any Android-specific security fixes from Firefox rapid-release + - [ ] Backport patches to `tor-browser` stable branch + - [ ] Open MR + - [ ] Merge + - [ ] cherry-pick patches onto: + - [ ] `base-browser` stable + - [ ] `mullvad-browser` stable + - [ ] `tor-browser` alpha + - [ ] `base-browser` alpha + - [ ] `mullvad-browser` alpha + - [ ] Sign/Tag commits: + - In **tor-browser-build.git**, run signing script: + ```bash + ./tools/browser/sign-tag.${PROJECT_NAME} ${CHANNEL} ${BUILD_N} + ``` + - [ ] `base-browser` stable + - [ ] `tor-browser` stable + - [ ] `mullvad-browser` stable + - [ ] `base-browser` alpha + - [ ] `tor-browser` alpha + - [ ] `mullvad-browser` alpha + + - [ ] Push tags to `upstream` +- **OR** +- [ ] No backports + + + +--- + +/confidential +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Product::MullvadBrowser" +/label ~"Apps::Type::Backport" +/label ~"Apps::Priority::Blocker" diff --git a/.gitlab/issue_templates/090 Emergency Security Issue.md b/.gitlab/issue_templates/090 Emergency Security Issue.md new file mode 100644 index 0000000000000000000000000000000000000000..b60fbc5a9af46ace1f336aa03cb416a2a8de77dc --- /dev/null +++ b/.gitlab/issue_templates/090 Emergency Security Issue.md @@ -0,0 +1,102 @@ +# 🚨 Emergency Security Issue + +**NOTE** This is an issue template to standardise our process for responding to and fixing critical security and privacy vulnerabilities, exploits, etc. + +## Information + +### Related Issue +- tor-browser#AAAAA +- mullvad-browser#BBBBB +- tor-browser-build#CCCCC + +#### Affected Platforms + +- [ ] Android +- [ ] Desktop + - [ ] Windows + - [ ] macOS + - [ ] Linux + +### Type of Issue: What are we dealing with? + +- [ ] Security (sandbox escape, remote code execution, etc) +- [ ] Proxy Bypass (traffic contents becoming MITM'able) +- [ ] De-Anonymization (otherwise identifying which website a user is visiting) +- [ ] Cross-Site Linkability (correlating sessions across circuits and websites) +- [ ] Disk Leak (persisting session information to disk) +- [ ] Other (please explain) + +### Involvement: Who needs to be consulted and or involved to fix this? + +- [ ] Applications Developers + - [ ] **boklm** : build, packaging, signing, release + - [ ] **clairehurst** : Android, macOS + - [ ] **dan** : Android, macOS + - [ ] **henry** : accessibility, frontend, localisation + - [ ] **jwilde** : windows, firefox internals + - [ ] **ma1** : firefox internals + - [ ] **pierov** : updater, fonts, localisation, general + - [ ] **morgan** : signing, release + - [ ] **thorin** : fingerprinting +- [ ] Other Engineering Teams + - [ ] Networking (**ahf**, **dgoulet**) + - [ ] Anti-Censorship (**meskio**, **cohosh**) + - [ ] UX (**donuts**) + - [ ] TPA (**anarcat**, **lavamind**) +- [ ] External Tor Partners + - [ ] Mozilla + - [ ] Mullvad + - [ ] Brave + - [ ] Guardian Project (Orbot, Onion Browser) + - [ ] Tails + - [ ] Other (please list) + +### Urgency: When do we need to act? + +- [ ] **ASAP** :rotating_light: Emergency release :rotating_light: +- [ ] Next scheduled stable +- [ ] Next scheduled alpha, then backport to stable +- [ ] Next major release +- [ ] Other (please explain) + +#### Justification + + + +### Side-Effects: Who will be affected by a fix for this? +Sometimes fixes have side-effects: users lose their data, roadmaps need to be adjusted, services have to be upgraded, etc. Please enumerate the known downstream consequences a fix to this issue will likely incur. +- [ ] End-Users (please list) +- [ ] Internal Partners (please list) +- [ ] External Partners (please list) + +## Todo: + +### Communications + +- [ ] Start an initial email thread with the following people: + - [ ] **bella** + - [ ] Relevant Applications Developers + - [ ] **(Optional)** **micah** + - if there are considerations or asks outside the Applications Team + - [ ] **(Optional)** Other Team Leads + - if there are considerations or asks outside the Applications Team + - [ ] **(Optional)** **gazebook** + - if there are consequences to the organisation or partners beyond a browser update, then a communication plan may be needed + +Godspeed! :pray: + + + +--- + +/cc @bella +/cc @ma1 +/cc @micah +/cc @morgan + +/confidential + +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Product::MullvadBrowser" +/label ~"Apps::Type::Bug" +/label ~"Apps::Priority::Blocker" diff --git a/.gitlab/issue_templates/100 Release QA - Desktop.md b/.gitlab/issue_templates/100 Release QA - Desktop.md new file mode 100644 index 0000000000000000000000000000000000000000..3505459f617c324751f20e8070d344888c32eeb8 --- /dev/null +++ b/.gitlab/issue_templates/100 Release QA - Desktop.md @@ -0,0 +1,212 @@ +# ✅ Release QA - Desktop + +Manual QA test check-list for major desktop releases. Please copy/paste form into your own comment, fill out relevant info and run through the checklist! + +
+ Tor Browser Desktop QA Checklist + +``` +# System Information + +- Version: Tor Browser XXX +- OS: Windows|macOS|Linux YYY +- CPU Architecture: +- Profile: New|Old + +# Features + +## Base functionality +- [ ] Tor Browser launches successfully +- [ ] Connects to the Tor network + - [ ] Homepage loads: + - [ ] about:tor + - [ ] about:blank + - [ ] custom +- [ ] Tor Browser loads URLs passed by command-line after bootstrapped +- [ ] Localisation (Browser chrome) + - [ ] Language notification/message bar + - [ ] Spoof English + - [ ] Check especially the recently added strings + - [ ] New Locales + - [ ] Bulgarian, Belarusian, Portuguese (PT) +- [ ] UI Customisations: + - [ ] New Identity + - [ ] Toolbar icon + - [ ] Hamburger menu + - [ ] File menu + - [ ] New circuit for this site + - [ ] Circuit display + - [ ] Hamburger menu + - [ ] File menu + - [ ] No Firefox extras (Sync, Pocket, Report broken site, Tracking protection, etc) + - [ ] No unified extensions button (puzzle piece) + - [ ] NoScript button hidden + - [ ] Context Menu Populated +- [ ] Fingerprinting resistance: https://arkenfox.github.io/TZP/tzp.html +- [ ] Security level (Standard, Safer, Safest) + - Displays in: + - toolbar icon + - toolbar panel + - about:preferences#privacy + - [ ] On switch, each UI element is updated + - [ ] On custom config (toggle `svg.disabled`) + - [ ] each UI element displays warning + - [ ] `Restore defaults` reverts custom prefs + - **TODO**: test pages verifying correct behaviour +- [ ] New identity +- [ ] Betterboxing + - [ ] Reuse last window size + - [ ] Content alignment + - [ ] Window size indicator on window resize + - [ ] No letterboxing: + - [ ] empty tabs or privileged pages (eg: about:blank, about:about) + - [ ] full-screen video + - [ ] pdf viewer + - [ ] reader-mode +- [ ] Downloads Warning + - [ ] Downloads toolbar panel + - [ ] about:downloads + - [ ] Library window (Ctrl+Shift+o) +- [ ] Drag and Drop protections: + - [ ] Dragging a link from a tab to another tab in the same window works + - [ ] Dragging a link from a tab to another tab in a separate window works + - [ ] Dragging a link into the library creates a bookmark + - [ ] Dragging a link from Tor Browser to Firefox doesn't work + - [ ] Dragging a link from Firefox to Tor Browser works + - [ ] Dragging a link from Tor Browser to another app (e.g., text editor) doesn't work + - [ ] Repeat with page favicon + +## Proxy safety +- [ ] Tor exit test: https://check.torproject.org +- [ ] Circuit isolation + - Following websites should all report different IP addresses + - https://ifconfig.io + - https://myip.wtf + - https://wtfismyip.com +- [ ] DNS leaks: https://dnsleaktest.com +- [ ] Circuit Display + - [ ] Website => circuit + - [ ] Remote PDF => circuit + - [ ] Remote image => circuit + - [ ] .onion Website => circuit with onion-service relays + - [ ] .tor.onion Website => circuit with onion-service relays, link to true onion address + - http://ft.securedrop.tor.onion + - [ ] Website in reader mode => circuit (same as w/o reader mode) + - [ ] Local image => no circuit + - [ ] Local SVG with remote content => catch-all circuit, but not shown + - [ ] Local PDF => no circuit + - [ ] Local HTML `file://` with local resources => no circuit + - [ ] Local HTML `file://` with remote resources => catch-all circuit, but not shown + +## Connectivity + Anti-Censorship +- [ ] Tor daemon config by environment variables + - https://gitlab.torproject.org/tpo/applications/team/-/wikis/Environment-variables-and-related-preferences +- [ ] Internet Test ( bootstrap, also visible in about:preferences#connection ) + - [ ] Fails when offline (Goes to offline about:neterror) + - **NOTE**: platform dependent, expected that Linux will just try to bootstrap forever + - [ ] Succeeds when online +- [ ] Bridges: + - Bootstrap + - Browse: https://check.torproject.org + - Bridge node in circuit-display + - Bridge cards + - Disable + - Remove + - [ ] Default bridges: + - [ ] Removable as a group, not editable + - [ ] obfs4 + - [ ] meek + - [ ] snowflake + - [ ] User provided bridges: + - [ ] Removable and editable individually + - [ ] obfs4 from https://bridges.torproject.org + - [ ] webtunnel from https://bridges.torproject.org + - [ ] conjure from [gitlab](https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/conjure/-/blob/main/client/torrc?ref_type=heads#L6) + - [ ] Request bridges... + - [ ] Removable as a group, but not editable + - [ ] Succeeds when bootstrapped + - [ ] Succeeds when not bootstrapped + - **TODO**: Lox +- [ ] Connect Assist + - Useful pref: `torbrowser.debug.censorship_level` (0-5; least to most censored) + - [ ] Connect Automatically checkbox triggers bootstrapping after one successful bootstrap attempt + - [ ] Auto-bootstrap updates Tor connection settings on success + - [ ] Auto-bootstrap restore previous Tor connection settings on failure + +## Web Browsing +- [ ] HTTPS-Only: http://http.badssl.com +- [ ] Crypto-currency warning on http website + - **TODO**: we should provide an example page +- [ ] .onion: + - [ ] torproject.org onion: http://2gzyxa5ihm7nsggfxnu52rck2vv4rvmdlkiu3zzui5du4xyclen53wid.onion/ + - [ ] Onion-Location pill + - [ ] Client authentication + - You can create an ephemeral client-auth onion-service using [onion share](https://onionshare.org) + - [ ] Remember key option saves the key between sessions. + - [ ] Saved keys are viewable in preferences (privacy). + - [ ] Can remove individual keys. + - [ ] Can remove all keys at once. + - [ ] Onion service errors + - [ ] invalid onion: http://invalid.onion + - [ ] onion offline: http://wfdn32ds656ycma5gvrh7duvdvxbg2ygzr3no3ijsya25qm6nnko4iqd.onion/ + - [ ] onion baddssl: https://gitlab.torproject.org/tpo/applications/team/-/wikis/Development-Information/BadSSL-But-Onion + - **TODO** all the identity block states + - **TODO** client auth +- [ ] **TODO**: .securedrop.tor.onion +- [ ] **TODO**: onion-service alt-svc +- [ ] HTML5 Video: https://onion-tests.pierov.org/video.html + - [ ] H264 + - [ ] VP9 + - [ ] VP8 + - [ ] AV1 + - [ ] Theora + - [ ] MPEG4 + mp3: only audio should work + - [ ] HEVC + AAC: should not work +- [ ] WebSocket Test: https://websocketking.com/ + +## External Components +- [ ] NoScript + - [ ] Latest Version: https://addons.mozilla.org/en-US/firefox/addon/noscript/ + - [ ] Not removable from about:addons + - [ ] Tests: https://test-data.tbb.torproject.org/test-data/noscript/ + - **TODO**: fix test pages + +## Tor Settings (about:preferences#connection) +- [ ] Proxy + - [ ] Bad Proxy Address Reports Error; e.g. any bad bad proxy address/port/etc + - [ ] On initial failure gives error modal + - [ ] On browser restart, will also give an error if provided a bad setting + - [ ] Good Proxy Works + - [ ] SOCKS5 +- [ ] Bridge + - [ ] Bad Bridge Fails with error modal; eg: `0:0` + - [ ] Modifying Bridges *during* bootstrap should cancel bootstrap +- [ ] Firewall + - [ ] UI shouldn't accept bad ports (e.g. invalid port numbers, non-numbers, etc) +- [ ] Each individual setting type has it's own validation (i.e. not all or nothing anymore) + +``` + +
+ +Please lay claim to a platform in the comments: + +- Windows + - Windows 10, Windows 11 + - x86 + - x86_64 +- macOS + - 10.15, 15.x + - x86_64 + - aarch64 +- Linux + - x86 + - x86_64 + + + +--- + +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Type::Test" +/label ~"Apps::Priority::Blocker" diff --git a/.gitlab/issue_templates/101 Release QA - Android.md b/.gitlab/issue_templates/101 Release QA - Android.md new file mode 100644 index 0000000000000000000000000000000000000000..4cdbc40cece957413211cbe183cec5a8fca06007 --- /dev/null +++ b/.gitlab/issue_templates/101 Release QA - Android.md @@ -0,0 +1,107 @@ +# ✅ Release QA - Android + +Manual QA test check-list for major android releases. Please copy/paste form into your own comment, fill out relevant info and run through the checklist! + +
+ Tor Browser Android QA Checklist + +``` +# System Information + +- Version: Tor Browser XXX +- OS: Android YYY +- Device + CPU Architecture: ZZZ + +# Features + +## Base functionality +- [ ] Tor Browser launches successfully +- [ ] Connects to the Tor network +- [ ] Localisation (Browser chrome) + - [ ] Check especially the recently added strings +- [ ] Toolbars and menus work +- [ ] Fingerprinting resistance: https://arkenfox.github.io/TZP/tzp.html +- [ ] Security level (Standard, Safer, Safest) + - **TODO**: test pages verifying correct behaviour +- [ ] Bookmarks: for now ensure adding/removing/etc work as expected and doesn't busy-spin + +### Localisation +- [ ] New Locales + - [ ] Bulgarian, Belarusian, Portuguese (PT) + +## Proxy safety +- [ ] Tor exit test: https://check.torproject.org +- [ ] Circuit isolation + - Following websites should all report different IP addresses + - https://ifconfig.io + - https://myip.wtf + - https://wtfismyip.com +- [ ] DNS leaks: https://dnsleaktest.com + +## Connectivity + Anti-Censorship +- [ ] Internet Test (try connect assist while actually offline) + - [ ] We expect this to fail but we should see what it actually does +- [ ] Bridges: + - Bootstrap + - Browse: https://check.torproject.org + - [ ] Default bridges: + - [ ] obfs4 + - [ ] meek + - [ ] snowflake + - [ ] User provided bridges: + - [ ] obfs4 from https://bridges.torproject.org + - [ ] webtunnel from https://bridges.torproject.org + - [ ] conjure from [gitlab](https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/conjure/-/blob/main/client/torrc?ref_type=heads#L6) +- [ ] Connect Assist + - Useful pref: `torbrowser.debug.censorship_level` (0-5; least to most censored) + - [ ] Connect Automatically checkbox triggers bootstrapping after one successful bootstrap attempt + - [ ] Auto-bootstrap updates Tor connection settings on success + - [ ] Auto-bootstrap restore previous Tor connection settings on failure + +## Web Browsing +- [ ] HTTPS-Only: http://http.badssl.com +- [ ] .onion: + - [ ] torproject.org onion: http://2gzyxa5ihm7nsggfxnu52rck2vv4rvmdlkiu3zzui5du4xyclen53wid.onion/ + - [ ] Onion service errors + - [ ] invalid onion: http://invalid.onion + - [ ] onion offline: http://wfdn32ds656ycma5gvrh7duvdvxbg2ygzr3no3ijsya25qm6nnko4iqd.onion/ + - [ ] onion baddssl: https://gitlab.torproject.org/tpo/applications/team/-/wikis/Development-Information/BadSSL-But-Onion + - **TODO** all the identity block states + - **TODO** client auth +- [ ] **TODO**: .securedrop.tor.onion +- [ ] **TODO**: onion-service alt-svc +- [ ] HTML5 Video: https://onion-tests.pierov.org/video.html + - [ ] H264 + - [ ] VP9 + - [ ] VP8 + - [ ] AV1 + - [ ] Theora + - [ ] MPEG4 + mp3: only audio should work + - [ ] HEVC + AAC: should not work +- [ ] WebSocket Test: https://websocketking.com/ + +## External Components +- [ ] NoScript + - [ ] Latest Version: https://addons.mozilla.org/en-US/firefox/addon/noscript/ + - [ ] Not removable from about:addons + - [ ] Tests: https://test-data.tbb.torproject.org/test-data/noscript/ + - **TODO**: fix test pages +``` + +
+ +Please lay claim to an architecture in the comments: + +Architectures: +- x86 +- x86_64 +- arm32 +- aarch64 + + + +--- + +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Type::Test" +/label ~"Apps::Priority::Blocker" diff --git a/.gitlab/issue_templates/110 Bugzilla Triage.md b/.gitlab/issue_templates/110 Bugzilla Triage.md new file mode 100644 index 0000000000000000000000000000000000000000..38af65ef1a45788b240cd1b9089d06b315bf83fc --- /dev/null +++ b/.gitlab/issue_templates/110 Bugzilla Triage.md @@ -0,0 +1,56 @@ +# 📋 Bugzilla Triage + +**NOTE** This issue presumes the branches and tags for the next Firefox release have already been created in tor-browser.git + +- [ ] Generate Bugzilla triage CSV + - Run (from `tor-browser-build` root): + ```bash + ./tools/browser/generate-bugzilla-triage-csv ${FIREFOX_VERSION} ${PREVIOUS_NIGHTLY_TAG} ${NEXT_NIGHLTY_TAG} ${TRIAGE_ISSUE_NUMBER} ${REVIEWERS} > out.csv + ``` + - `${FIREFOX_VERSION}`: the major Firefox version of the nightly to review + - **Example**: 129 + - `${PREVIOUS_NIGHTLY_TAG}`: the nightly 'end' tag of the previous major Firefox version + - **Example**: `FIREFOX_NIGHTLY_128_END` + - `${NEXT_NIGHLTY_TAG}`: the nightly 'end' tag of the next major Firefox version we are reviewing + - **Example**: `FIREFOX_NIGHTLY_129_END` + - `${TRIAGE_ISSUE_NUMBER}`: this `tor-browser` issue + - **Example**: `43303` + - `${REVIEWERS}`: `morgan` and two additional devs to triage this Firefox version + - `boklm` + - `brizental` + - `clairehurst` + - `dan` + - `henry` + - `jwilde` + - `ma1` + - `pierov` + - **Example**: + ```bash + ./tools/browser/generate-bugzilla-triage-csv 129 FIREFOX_NIGHTLY_128_END FIREFOX_NIGHTLY_129_END 43303 morgan pierov henry > 129.csv + ``` +- [ ] Attach the generated CSV file to the triage isssue +- [ ] Import to Google Sheets ( https://sheets.google.com ) + - [ ] Create blank spreadsheet + - [ ] **Title**: `Bugzilla Triage ${VERSION}` + - [ ] Import CSV: File > Import > Upload + - **Import location**: "Replace spreadsheet" + - **Separator type**: "Comma" + - **Convert text to numbers, dates, and fomulas**: "✅" + - [ ] Convert 'Review' column's issue cells to check-boxes: + - Select relevant cells (i.e.: `A2:A1554` for in the 129 triage) + - Insert > Checkbox + - [ ] Convert 'Triaged by' cells to check-boxes + - [ ] Share Spreadsheet + - 🔒 Share > General access + - Change `Restricted` to `Anyone with the link` + - Post link in an internal note on this issue +- [ ] Page requested reviewers to this issue +- [ ] Triage Completed by: + - [ ] morgan + - [ ] reviewer 1 + - [ ] reviewer 2 + +/label ~"esr-140" +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Type::Audit" +/label ~"Apps::Priority::Blocker" diff --git a/.gitlab/issue_templates/120 Bugzilla Audit.md b/.gitlab/issue_templates/120 Bugzilla Audit.md new file mode 100644 index 0000000000000000000000000000000000000000..e50f42f98ea43c16eb6bd35c52c7b0609ea8ab98 --- /dev/null +++ b/.gitlab/issue_templates/120 Bugzilla Audit.md @@ -0,0 +1,21 @@ +# 🔍 Bugzilla Audit + + +**Bugzilla**: https://bugzilla.mozilla.org/show_bug.cgi?id= + +## Description + + + + + +--- + + +/label ~"esr-140" +/label ~"Apps::Product::TorBrowser" +/label ~"Apps::Type::Audit" +/label ~"Apps::Priority::Blocker" diff --git a/.gitlab/issue_templates/Default.md b/.gitlab/issue_templates/Default.md new file mode 100644 index 0000000000000000000000000000000000000000..e891f9bdb9f1c5bf4dbc18443da4c97443610eea --- /dev/null +++ b/.gitlab/issue_templates/Default.md @@ -0,0 +1,26 @@ +# Open a new Issue + +Please select the appropriate issue template from the **Description** drop-down. + +--- + +- 🐞 **Bug Report** - report a problem with the browser +- 💡 **Proposal** - suggest a new feature +- 🌐 **Web Compatibility** - report a broken website + +*NOTE*: the following issue types are intended for internal use + +- 💣 **Test** - develop a test or update testing infrastructure +- ✨ **Feature** - implement new features +- ⬅️ **Backport** - cherry-pick change to other release channels +- ⤵️ **Rebase - Alpha** - rebase alpha to latest Firefox ESR version +- ⤵️ **Rebase - Stable** - rebase stable to latest Firefox ESR version +- ⤵️ **Rebase - Legacy** - rebase legacy to latest Firefox ESR 115 version +- ⤵️ **Rebase - Rapid** - rebase rapid to latest Firefox Nightly version +- ⬆️ **Uplift** - uplift change to upstream project +- 🛡️ **Security Backports** - cherry-pick security fixes from Firefox +- 🚨 **Emergency Security Issue** - manage fixing and publishing a critical security fix +- ✅ **Release QA - Desktop** - test and verify functionality of our Desktop release +- ✅ **Release QA - Android** - test and verify functionality of our Android release +- 📋 **Bugzilla Triage** - identify upstream Firefox issues which need to be audited +- 🔍 **Bugzilla Audit** - determine if/how an upstream change affects the browser diff --git a/.gitlab/merge_request_templates/Default.md b/.gitlab/merge_request_templates/Default.md new file mode 100644 index 0000000000000000000000000000000000000000..fb083a62c9b5d8aaf2c5fa50ceeaa592dfd3f24e --- /dev/null +++ b/.gitlab/merge_request_templates/Default.md @@ -0,0 +1,92 @@ +## Merge Info + + + +### Issues + +#### Resolves +- tor-browser#xxxxx +- mullvad-browser#xxxxx +- tor-browser-build#xxxxx + +#### Related + +- tor-browser#xxxxx +- mullvad-browser#xxxxx +- tor-browser-build#xxxxx + +### Merging + + + +#### Target Branches + +- [ ] **`tor-browser`** - `!fixups` to `tor-browser`-specific commits, new features, security backports +- [ ] **`base-browser`** *and* **`mullvad-browser`** - `!fixups` to `base-browser`-specific commits, new features to be shared with `mullvad-browser`, and security backports + - ⚠️ **IMPORTANT**: Please list the `base-browser`-specific commits which need to be cherry-picked to the `base-browser` and `mullvad-browser` branches here + +#### Target Channels + +- [ ] **Alpha**: esr128-14.5 +- [ ] **Stable**: esr128-14.0 +- [ ] **Legacy**: esr115-13.5 + +### Backporting + +#### Timeline +- [ ] **No Backport (preferred)**: patchset for the next major stable +- [ ] **Immediate**: patchset needed as soon as possible (fixes CVEs, 0-days, etc) +- [ ] **Next Minor Stable Release**: patchset that needs to be verified in nightly before backport +- [ ] **Eventually**: patchset that needs to be verified in alpha before backport + +#### (Optional) Justification +- [ ] **Security update**: patchset contains a security fix (be sure to select the correct item in _Timeline_) +- [ ] **Censorship event**: patchset enables censorship circumvention +- [ ] **Critical bug-fix**: patchset fixes a bug in core-functionality +- [ ] **Consistency**: patchset which would make development easier if it were in both the alpha and release branches; developer tools, build system changes, etc +- [ ] **Sponsor required**: patchset required for sponsor +- [ ] **Localization**: typos and other localization changes that should be also in the release branch +- [ ] **Other**: please explain + +### Upstream +- [ ] Patchset is a candidate for uplift to Firefox +- [ ] Patchset is a backport from Firefox + - Bugzilla link: + - Upstream commit: + +### Issue Tracking +- [ ] Link resolved issues with appropriate [Release Prep issue](https://gitlab.torproject.org/groups/tpo/applications/-/issues/?sort=updated_desc&state=opened&label_name%5B%5D=Apps%3A%3AType%3A%3AReleasePreparation&first_page_size=100) for changelog generation + +### Review + +#### Request Reviewer + +- [ ] Request review from an applications developer depending on modified system: + - **NOTE**: if the MR modifies multiple areas, please `/cc` all the relevant reviewers (since Gitlab only allows 1 reviewer) + - **accessibility** : henry + - **android** : clairehurst, dan + - **build system** : boklm + - **ci/cd**: brizental, henry + - **extensions** : ma1 + - **firefox internals (XUL/JS/XPCOM)** : jwilde, ma1 + - **fonts** : pierov + - **frontend (implementation)** : henry + - **frontend (review)** : donuts, morgan + - **localization** : henry, pierov + - **macOS** : clairehurst, dan + - **nightly builds** : boklm + - **rebases/release-prep** : brizental, clairehurst, dan, ma1, pierov, morgan + - **security** : jwilde, ma1 + - **signing** : boklm, morgan + - **updater** : pierov + - **windows** : jwilde, morgan + - **misc/other** : pierov, morgan + +#### Change Description + + + + +#### How Tested + + diff --git a/.prettierignore b/.prettierignore index f97a081d4dc3e61af7f7aef194cbe503cef3f5a7..31aa9cc8d66e9da4ad19e34650b2006976540ce1 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1571,3 +1571,10 @@ tools/browsertime/package-lock.json tools/ts/error_list.json try_task_config.json xpcom/idl-parser/xpidl/fixtures/xpctest.d.json + +browser/app/profile/001-base-profile.js +browser/app/profile/000-tor-browser.js +mobile/android/app/000-tor-browser-android.js +toolkit/content/pt_config.json +toolkit/content/moat_countries_dev_build.json +toolkit/components/lox/lox_wasm.jsm diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..116a82f263482bf7a4d8b72a5198f2b25d2982c9 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +The tor-browser repository is based on Mozilla Firefox. + +See the following wiki links for more information: + ++ [Repository Overview](https://gitlab.torproject.org/tpo/applications/team/-/wikis/Development-Information/Tor-Browser/Tor-Browser-Repository-Overview) ++ [Contributing](https://gitlab.torproject.org/tpo/applications/team/-/wikis/Development-Information/Tor-Browser/Contributing-to-Tor-Browser) diff --git a/README.txt b/README.txt deleted file mode 100644 index fe37f6a66beed913b66df259e9bf51ab804ed7a5..0000000000000000000000000000000000000000 --- a/README.txt +++ /dev/null @@ -1,21 +0,0 @@ -An explanation of the Firefox Source Code Directory Structure and links to -project pages with documentation can be found at: - - https://firefox-source-docs.mozilla.org/contributing/directory_structure.html - -For information on how to build Firefox from the source code and create the patch see: - - https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html - -If you have a question about developing Firefox, and can't find the solution -on https://firefox-source-docs.mozilla.org/, you can try asking your question on Matrix at chat.mozilla.org in `Introduction` (https://chat.mozilla.org/#/room/#introduction:mozilla.org) channel. - - -Nightly development builds can be downloaded from: - - https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/ - - or - - https://www.mozilla.org/firefox/channel/desktop/#nightly - -Keep in mind that nightly builds, which are used by Firefox developers for -testing, may be buggy. diff --git a/browser/actors/CryptoSafetyChild.sys.mjs b/browser/actors/CryptoSafetyChild.sys.mjs new file mode 100644 index 0000000000000000000000000000000000000000..49a0ecc2f60cefea7b9f7e6c4dabd68de5635e7e --- /dev/null +++ b/browser/actors/CryptoSafetyChild.sys.mjs @@ -0,0 +1,49 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* Copyright (c) 2020, The Tor Project, Inc. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; + +const lazy = {}; + +ChromeUtils.defineESModuleGetters(lazy, { + setTimeout: "resource://gre/modules/Timer.sys.mjs", +}); + +XPCOMUtils.defineLazyPreferenceGetter( + lazy, + "isCryptoSafetyEnabled", + "security.cryptoSafety", + true // Defaults to true. +); + +export class CryptoSafetyChild extends JSWindowActorChild { + handleEvent(event) { + if ( + !lazy.isCryptoSafetyEnabled || + // Ignore non-HTTP addresses. + // We do this before reading the host property since this is not available + // for about: pages. + !this.document.documentURIObject.schemeIs("http") || + // Ignore onion addresses. + this.document.documentURIObject.host.endsWith(".onion") || + (event.type !== "copy" && event.type !== "cut") + ) { + return; + } + + // We send a message to the parent to inspect the clipboard content. + // NOTE: We wait until next cycle to allow the event to propagate and fill + // the clipboard before being read. + // NOTE: Using navigator.clipboard.readText fails with Wayland. See + // tor-browser#42702. + lazy.setTimeout(() => { + this.sendAsyncMessage("CryptoSafety:CopiedText", { + host: this.document.documentURIObject.host, + }); + }); + } +} diff --git a/browser/actors/CryptoSafetyParent.sys.mjs b/browser/actors/CryptoSafetyParent.sys.mjs new file mode 100644 index 0000000000000000000000000000000000000000..c266cc8d4ece735af495747498bd305ea99a6b33 --- /dev/null +++ b/browser/actors/CryptoSafetyParent.sys.mjs @@ -0,0 +1,130 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* Copyright (c) 2020, The Tor Project, Inc. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; + +const lazy = {}; + +ChromeUtils.defineESModuleGetters(lazy, { + TorDomainIsolator: "resource://gre/modules/TorDomainIsolator.sys.mjs", + Bech32Decode: "resource://gre/modules/Bech32Decode.sys.mjs", +}); + +ChromeUtils.defineLazyGetter(lazy, "CryptoStrings", function () { + return new Localization(["toolkit/global/tor-browser.ftl"]); +}); + +XPCOMUtils.defineLazyPreferenceGetter( + lazy, + "isCryptoSafetyEnabled", + "security.cryptoSafety", + true // Defaults to true. +); + +function looksLikeCryptoAddress(s) { + // P2PKH and P2SH addresses + // https://stackoverflow.com/a/24205650 + const bitcoinAddr = /^[13][a-km-zA-HJ-NP-Z1-9]{25,39}$/; + if (bitcoinAddr.test(s)) { + return true; + } + + // Bech32 addresses + if (lazy.Bech32Decode(s) !== null) { + return true; + } + + // regular addresses + const etherAddr = /^0x[a-fA-F0-9]{40}$/; + if (etherAddr.test(s)) { + return true; + } + + // t-addresses + // https://www.reddit.com/r/zec/comments/8mxj6x/simple_regex_to_validate_a_zcash_tz_address/dzr62p5/ + const zcashAddr = /^t1[a-zA-Z0-9]{33}$/; + if (zcashAddr.test(s)) { + return true; + } + + // Standard, Integrated, and 256-bit Integrated addresses + // https://monero.stackexchange.com/a/10627 + const moneroAddr = + /^4(?:[0-9AB]|[1-9A-HJ-NP-Za-km-z]{12}(?:[1-9A-HJ-NP-Za-km-z]{30})?)[1-9A-HJ-NP-Za-km-z]{93}$/; + if (moneroAddr.test(s)) { + return true; + } + + return false; +} + +export class CryptoSafetyParent extends JSWindowActorParent { + async receiveMessage(aMessage) { + if ( + !lazy.isCryptoSafetyEnabled || + aMessage.name !== "CryptoSafety:CopiedText" + ) { + return; + } + + // Read the global clipboard. We assume the contents come from the HTTP + // page specified in `aMessage.data.host`. + const trans = Cc["@mozilla.org/widget/transferable;1"].createInstance( + Ci.nsITransferable + ); + trans.init(null); + trans.addDataFlavor("text/plain"); + Services.clipboard.getData(trans, Ci.nsIClipboard.kGlobalClipboard); + let data = {}; + trans.getTransferData("text/plain", data); + data = data?.value.QueryInterface(Ci.nsISupportsString).data; + + let address = data?.replace(/\s+/g, ""); + + if (!address || !looksLikeCryptoAddress(address)) { + return; + } + + if (address.length > 32) { + address = `${address.substring(0, 32)}…`; + } + + const [titleText, bodyText, reloadText, dismissText] = + await lazy.CryptoStrings.formatValues([ + { id: "crypto-safety-prompt-title" }, + { + id: "crypto-safety-prompt-body", + args: { address, host: aMessage.data.host }, + }, + { id: "crypto-safety-prompt-reload-button" }, + { id: "crypto-safety-prompt-dismiss-button" }, + ]); + + const buttonPressed = Services.prompt.confirmEx( + this.browsingContext.topChromeWindow, + titleText, + bodyText, + Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0 + + Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_1, + reloadText, + dismissText, + null, + null, + {} + ); + + if (buttonPressed === 0) { + const { browsingContext } = this.manager; + const browser = browsingContext.embedderElement; + if (browser) { + lazy.TorDomainIsolator.newCircuitForBrowser( + browser.ownerGlobal.gBrowser.selectedBrowser + ); + } + } + } +} diff --git a/browser/actors/RFPHelperParent.sys.mjs b/browser/actors/RFPHelperParent.sys.mjs deleted file mode 100644 index 0e4e3e8be642117c60e9855e696f607d902a64c9..0000000000000000000000000000000000000000 --- a/browser/actors/RFPHelperParent.sys.mjs +++ /dev/null @@ -1,33 +0,0 @@ -1; /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; - -const lazy = {}; -ChromeUtils.defineESModuleGetters(lazy, { - RFPHelper: "resource://gre/modules/RFPHelper.sys.mjs", -}); - -const kPrefLetterboxing = "privacy.resistFingerprinting.letterboxing"; - -XPCOMUtils.defineLazyPreferenceGetter( - lazy, - "isLetterboxingEnabled", - kPrefLetterboxing, - false -); - -export class RFPHelperParent extends JSWindowActorParent { - receiveMessage(aMessage) { - if ( - lazy.isLetterboxingEnabled && - aMessage.name == "Letterboxing:ContentSizeUpdated" - ) { - let browser = this.browsingContext.top.embedderElement; - let window = browser.ownerGlobal; - lazy.RFPHelper.contentSizeUpdated(window); - } - } -} diff --git a/browser/actors/moz.build b/browser/actors/moz.build index 2eb4d67ed6355471c7797a37bdce88d8914234d8..624c41160e516fa92b676157a19ae69793c4e7c8 100644 --- a/browser/actors/moz.build +++ b/browser/actors/moz.build @@ -54,6 +54,8 @@ FINAL_TARGET_FILES.actors += [ "ContentSearchParent.sys.mjs", "ContextMenuChild.sys.mjs", "ContextMenuParent.sys.mjs", + "CryptoSafetyChild.sys.mjs", + "CryptoSafetyParent.sys.mjs", "DecoderDoctorChild.sys.mjs", "DecoderDoctorParent.sys.mjs", "DOMFullscreenChild.sys.mjs", diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in index 295babcbd30f22acc3b413a78f8f78a3f3cc9c20..c4671e15d2354e8016a77898bddf8818d9c2ab85 100644 --- a/browser/app/Makefile.in +++ b/browser/app/Makefile.in @@ -100,11 +100,13 @@ tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME) $(objdir)/macbuild/Contents/MacOS- rsync -aL $(DIST)/bin/$(MOZ_APP_NAME) '$(dist_dest)/Contents/MacOS' cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/firefox.icns '$(dist_dest)/Contents/Resources/firefox.icns' cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/document.icns '$(dist_dest)/Contents/Resources/document.icns' +ifndef BASE_BROWSER_UPDATE $(MKDIR) -p '$(dist_dest)/Contents/Library/LaunchServices' ifdef MOZ_UPDATER cp -f '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater' '$(dist_dest)/Contents/Library/LaunchServices' +endif endif $(MKDIR) -p '$(dist_dest)/Contents/Frameworks' mv '$(dist_dest)/Contents/Resources/ChannelPrefs.framework' '$(dist_dest)/Contents/Frameworks' - printf APPLMOZB > '$(dist_dest)/Contents/PkgInfo' + printf APPLTORB > '$(dist_dest)/Contents/PkgInfo' endif diff --git a/browser/app/macbuild/Contents/Info.plist.in b/browser/app/macbuild/Contents/Info.plist.in index ea28831b90662b12bdcb137c35b6bb83626c77e7..e50cb99075ed24ff4921d131ebd7047a462c26cf 100644 --- a/browser/app/macbuild/Contents/Info.plist.in +++ b/browser/app/macbuild/Contents/Info.plist.in @@ -201,7 +201,7 @@ CFBundleShortVersionString @APP_VERSION@ CFBundleSignature - MOZB + TORB CFBundleURLTypes diff --git a/browser/app/macbuild/Contents/MacOS-files.in b/browser/app/macbuild/Contents/MacOS-files.in index 7517c5b42ac77e6fe2ca5307a8a337c53a00fd7c..c327bd492d5806d8cba47a3616dd8174117c47b8 100644 --- a/browser/app/macbuild/Contents/MacOS-files.in +++ b/browser/app/macbuild/Contents/MacOS-files.in @@ -14,7 +14,6 @@ /llvm-symbolizer #endif /nmhproxy -/pingsender /pk12util /ssltunnel /xpcshell diff --git a/browser/app/moz.build b/browser/app/moz.build index f41ce92556bb18b01e8a3a27fa06a690bfe98cd8..4f9a417b1d2a01e7a3d7761ad350142ff77ac0a0 100644 --- a/browser/app/moz.build +++ b/browser/app/moz.build @@ -76,7 +76,8 @@ if CONFIG["CC_TYPE"] == "clang-cl": if CONFIG["OS_ARCH"] == "WINNT": RCINCLUDE = "splash.rc" DIRS += [ - "pbproxy", + # tor-browser#41798 don't build private_browsing.exe on Windows + # "pbproxy", "winlauncher", ] USE_LIBS += [ diff --git a/browser/app/permissions b/browser/app/permissions index fe018a08c7718b3a538dae9675cf472d4d775859..4a1813e72e807795d833805403532de59c81899b 100644 --- a/browser/app/permissions +++ b/browser/app/permissions @@ -6,20 +6,3 @@ # * permission is an integer between 1 and 15 # Permissions defined here will also be set for private browsing. # See PermissionManager.cpp for more... - -# UITour -origin uitour 1 https://www.mozilla.org -origin uitour 1 https://support.mozilla.org -origin uitour 1 about:home -origin uitour 1 about:newtab -# Bug 1942328: firefox.com needs the same privileges as mozilla.org -origin uitour 1 https://www.firefox.com - -# XPInstall -origin install 1 https://addons.mozilla.org - -# Remote troubleshooting -origin remote-troubleshooting 1 https://support.mozilla.org - -# autoplay video/audio -origin autoplay-media 1 about:welcome diff --git a/browser/app/profile/000-tor-browser.js b/browser/app/profile/000-tor-browser.js new file mode 100644 index 0000000000000000000000000000000000000000..7cf59f305e28c45fbc4eca735d385035ff2865c5 --- /dev/null +++ b/browser/app/profile/000-tor-browser.js @@ -0,0 +1,143 @@ +#include 001-base-profile.js + +pref("app.update.notifyDuringDownload", true); +pref("app.update.badgeWaitTime", 0); +// point to our feedback url rather than Mozilla's +pref("app.feedback.baseURL", "https://support.torproject.org/%LOCALE%/misc/bug-or-feedback/"); + +pref("browser.shell.checkDefaultBrowser", false); + +// Proxy and proxy security +pref("network.proxy.socks", "127.0.0.1"); +pref("network.proxy.socks_port", 9150); +pref("network.proxy.socks_remote_dns", true); +pref("network.proxy.no_proxies_on", ""); // For fingerprinting and local service vulns (#10419) +pref("network.proxy.allow_hijacking_localhost", true); // Allow proxies for localhost (#31065) +pref("network.proxy.type", 1); +// localhost is already blocked by setting `network.proxy.allow_hijacking_localhost` to +// true, allowing users to explicitly block ports makes them fingerprintable; for details, see +// Bug 41317: Tor Browser leaks banned ports in network.security.ports.banned +pref("network.security.ports.banned", "", locked); +pref("network.dns.disabled", true); // This should cover the #5741 patch for DNS leaks +pref("network.http.max-persistent-connections-per-proxy", 256); +// Disable DNS over HTTPS. Set to explicitly off MODE_TRROFF = 5. +// See tor-browser#41906. +pref("network.trr.mode", 5, locked); + +// Treat .onions as secure +pref("dom.securecontext.allowlist_onions", true); + +// Disable HTTPS-Only mode for .onion domains (tor-browser#19850) +pref("dom.security.https_only_mode.upgrade_onion", false); + +// Bug 40423/41137: Disable http/3 +// We should re-enable it as soon as Tor gets UDP support +pref("network.http.http3.enable", false); + +// 0 = do not use a second connection, see all.js and #7656 +pref("network.http.connection-retry-timeout", 0); + +// Tor Browser used to be compatible with non-Tor proxies. This feature is not +// available anymore, but this legacy preference can be still used to disable +// first-party domain circuit isolation. +// In general, it should not be used. This use-case is still supported only for +// sites that break with this isolation (and even in that case, its use should +// be reduced to the strictly required time). +pref("extensions.torbutton.use_nontor_proxy", false); + +// Browser home page: +pref("browser.startup.homepage", "about:tor"); + +// tor-browser#40701: Add new download warning +pref("browser.download.showTorWarning", true); + + +// Tor connection setting preferences. + +pref("torbrowser.settings.quickstart.enabled", false); +pref("torbrowser.settings.bridges.enabled", false); +// TorBridgeSource. Initially TorBridgeSource.Invalid = -1. +pref("torbrowser.settings.bridges.source", -1); +pref("torbrowser.settings.bridges.lox_id", ""); +// obfs4|meek-azure|snowflake|etc. +pref("torbrowser.settings.bridges.builtin_type", ""); +// torbrowser.settings.bridges.bridge_strings.0 +// torbrowser.settings.bridges.bridge_strings.1 +// etc hold the bridge lines. +pref("torbrowser.settings.proxy.enabled", false); +// TorProxyType. Initially TorProxyType.Invalid = -1. +pref("torbrowser.settings.proxy.type", -1); +pref("torbrowser.settings.proxy.address", ""); +pref("torbrowser.settings.proxy.port", 0); +pref("torbrowser.settings.proxy.username", ""); +pref("torbrowser.settings.proxy.password", ""); +pref("torbrowser.settings.firewall.enabled", false); +// comma-delimited list of port numbers. +pref("torbrowser.settings.firewall.allowed_ports", ""); + + +// This pref specifies an ad-hoc "version" for various pref update hacks we need to do +pref("extensions.torbutton.pref_fixup_version", 0); + +// Formerly tor-launcher defaults + +pref("extensions.torlauncher.start_tor", true); +pref("extensions.torlauncher.prompt_at_startup", true); + +pref("extensions.torlauncher.max_tor_log_entries", 1000); + +// By default, Tor Launcher configures a TCP listener for the Tor +// control port, as defined by control_host and control_port. +// Set control_port_use_ipc to true to use an IPC object (e.g., a Unix +// domain socket) instead. You may also modify control_ipc_path to +// override the default IPC object location. If a relative path is used, +// it is handled like torrc_path (see below). +pref("extensions.torlauncher.control_host", "127.0.0.1"); +pref("extensions.torlauncher.control_port", 9151); +pref("extensions.torlauncher.control_port_use_ipc", false); +pref("extensions.torlauncher.control_ipc_path", ""); + +// By default, Tor Launcher configures a TCP listener for the Tor +// SOCKS port. The host is taken from the network.proxy.socks pref and +// the port is taken from the network.proxy.socks_port pref. +// Set socks_port_use_ipc to true to use an IPC object (e.g., a Unix +// domain socket) instead. You may also modify socks_ipc_path to +// override the default IPC object location. If a relative path is used, +// it is handled like torrc_path (see below). +// Modify socks_port_flags to use a different set of SocksPort flags (but be +// careful). +pref("extensions.torlauncher.socks_port_use_ipc", false); +pref("extensions.torlauncher.socks_ipc_path", ""); +pref("extensions.torlauncher.socks_port_flags", "ExtendedErrors IPv6Traffic PreferIPv6 KeepAliveIsolateSOCKSAuth"); + +// The tor_path is relative to the application directory. On Linux and +// Windows this is the Browser/ directory that contains the firefox +// executables, and on Mac OS it is the TorBrowser.app directory. +pref("extensions.torlauncher.tor_path", ""); + +// The torrc_path and tordatadir_path are relative to the data directory, +// which is TorBrowser-Data/ if it exists as a sibling of the application +// directory. If TorBrowser-Data/ does not exist, these paths are relative +// to the TorBrowser/ directory within the application directory. +pref("extensions.torlauncher.torrc_path", ""); +pref("extensions.torlauncher.tordatadir_path", ""); + +// BridgeDB-related preferences (used for Moat). +pref("extensions.torlauncher.bridgedb_front", "www.phpmyadmin.net"); +pref("extensions.torlauncher.bridgedb_reflector", "https://1723079976.rsc.cdn77.org"); +pref("extensions.torlauncher.moat_service", "https://bridges.torproject.org/moat"); + +// Log levels +pref("browser.tor_provider.log_level", "Warn"); +pref("browser.tor_provider.cp_log_level", "Warn"); +pref("lox.log_level", "Warn"); +pref("torbrowser.bootstrap.log_level", "Info"); +pref("browser.torsettings.log_level", "Warn"); +pref("browser.torMoat.loglevel", "Warn"); +pref("browser.tordomainisolator.loglevel", "Warn"); +pref("browser.torcircuitpanel.loglevel", "Log"); +pref("browser.tor_android.log_level", "Info"); +pref("browser.dragdropfilter.log_level", "Warn"); +pref("browser.onionAuthPrompt.loglevel", "Warn"); +pref("browser.onionalias.log_level", "Warn"); +pref("browser.torRequestWatch.log_level", "Warn"); diff --git a/browser/app/profile/001-base-profile.js b/browser/app/profile/001-base-profile.js new file mode 100644 index 0000000000000000000000000000000000000000..738a0c48e56cc033c50540a41968f395a3690d86 --- /dev/null +++ b/browser/app/profile/001-base-profile.js @@ -0,0 +1,1015 @@ +// Preferences to harden Firefox's security and privacy +// Do not edit this file. + +// Use the OS locale by default (tor-browser#17400) +pref("intl.locale.requested", ""); + +// Home page and new tab is blank rather than Firefox Home (Activity Stream). +// tor-browser#31575 and tor-browser#30662 +pref("browser.startup.homepage", "about:blank"); +pref("browser.newtabpage.enabled", false); + +// tor-browser#43164: Prevent search-bar from being auto-hidden when not used for awhile +// This preference is locked so that the browser itself can never set an actual +// value that would trigger the migration. +pref("browser.search.widget.lastUsed", "", locked); + +// Disable initial homepage notifications +pref("browser.search.update", false); +pref("startup.homepage_welcome_url", ""); +pref("startup.homepage_welcome_url.additional", ""); + +// Disable Firefox Welcome Dialog +pref("browser.aboutwelcome.enabled", false); + +#if MOZ_UPDATE_CHANNEL == release +// tor-browser#42640: Disable Firefox Flame button due to unknown interactions with New Identity +pref("browser.privatebrowsing.resetPBM.enabled", false, locked); +#endif + +// Bug 41668: allow users to apply updates. This is set also in firefox.js for +// all platforms, except for Windows. As explained on firefox.js, Firefox uses a +// per-installation preference on Windows. However, we patch this behavior, and +// we set this preference also for Windows. +pref("app.update.auto", true); + +// Try to nag a bit more about updates: Pop up a restart dialog an hour after the initial dialog +pref("app.update.promptWaitTime", 3600); + +#ifndef XP_MACOSX +// Disable staged updates on platforms other than macOS. +// Staged updates do not work on Windows due to #18292. +// Also, on Windows and Linux any changes that are made to the browser profile +// or Tor data after an update is staged will be lost. +pref("app.update.staging.enabled", false); +#endif + +pref("browser.startup.homepage_override.buildID", "20100101"); + +// Disable the "Refresh" prompt that is displayed for stale profiles. +pref("browser.disableResetPrompt", true); + +// Disk activity: Disable Browsing History Storage +pref("browser.privatebrowsing.autostart", true); +pref("browser.cache.disk.enable", false); +pref("permissions.memory_only", true); +pref("security.nocertdb", true); +pref("media.aboutwebrtc.hist.enabled", false); + +// Disk Activity + +// Disable auto-downloading to ~/Downloads and other download tweaks to minimize +// disk leaks (tor-browser#42050). +pref("browser.download.useDownloadDir", false); +pref("browser.download.always_ask_before_handling_new_types", true); +pref("browser.download.manager.addToRecentDocs", false); +pref("browser.download.start_downloads_in_tmp_dir", true); +// tor-browser#42147: Always delete temporary files, also on macOS (this pref is +// already true for other platforms). +// Also, this always happens in PBM. If not in PBM, requires +// browser.download.start_downloads_in_tmp_dir to be true too. +pref("browser.helperApps.deleteTempFileOnExit", true); + +// Prevent download stuffing / DOS (tor-browser#41764) +pref("browser.download.enable_spam_prevention", true); + +// Misc privacy: Disk +pref("signon.rememberSignons", false); +pref("browser.formfill.enable", false); +pref("signon.formlessCapture.enabled", false); // Added with tor-browser#41496 +pref("signon.autofillForms", false); +pref("extensions.formautofill.available", ""); +pref("extensions.formautofill.addresses.enabled", false); +pref("extensions.formautofill.creditCards.enabled", false); +// Do not store extra data (form, scrollbar positions, cookies, POST data) for +// the session restore functionality. +pref("browser.sessionstore.privacy_level", 2); +// Use the in-memory media cache and increase its maximum size (#29120) +pref("browser.privatebrowsing.forceMediaMemoryCache", true); +pref("media.memory_cache_max_size", 65536); +// tor-browser#41065: lie about the available quota. +// This value is in KiB, and will be divided by 5. Currently: 50GiB, to be +// coherent with Firefox's usual value. However, this might be too much for live +// systems. +// This will be the limit also after granting the persistent storage permission, +// but we are not interested in it, since we support only PBM. +// We can come back to it, and hardcode the two spaced differently, if we ever +// think we need it. +pref("dom.quotaManager.temporaryStorage.fixedLimit", 52428800); +// Disable restore in case of crash (tor-browser#41503) +// This should not be needed in PBM, but we added it anyway like other options. +pref("browser.sessionstore.resume_from_crash", false); +// Disable capturing thumbnails (tor-browser#41595) +// Also not needed in PBM at the moment. +pref("browser.pagethumbnails.capturing_disabled", true); +// tor-browser#41988: Remove page titles from window titles to prevent possible +// disk leaks, e.g., in system logs. +// For example, it happened that GNOME shell logged the window name that caused +// JS errors/unexpected conditions for unrelated issues. +// TODO: commented out for now because of UX concerns, to be reconsidered in 14.5 +// pref("privacy.exposeContentTitleInWindow", false); +// pref("privacy.exposeContentTitleInWindow.pbm", false); + +// tor-browser#42054: Opt-out from any built-in backup system, even though +// local, as it might be a violation of our standalone mode. +// Users can still opt-in if they wish. +pref("browser.backup.enabled", false); +pref("browser.backup.scheduled.enabled", false); + +// Empty clipboard content from private windows on exit (tor-browser#42154) +pref("browser.privatebrowsing.preserveClipboard", false); + +// tor-browser#42611: Do not include the URL of the image, when copying it. +// Also, do not save clipboard in history/cloud. +pref("clipboard.imageAsFile.enabled", false); +pref("clipboard.copyPrivateDataToClipboardCloudOrHistory", false); + +// Enable HTTPS-Only mode (tor-browser#19850) +pref("dom.security.https_only_mode", true); +// The previous pref automatically sets this to true (see StaticPrefList.yaml), +// but set it anyway only as a defense-in-depth. +pref("dom.security.https_only_mode_pbm", true); +// tor-browser#43197, defense in depth if ever https-only got disabled +pref("dom.security.https_first_add_exception_on_failiure", false); + +// tor-browser#22320: Hide referer when coming from a .onion address +// We enable this here (rather than in Tor Browser) in case users of other +// base-browser derived browsers configure it to use a system Tor daemon +// to visit onion services. +pref("network.http.referer.hideOnionSource", true); + +// Require Safe Negotiation ( https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/27719 ) +// Blocks connections to servers that don't support RFC 5746 [2] as they're potentially vulnerable to a +// MiTM attack [3]. A server without RFC 5746 can be safe from the attack if it disables renegotiations +// but the problem is that the browser can't know that. Setting this pref to true is the only way for the +// browser to ensure there will be no unsafe renegotiations on the channel between the browser and the server +// [STATS] SSL Labs (July 2021) reports over 99% of top sites have secure renegotiation [4] +// [1] https://wiki.mozilla.org/Security:Renegotiation +// [2] https://datatracker.ietf.org/doc/html/rfc5746 +// [3] https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-3555 +// [4] https://www.ssllabs.com/ssl-pulse/ +pref("security.ssl.require_safe_negotiation", true); + +// mullvad-browser#361: Disable TLS cyphersuites using SHA1 for signing (ECDSA) +// see https://bugzilla.mozilla.org/show_bug.cgi?id=1600437 +pref("security.ssl3.ecdhe_ecdsa_aes_256_sha", false); +pref("security.ssl3.ecdhe_ecdsa_aes_128_sha", false); +// lock those disabled by https://bugzilla.mozilla.org/show_bug.cgi?id=1036765 +pref("security.ssl3.dhe_rsa_aes_128_sha", false, locked); +pref("security.ssl3.dhe_rsa_aes_256_sha", false, locked); + +// Wrapping a static pref to lock it and prevent changing. +// See tor-browser#40565. +pref("security.tls.version.enable-deprecated", false, locked); + +// Misc privacy: Remote +pref("browser.send_pings", false); +// Space separated list of URLs that are allowed to send objects (instead of +// only strings) through webchannels. The default for Firefox is some Mozilla +// domains. +pref("webchannel.allowObject.urlWhitelist", ""); +pref("geo.enabled", false); +pref("geo.provider.network.url", ""); +pref("geo.provider.ms-windows-location", false); +pref("geo.provider.use_corelocation", false); +pref("geo.provider.use_gpsd", false); +pref("geo.provider.use_geoclue", false); +pref("browser.search.suggest.enabled", false); +pref("browser.search.suggest.enabled.private", false); +pref("browser.urlbar.suggest.searches", false); +pref("browser.urlbar.suggest.quicksuggest.nonsponsored", false); +pref("browser.urlbar.suggest.quicksuggest.sponsored", false); +// tor-browser#41576: Do not suggest weather and addons. +pref("browser.urlbar.suggest.addons", false); +pref("browser.urlbar.addons.featureGate", false); +pref("browser.urlbar.suggest.weather", false); +pref("browser.urlbar.weather.featureGate", false); +// tor-browser#42886: Disable trending results. +pref("browser.urlbar.suggest.trending", false); +pref("browser.urlbar.trending.featureGate", false); +// tor-browser#42792: Explicitly turn off Pocket suggestions in the URL bar. +pref("browser.urlbar.pocket.featureGate", false); +// tor-browser#41691: Hide "Firefox Suggest" in the UI +pref("browser.urlbar.groupLabels.enabled", false); +pref("browser.safebrowsing.malware.enabled", false); +pref("browser.safebrowsing.phishing.enabled", false); +pref("browser.safebrowsing.downloads.enabled", false); +pref("browser.safebrowsing.downloads.remote.enabled", false); +pref("browser.safebrowsing.blockedURIs.enabled", false); +pref("browser.safebrowsing.downloads.remote.url", ""); +pref("browser.safebrowsing.provider.google.updateURL", ""); +pref("browser.safebrowsing.provider.google.gethashURL", ""); +pref("browser.safebrowsing.provider.google4.updateURL", ""); +pref("browser.safebrowsing.provider.google4.gethashURL", ""); +pref("browser.safebrowsing.provider.mozilla.updateURL", ""); +pref("browser.safebrowsing.provider.mozilla.gethashURL", ""); +pref("datareporting.healthreport.uploadEnabled", false); +pref("datareporting.policy.dataSubmissionEnabled", false); +// tor-browser#42735: Disable recent search suggestions +pref("browser.urlbar.recentsearches.featureGate", false); +pref("browser.urlbar.suggest.recentsearches", false); + +// Make sure Unified Telemetry is really disabled, see: #18738. +pref("toolkit.telemetry.unified", false); +// This needs to be locked, or nightly builds will automatically lock it to true +pref("toolkit.telemetry.enabled", false, locked); +pref("toolkit.telemetry.server", "data:,"); +pref("toolkit.telemetry.archive.enabled", false); +pref("toolkit.telemetry.newProfilePing.enabled", false); // Added in tor-browser#41496 +pref("toolkit.telemetry.shutdownPingSender.enabled", false); // Added in tor-browser#41496 +pref("toolkit.telemetry.firstShutdownPing.enabled", false); // Added in tor-browser#41496 +pref("toolkit.telemetry.updatePing.enabled", false); // Make sure updater telemetry is disabled; see #25909. +pref("toolkit.telemetry.bhrPing.enabled", false); +pref("toolkit.telemetry.coverage.opt-out", true); +pref("toolkit.coverage.opt-out", true); +pref("toolkit.coverage.endpoint.base", ""); +pref("browser.tabs.crashReporting.sendReport", false); +pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false); +// Added in tor-browser#41496 even though false by default +pref("browser.crashReports.unsubmittedCheck.enabled", false); +// Disable checkbox in about:neterror that controls +// security.xfocsp.errorReporting.automatic. See tor-browser#42653. +pref("security.xfocsp.errorReporting.enabled", false); +// Added in tor-browser#41496 even though it shuld be already always disabled +// since we disable MOZ_CRASHREPORTER. +pref("breakpad.reportURL", "data:"); +#ifdef XP_WIN +// Defense-in-depth: ensure that the Windows default browser agent will +// not ping Mozilla if it is somehow present (we omit it at build time). +pref("default-browser-agent.enabled", false); +#endif +// Disable sync by default +pref("identity.fxaccounts.enabled", false); +// Blank the sync URL as a defense in depth (added with tor-browser#41496) +pref("identity.sync.tokenserver.uri", ""); +// Never sync with other browsers +pref("services.sync.engine.addons", false); +pref("services.sync.engine.addresses", false); +pref("services.sync.engine.bookmarks", false); +pref("services.sync.engine.creditcards", false); +pref("services.sync.engine.history", false); +pref("services.sync.engine.passwords", false); +pref("services.sync.engine.prefs", false); +pref("services.sync.engine.tabs", false); +pref("extensions.getAddons.cache.enabled", false); // https://blog.mozilla.org/addons/how-to-opt-out-of-add-on-metadata-updates/ +pref("privacy.donottrackheader.enabled", false); // (mullvad-browser#17) +// Make sure there is no Tracking Protection active in Tor Browser, see: #17898. +pref("privacy.trackingprotection.enabled", false); +pref("privacy.trackingprotection.pbmode.enabled", false); +pref("privacy.trackingprotection.emailtracking.pbmode.enabled", false); +pref("privacy.trackingprotection.annotate_channels", false); +pref("privacy.trackingprotection.cryptomining.enabled", false); +pref("privacy.trackingprotection.fingerprinting.enabled", false); +pref("privacy.trackingprotection.socialtracking.enabled", false); +pref("privacy.socialtracking.block_cookies.enabled", false); +pref("privacy.annotate_channels.strict_list.enabled", false); +// tor-browser#43178: for defense-in-depth, avoid remote overrides to FPP. +// Notice that it should not apply to RFP anyway... +pref("privacy.fingerprintingProtection.remoteOverrides.enabled", false); + +// Disable the Pocket extension (Bug #18886 and #31602) +pref("extensions.pocket.enabled", false); + +// Disable Privacy-Preserving-Attribution (Bug #42687) +pref("dom.private-attribution.submission.enabled", false); + +// Custom extensions preferences tor-browser#41581 +pref("extensions.hideNoScript", true); +pref("extensions.hideUnifiedWhenEmpty", true); + +// Disable activity stream/"Recommended by Pocket" in about:home (Bug #41029) +pref("browser.newtabpage.activity-stream.discoverystream.enabled", false); +pref("browser.newtabpage.activity-stream.feeds.section.topstories", false); +pref("browser.newtabpage.activity-stream.showSponsored", false); +pref("browser.newtabpage.activity-stream.showSponsoredTopSites", false); +pref("browser.newtabpage.activity-stream.default.sites", ""); +// Activity Stream telemetry +pref("browser.newtabpage.activity-stream.feeds.telemetry", false); +pref("browser.newtabpage.activity-stream.telemetry", false); + +// tor-browser#40788: disable AS's calls to home. +// Notice that null is between quotes because it is a JSON string. +// Keep checked firefox.js to see if new entries are added. +pref("browser.newtabpage.activity-stream.asrouter.providers.cfr", "null"); +pref("browser.newtabpage.activity-stream.asrouter.providers.message-groups", "null"); +pref("browser.newtabpage.activity-stream.asrouter.providers.messaging-experiments", "null"); + +// Disable fetching asrouter.ftl and related console errors (tor-browser#40763). +pref("browser.newtabpage.activity-stream.asrouter.useRemoteL10n", false); + +// tor-browser#42054: make sure search result telemetry is disabled. +pref("browser.search.serpEventTelemetryCategorization.enabled", false); + +// tor-browser#42872, #42555: Disable translations. +// Translation have a bad UX in 128 (and with our config). Maybe we will +// re-enable after auditing and fixing the UX. +pref("browser.translations.enable", false); + +// tor-browser#41945 - disable automatic cookie banners dismissal until +// we're sure it does not causes fingerprinting risks or other issues. +pref("cookiebanners.service.mode", 0); +pref("cookiebanners.service.mode.privateBrowsing", 0); +pref("cookiebanners.ui.desktop.enabled", false); + +// Disable moreFromMozilla pane in the preferences/settings (tor-browser#41292). +pref("browser.preferences.moreFromMozilla", false); + +// Disable webcompat reporter +pref("extensions.webcompat-reporter.enabled", false); + +// Disable Content Analysis SDK (tor-browser#42364) +pref("browser.contentanalysis.enabled", false); +pref("browser.contentanalysis.default_result", 0); + +// Disable contentRelevancy component (which itself is gated on Nimbus) (tor-browser#42867) +pref("toolkit.contentRelevancy.enabled", false); +pref("toolkit.contentRelevancy.ingestEnabled", false); +pref("toolkit.contentRelevancy.log", false); + +pref("browser.search.region", "US"); // Disable GeoIP search lookups (#16254) +// Disable use of WiFi location information +pref("browser.region.network.scan", false); +pref("browser.region.network.url", ""); +pref("browser.region.local-geocoding", false); +// Bug 40083: Make sure Region.sys.mjs fetching is disabled +pref("browser.region.update.enabled", false); + +// Don't load Mozilla domains in a separate privileged tab process +pref("browser.tabs.remote.separatePrivilegedMozillaWebContentProcess", false); +pref("browser.tabs.remote.separatedMozillaDomains", ""); + +// Avoid DNS lookups on search terms +pref("browser.urlbar.dnsResolveSingleWordsAfterSearch", 0); + +// Disable about:newtab and "first run" experiments +pref("messaging-system.rsexperimentloader.enabled", false); +// true means that you are *not* opting out. See its usage in various file. +pref("app.shield.optoutstudies.enabled", false); +// Disable Normandy/Shield +pref("app.normandy.enabled", false); +pref("app.normandy.api_url", ""); + +// [SETTING] General>Browsing>Recommend extensions as you browse (Bug #40700) +pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false); // disable CFR [FF67+] + +// [SETTING] General>Browsing>Recommend features as you browse (Bug #40700) +pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false); // disable CFR [FF67+] + +// Clear the list of trusted recursive resolver services +pref("network.trr.default_provider_uri", ""); + +// Disable the /etc/hosts parser +// If true, entries from /etc/hosts will be excluded **from TRR results**. +// Vice-versa, if it is false, TRR will override any /etc/hosts customization. +pref("network.trr.exclude-etc-hosts", false); + +// Disable crlite +pref("security.remote_settings.crlite_filters.enabled", false); +pref("security.pki.crlite_mode", 0); + +// Disable website password breach alerts +pref("signon.management.page.breach-alerts.enabled", false); +// tor-browser#42814: Opt out from Firefox relay by default. +// Firefox would normally assign disabled when a user has been presented the +// opportunity to use the service and opted out (see firefox.js). +pref("signon.firefoxRelay.feature", "disabled"); + +// Disable remote "password recipes". They are a way to improve the UX of the +// password manager by havinc specific heuristics for some sites. +// It needs remote settings and in general we disable the password manager. +// More information about this feature at +// https://bugzilla.mozilla.org/show_bug.cgi?id=1119454 +pref("signon.recipes.remoteRecipes.enabled", false); + +// Disable ServiceWorkers by default. They do not work in PBM in any case. +// See https://bugzilla.mozilla.org/show_bug.cgi?id=1320796 +pref("dom.serviceWorkers.enabled", false); +// Push notifications use an online Mozilla service and a persistent ID stored +// in dom.push.userAgentID, so disable them by default. +// See also https://support.mozilla.org/kb/push-notifications-firefox +pref("dom.push.enabled", false); +// As a defense in depth measure, also set the push server URL to empty. +// See tor-browser#18801. +pref("dom.push.serverURL", ""); + +// Fingerprinting +// tor-browser#41797: For release builds, lock RFP +// tor-browser#42125: Set (and lock in release) also exempted domains. +#if MOZ_UPDATE_CHANNEL == release +pref("privacy.resistFingerprinting", true, locked); +pref("privacy.resistFingerprinting.exemptedDomains", "", locked); +// tor-browser#42125: Some misleading guides suggest to set this to false, but +// the result would be that the canvas is completely white +// (see StaticPrefList.yaml), so lock it to true. +// Might be removed (MozBug 1670447). +pref("privacy.resistFingerprinting.randomDataOnCanvasExtract", true, locked); +#else +pref("privacy.resistFingerprinting", true); +pref("privacy.resistFingerprinting.exemptedDomains", ""); +#endif +// tor-browser#18603: failIfMajorPerformanceCaveat is an optional attribute that +// can be used when creating a WebGL context if the browser detects that the +// performance would be low. That could be used to fingerpting users with a not +// good graphics card, so disable it (actually, defense in depth, it is already +// disabled by default from Firefox). +pref("webgl.disable-fail-if-major-performance-caveat", true); +// tor-browser#16404: disable until we investigate it further (#22333) +pref("webgl.enable-webgl2", false); +pref("browser.link.open_newwindow.restriction", 0); // Bug 9881: Open popups in new tabs (to avoid fullscreen popups) +// tor-browser#42767: Disable offscreen canvas until verified it is not fingerprintable +pref("gfx.offscreencanvas.enabled", false); +// Prevent scripts from moving and resizing open windows +pref("dom.disable_window_move_resize", true); +// Set video VP9 to 0 for everyone (bug 22548) +pref("media.benchmark.vp9.threshold", 0); +pref("privacy.resistFingerprinting.block_mozAddonManager", true); // Bug 26114 +pref("dom.webmidi.enabled", false); // Bug 41398: Disable Web MIDI API +// tor-browser#42043: Stop reporting device IDs (and spoof their number without +// RFP, RFP already reports 1 audioinput and 1 videoinput, but still has +// randomized IDs when this pref is true). +// Defense-in-depth (already the default value) from Firefox 119 or 120. +pref("media.devices.enumerate.legacy.enabled", false); +// Bug 10286: Always disable Touch API. +// We might need to deepen this topic, see tor-browser#42069. +pref("dom.w3c_touch_events.enabled", 0); +#ifndef ANDROID +// Bug 42138: Disable touch-based overscroll UX +pref("apz.overscroll.enabled", false); +#endif +pref("dom.vr.enabled", false); // Bug 21607: Disable WebVR for now +pref("security.webauth.webauthn", false); // Bug 26614: Disable Web Authentication API for now +// Disable SAB, no matter if the sites are cross-origin isolated. +pref("dom.postMessage.sharedArrayBuffer.withCOOP_COEP", false); +// Disable intermediate preloading (Bug 30682) +pref("security.remote_settings.intermediates.enabled", false); +// Bug 2874: Block Components.interfaces from content +pref("dom.use_components_shim", false); +// Enable letterboxing +pref("privacy.resistFingerprinting.letterboxing", true); +// tor-browser#41917: Center letterboxed area vertically +pref("privacy.resistFingerprinting.letterboxing.vcenter", true); +// tor-browser#41917: Letterboxing gradient background +pref("privacy.resistFingerprinting.letterboxing.gradient", true); +// tor-browser#41918: Should we reuse last window sizes if letterboxing is enabled +pref("privacy.resistFingerprinting.letterboxing.rememberSize", false); +// tor-browser#41695: How many warnings we show if user closes them without restoring the window size +pref("privacy.resistFingerprinting.resizeWarnings", 3); +// tor-browser#43402: Avoid a resize from the skeleton to the newwin size. +// Should be fixed in ESR-140 with Bug 1448423. +pref("browser.startup.blankWindow", false); +// Enforce Network Information API as disabled +pref("dom.netinfo.enabled", false); +pref("network.http.referer.defaultPolicy", 2); // Bug 32948: Make referer behavior consistent regardless of private browing mode status +pref("network.http.referer.defaultPolicy.pbmode", 2); +pref("network.http.referer.XOriginTrimmingPolicy", 2); // Bug 17228: Force trim referer to scheme+host+port in cross-origin requests +// Bug 40463: Disable Windows SSO +pref("network.http.windows-sso.enabled", false, locked); +// Bug 43165: Disable Microsoft SSO on macOS +pref("network.http.microsoft-entra-sso.enabled", false); +pref("network.microsoft-sso-authority-list", ""); +// tor-browser#40424 +pref("pdfjs.enableScripting", false); +#if MOZ_UPDATE_CHANNEL == release +// tor-browser#42255: pdfjs.disabled used to be part of RFP until Bug 1838415; lock pref to false in stable +pref("pdfjs.disabled", false, locked); +#endif +// Bug 40057: Ensure system colors are not used for CSS4 colors +pref("browser.display.use_system_colors", false); +// tor-browser#43366: do not use system accent color in inputs. +// See also https://bugzilla.mozilla.org/show_bug.cgi?id=1861362. +pref("widget.non-native-theme.use-theme-accent", false); +// tor-browser#43236: Disable vsync on Wayland to prevent refresh rate leaks. +pref("widget.wayland.vsync.enabled", false); + +// tor-browser#41943: defense-in-depth, but do not lock anymore (enabled in Firefox 119, http://bugzil.la/1851162) +pref("javascript.options.spectre.disable_for_isolated_content", false); + +// Third party stuff +pref("privacy.firstparty.isolate", true); // Always enforce first party isolation +// tor-browser#40123 and #40308: Disable for now until audit +pref("privacy.partition.network_state", false); +// Only accept cookies from the originating site (block third party cookies) +pref("network.cookie.cookieBehavior", 1); +pref("network.cookie.cookieBehavior.pbmode", 1); +pref("network.predictor.enabled", false); // Temporarily disabled. See https://bugs.torproject.org/16633 +pref("network.predictor.enable-prefetch", false); +pref("network.http.speculative-parallel-limit", 0); +pref("browser.places.speculativeConnect.enabled", false); +pref("network.prefetch-next", false); +pref("browser.urlbar.speculativeConnect.enabled", false); +// Bug 40220: Make sure tracker cookie purging is disabled. +// It depends on Firefox's tracking protection, which we currently do not enable +// See also tor-browser#30939. +pref("privacy.purge_trackers.enabled", false); +// Do not allow cross-origin sub-resources to open HTTP authentication +// credentials dialogs. Hardens against potential credentials phishing. +pref("network.auth.subresource-http-auth-allow", 1); + +// tor-browser#42684: Disable network prefetch +pref("network.dns.disablePrefetch", true); +pref("network.dns.disablePrefetchFromHTTPS", true); +pref("dom.prefetch_dns_for_anchor_http_document", false); +pref("dom.prefetch_dns_for_anchor_https_document", false); + +pref("network.protocol-handler.external-default", false); +pref("network.protocol-handler.external.mailto", false); +pref("network.protocol-handler.external.news", false); +pref("network.protocol-handler.external.nntp", false); +pref("network.protocol-handler.external.snews", false); +pref("network.protocol-handler.warn-external.mailto", true); +pref("network.protocol-handler.warn-external.news", true); +pref("network.protocol-handler.warn-external.nntp", true); +pref("network.protocol-handler.warn-external.snews", true); +#ifdef XP_WIN + pref("network.protocol-handler.external.ms-windows-store", false); + pref("network.protocol-handler.warn-external.ms-windows-store", true); +#endif +pref("network.proxy.allow_bypass", false, locked); // #40682 +// Bug 40548: Disable proxy-bypass +pref("network.proxy.failover_direct", false, locked); +// Lock to 'true', which is already the firefox default, to prevent users +// from making themselves fingerprintable by disabling. This pref +// alters content load order in a page. See tor-browser#24686 +pref("network.http.tailing.enabled", true, locked); + +// tor-browser#23044: Make sure we don't have any GIO supported protocols +// (defense in depth measure). +// As of Firefox 118 (Bug 1843763), upstream does not add any protocol by +// default, but setting it to blank seems a good idea (tor-browser#42054). +pref("network.gio.supported-protocols", ""); +pref("media.peerconnection.enabled", false); // Disable WebRTC interfaces +// Mullvad Browser enables WebRTC by default, meaning that there the following prefs +// are first-line defense, rather than "in depth" (mullvad-browser#40) +// tor-browser#41667 - Defense in depth: use mDNS to avoid local IP leaks on Android too if user enables WebRTC +pref("media.peerconnection.ice.obfuscate_host_addresses", true); +// tor-browser#41671 - Defense in depth: connect using TURN only, to avoid IP leaks if user enables WebRTC +pref("media.peerconnection.ice.relay_only", true); +// tor-browser#42029 - Defense-in-depth: disable non-proxied UDP WebRTC +pref("media.peerconnection.ice.default_address_only", true); +pref("media.peerconnection.ice.no_host", true); +pref("media.peerconnection.ice.proxy_only_if_behind_proxy", true); + +// Disables media devices but only if `media.peerconnection.enabled` is set to +// `false` as well. (see bug 16328 for this defense-in-depth measure) +pref("media.navigator.enabled", false); +// GMPs (Gecko Media Plugins, https://wiki.mozilla.org/GeckoMediaPlugins) +// We make sure they don't show up on the Add-on panel and confuse users. +// And the external update/donwload server must not get pinged. We apply a +// clever solution for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769716. +// See tor-browser#15910. +pref("media.gmp-provider.enabled", false); +pref("media.gmp-manager.url.override", "data:text/plain,"); +// Since ESR52 it is not enough anymore to block pinging the GMP update/download +// server. There is a local fallback that must be blocked now as well. See: +// https://bugzilla.mozilla.org/show_bug.cgi?id=1267495. +pref("media.gmp-manager.updateEnabled", false); +// Mozilla is relying on preferences to make sure no DRM blob is downloaded and +// run. Even though those prefs should be set correctly by specifying +// --disable-eme (which we do), we disable all of them here as well for defense +// in depth (see bug 16285 for more details). +pref("browser.eme.ui.enabled", false); +pref("media.gmp-widevinecdm.visible", false); +pref("media.gmp-widevinecdm.enabled", false); +pref("media.eme.enabled", false); +pref("media.mediadrm-widevinecdm.visible", false); +// The in-browser debugger for debugging chrome code is not coping with our +// restrictive DNS look-up policy. We use "127.0.0.1" instead of "localhost" as +// a workaround. See bug 16523 for more details. +pref("devtools.debugger.chrome-debugging-host", "127.0.0.1"); +// Disable using UNC paths (bug 26424 and Mozilla's bug 1413868) +pref("network.file.disable_unc_paths", true); +// Enhance our treatment of file:// to avoid proxy bypasses (see Mozilla's bug +// 1412081 and CVE-2017-16541) +pref("network.file.path_blacklist", "/net"); + +// Security slider +pref("svg.disabled", false); +pref("mathml.disabled", false); + +// Bug 40408 +pref("svg.context-properties.content.allowed-domains", ""); + +// Network and performance +pref("security.ssl.enable_false_start", true); +// tor-browser#18945 +pref("network.manage-offline-status", false); +// No need to leak things to Mozilla, see bug 21790 and tor-browser#40322 +pref("network.captive-portal-service.enabled", false); +pref("network.connectivity-service.enabled", false); +pref("captivedetect.canonicalURL", ""); + +#ifdef XP_WIN +// tor-browser#41683: Disable the network process on Windows +// Mozilla already disables the network process for HTTP. +// With this preference, we completely disable it, because we found that it +// breaks stuff with mingw. See also tor-browser#41489. +pref("network.process.enabled", false); +#endif + +// Extension support +pref("extensions.autoDisableScopes", 0); +// Only load extensions from the application and user profile. +// Do not load from the user directory (AddonManager.SCOPE_USER=2, which is +// shared between profiles, e.g., %appdata%\Mozilla\Extensions\ on Windows, or +// ~/.mozilla/extensions on Linux for Firefox), and do not load from system +// directories/the Windows registry (AddonManager.SCOPE_SYSTEM=8). +// More information: https://archive.ph/DYjAM +pref("extensions.enabledScopes", 5); // AddonManager.SCOPE_PROFILE=1 | AddonManager.SCOPE_APPLICATION=4 +// 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, 22900 and 31601. +pref("extensions.getAddons.showPane", false); +pref("extensions.htmlaboutaddons.recommendations.enabled", false); +// Disable personalized Extension Recommendations in about:addons and +// addons.mozilla.org +pref("browser.discovery.enabled", false); +// tor-browser#26114: Allow NoScript to work on addons.mozilla.org and other Mozilla sites. +// Revisited and confirmed in tor-browser#41445. +pref("extensions.webextensions.restrictedDomains", ""); +// Don't give Mozilla-recommended third-party extensions special privileges. +pref("extensions.postDownloadThirdPartyPrompt", false); +// tor-browser#41701: Reporting an extension does not work. The request goes to +// Mozilla and is always rejected anyway (HTTP 400). +pref("extensions.abuseReport.enabled", false); +// We are already providing the languages we support in multi-lingual packages. +// Therefore, do not allow download of additional language packs. They are not a +// privacy/security threat, we are disabling them for UX reasons. See bug 41377. +pref("intl.multilingual.downloadEnabled", false); + +// Enforce certificate pinning, see: https://bugs.torproject.org/16206 +pref("security.cert_pinning.enforcement_level", 2); + +// Don't load OS client certs. +pref("security.osclientcerts.autoload", false); + +// Don't allow MitM via enterprise roots, see bug 30681 +pref("security.enterprise_roots.enabled", false); + +// Don't ping Mozilla for MitM detection, see bug 32321 +pref("security.certerrors.mitm.priming.enabled", false); + +// Don't automatically enable enterprise roots, see bug 40166 +pref("security.certerrors.mitm.auto_enable_enterprise_roots", false); + +// Disable share menus on Mac and Windows tor-browser#41117 +pref("browser.menu.share_url.allow", false, locked); + +// Disable special URL bar behaviors +pref("browser.urlbar.suggest.topsites", false); +pref("browser.urlbar.quicksuggest.enabled", false); +pref("browser.urlbar.richSuggestions.featureGate", false); +pref("browser.urlbar.yelp.featureGate", false); +pref("browser.urlbar.mdn.featureGate", false); + +// tor-browser#41884: Do not start a search when clicking on the new tab button +// with the middle mouse button (to prevent searching for anything you might +// have selected or already in your clipboard). +pref("browser.tabs.searchclipboardfor.middleclick", false); + +// tor-browser#41417: do not allow live reload until we switch to Fluent and +// stop using .textContent. +// Even after that, it might be a good idea to keep it off, as it is not handled +// very well, and it might give a window during which websites could fingerprint +// the change (see tor-browser#42349 and tor-browser#42771). +pref("intl.multilingual.liveReload", false); + +// Enable URL query stripping to protect against cross-site tracking (tor-browser#41092) +pref("privacy.query_stripping.enabled", true); +pref("privacy.query_stripping.enabled.pbmode", true); +pref("privacy.query_stripping.strip_on_share.enabled", true); + +// Ensure global privacy control headers are consistent in private browsing and +// non-private browsing (tor-browser#42777). +pref("privacy.globalprivacycontrol.enabled", true); +pref("privacy.globalprivacycontrol.pbmode.enabled", true); + +// Disable platform text recognition functionality (tor-browser#42057) +pref("dom.text-recognition.enabled", false); + +// Log levels +pref("browser.new_identity.log_level", "Info"); + +#ifdef XP_WIN +pref("browser.taskbar.lists.enabled", false); +pref("browser.taskbar.lists.frequent.enabled", false); +pref("browser.taskbar.lists.tasks.enabled", false); +pref("browser.taskbar.lists.recent.enabled", false); + +// tor-browser#41806: Prevent the browser from adding a new Private Browsing +// start menu item automatically +pref("browser.privacySegmentation.createdShortcut", true); + +// Do not re-open the browser automatically after reboots when "Restart apps" is +// enabled (tor-browser#41503) +pref("toolkit.winRegisterApplicationRestart", false); +// tor-browser#43051: Hide the checkbox to open the browser automatically on +// Windows startup. +pref("browser.startup.windowsLaunchOnLogin.enabled", false); +#endif + +#ifdef ANDROID +// tor-browser#43023 Force use of only standard emoji font +// (not actually stopping samsung emoji font detection, but defense in depth and a step towards normalization) +pref("font.name-list.emoji", "Noto Color Emoji"); +#endif + +// If we are bundling fonts, whitelist those bundled fonts, and restrict system fonts to a selection. + +#ifdef MOZ_BUNDLED_FONTS + +// Bug 40342: Always use bundled fonts +pref("gfx.bundled-fonts.activate", 1); + +#ifdef XP_MACOSX +pref("font.system.whitelist", "AppleGothic, Apple Color Emoji, Arial, Arial Black, Arial Narrow, Courier, Courier New, Geneva, Georgia, Heiti TC, Helvetica, Helvetica Neue, Hiragino Kaku Gothic ProN, Kailasa, Lucida Grande, Menlo, Monaco, PingFang HK, PingFang SC, PingFang TC, Songti SC, Songti TC, Tahoma, Thonburi, Times, Times New Roman, Verdana, STIX Two Math, Noto Sans Adlam, Noto Sans Armenian, Noto Sans Balinese, Noto Sans Bamum, Noto Sans Bassa Vah, Noto Sans Batak, Noto Sans Bengali, Noto Sans Buginese, Noto Sans Buhid, Noto Sans Canadian Aboriginal, Noto Sans Chakma, Noto Sans Cham, Noto Sans Cherokee, Noto Sans Coptic, Noto Sans Deseret, Noto Sans Devanagari, Noto Sans Elbasan, Noto Sans Ethiopic, Noto Sans Georgian, Noto Sans Grantha, Noto Sans Gujarati, Noto Sans Gunjala Gondi, Noto Sans Gurmukhi, Noto Sans Hanifi Rohingya, Noto Sans Hanunoo, Noto Sans Hebrew, Noto Sans Kannada, Noto Sans Khmer, Noto Sans Javanese, Noto Sans Kayah Li, Noto Sans Khojki, Noto Sans Khudawadi, Noto Sans Lao, Noto Sans Lepcha, Noto Sans Limbu, Noto Sans Lisu, Noto Sans Mahajani, Noto Sans Malayalam, Noto Sans Mandaic, Noto Sans Masaram Gondi, Noto Sans Medefaidrin, Noto Sans Meetei Mayek, Noto Sans Mende Kikakui, Noto Sans Miao, Noto Sans Modi, Noto Sans Mongolian, Noto Sans Mro, Noto Sans Multani, Noto Sans Newa, Noto Sans New Tai Lue, Noto Sans NKo, Noto Sans Ol Chiki, Noto Sans Oriya, Noto Sans Osage, Noto Sans Osmanya, Noto Sans Pahawh Hmong, Noto Sans Pau Cin Hau, Noto Sans Rejang, Noto Sans Runic, Noto Sans Samaritan, Noto Sans Saurashtra, Noto Sans Sharada, Noto Sans Shavian, Noto Sans Sinhala, Noto Sans Sora Sompeng, Noto Sans Soyombo, Noto Sans Sundanese, Noto Sans Syloti Nagri, Noto Sans Symbols 2, Noto Sans Symbols, Noto Sans Syriac, Noto Sans Tagalog, Noto Sans Tagbanwa, Noto Sans Tai Le, Noto Sans Tai Tham, Noto Sans Tai Viet, Noto Sans Takri, Noto Sans Tamil, Noto Sans Telugu, Noto Sans Thaana, Noto Sans Tifinagh Adrar, Noto Sans Tifinagh Agraw Imazighen, Noto Sans Tifinagh Ahaggar, Noto Sans Tifinagh Air, Noto Sans Tifinagh APT, Noto Sans Tifinagh Azawagh, Noto Sans Tifinagh Ghat, Noto Sans Tifinagh Hawad, Noto Sans Tifinagh, Noto Sans Tifinagh Rhissa Ixa, Noto Sans Tifinagh SIL, Noto Sans Tifinagh Tawellemmet, Noto Sans Tirhuta, Noto Sans Vai, Noto Sans Wancho, Noto Sans Warang Citi, Noto Sans Yi, Noto Sans Zanabazar Square, Noto Serif Armenian, Noto Serif Balinese, Noto Serif Bengali, Noto Serif Devanagari, Noto Serif Dogra, Noto Serif Ethiopic, Noto Serif Georgian, Noto Serif Grantha, Noto Serif Gujarati, Noto Serif Gurmukhi, Noto Serif Hebrew, Noto Serif Kannada, Noto Serif Khmer, Noto Serif Khojki, Noto Serif Lao, Noto Serif Malayalam, Noto Serif Myanmar, Noto Serif NP Hmong, Noto Serif Sinhala, Noto Serif Tamil, Noto Serif Telugu, Noto Serif Tibetan, Noto Serif Yezidi, Pyidaungsu"); + +// Armenian +pref("font.name-list.serif.x-armn", "Noto Serif Armenian, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-armn", "Noto Sans Armenian, Helvetica, Arial"); +pref("font.name-list.monospace.x-armn", "Noto Sans Armenian, Menlo, Courier New"); +// Bengali +pref("font.name-list.serif.x-beng", "Noto Serif Bengali, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-beng", "Noto Sans Bengali, Helvetica, Arial"); +pref("font.name-list.monospace.x-beng", "Noto Sans Bengali, Menlo, Courier New"); +// Canadian Aboriginal +pref("font.name-list.serif.x-cans", "Noto Serif Canadian Aboriginal, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-cans", "Noto Sans Canadian Aboriginal, Helvetica, Arial"); +pref("font.name-list.monospace.x-cans", "Noto Sans Canadian Aboriginal, Menlo, Courier New"); +// ChineseCN +pref("font.name-list.serif.zh-CN", "Songti SC, Times, Times New Roman"); +pref("font.name-list.sans-serif.zh-CN", "PingFang SC, Helvetica, Arial"); +pref("font.name-list.monospace.zh-CN", "PingFang SC, Menlo, Courier New"); +// ChineseHK +pref("font.name-list.serif.zh-HK", "Songti TC, Times, Times New Roman"); +pref("font.name-list.sans-serif.zh-HK", "PingFang HK, Helvetica, Arial"); +pref("font.name-list.monospace.zh-HK", "PingFang HK, Menlo, Courier New"); +// ChineseTW +pref("font.name-list.serif.zh-TW", "Songti TC, Times, Times New Roman"); +pref("font.name-list.sans-serif.zh-TW", "PingFang TC, Helvetica, Arial"); +pref("font.name-list.monospace.zh-TW", "PingFang TC, Menlo, Courier New"); +// Devanagari +pref("font.name-list.serif.x-devanagari", "Noto Serif Devanagari, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-devanagari", "Noto Sans Devanagari, Helvetica, Arial"); +pref("font.name-list.monospace.x-devanagari", "Noto Sans Devanagari, Menlo, Courier New"); +// Ethiopic +pref("font.name-list.serif.x-ethi", "Noto Serif Ethiopic, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-ethi", "Noto Sans Ethiopic, Helvetica, Arial"); +pref("font.name-list.monospace.x-ethi", "Noto Sans Ethiopic, Menlo, Courier New"); +// Georgian +pref("font.name-list.serif.x-geor", "Noto Serif Georgian, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-geor", "Noto Sans Georgian, Helvetica, Arial"); +pref("font.name-list.monospace.x-geor", "Noto Sans Georgian, Menlo, Courier New"); +// Gujarati +pref("font.name-list.serif.x-gujr", "Noto Serif Gujarati, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-gujr", "Noto Sans Gujarati, Helvetica, Arial"); +pref("font.name-list.monospace.x-gujr", "Noto Sans Gujarati, Menlo, Courier New"); +// Gurmukhi +pref("font.name-list.serif.x-guru", "Noto Serif Gurmukhi, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-guru", "Noto Sans Gurmukhi, Helvetica, Arial"); +pref("font.name-list.monospace.x-guru", "Noto Sans Gurmukhi, Menlo, Courier New"); +// Hebrew +pref("font.name-list.serif.he", "Noto Serif Hebrew, Times, Times New Roman"); +pref("font.name-list.sans-serif.he", "Noto Sans Hebrew, Helvetica, Arial"); +pref("font.name-list.monospace.he", "Noto Sans Hebrew, Menlo, Courier New"); +// Kannada +pref("font.name-list.serif.x-knda", "Noto Serif Kannada, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-knda", "Noto Sans Kannada, Helvetica, Arial"); +pref("font.name-list.monospace.x-knda", "Noto Sans Kannada, Menlo, Courier New"); +// Khmer +pref("font.name-list.serif.x-khmr", "Noto Serif Khmer, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-khmr", "Noto Sans Khmer, Helvetica, Arial"); +pref("font.name-list.monospace.x-khmr", "Noto Sans Khmer, Menlo, Courier New"); +// Malayalam +pref("font.name-list.serif.x-mlym", "Noto Serif Malayalam, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-mlym", "Noto Sans Malayalam, Helvetica, Arial"); +pref("font.name-list.monospace.x-mlym", "Noto Sans Malayalam, Menlo, Courier New"); +// Mathematics +pref("font.name-list.serif.x-math", "STIX Two Math, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-math", "STIX Two Math, Helvetica, Arial"); +pref("font.name-list.monospace.x-math", "STIX Two Math, Menlo, Courier New"); +// Oriya +pref("font.name-list.serif.x-orya", "Noto Sans Oriya, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-orya", "Noto Sans Oriya, Helvetica, Arial"); +pref("font.name-list.monospace.x-orya", "Noto Sans Oriya, Menlo, Courier New"); +// Sinhala +pref("font.name-list.serif.x-sinh", "Noto Serif Sinhala, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-sinh", "Noto Sans Sinhala, Helvetica, Arial"); +pref("font.name-list.monospace.x-sinh", "Noto Sans Sinhala, Menlo, Courier New"); +// Tamil +pref("font.name-list.serif.x-tamil", "Noto Serif Tamil, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-tamil", "Noto Sans Tamil, Helvetica, Arial"); +pref("font.name-list.monospace.x-tamil", "Noto Sans Tamil, Menlo, Courier New"); +// Telugu +pref("font.name-list.serif.x-telu", "Noto Serif Telugu, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-telu", "Noto Sans Telugu, Helvetica, Arial"); +pref("font.name-list.monospace.x-telu", "Noto Sans Telugu, Menlo, Courier New"); +// Tibetan +pref("font.name-list.serif.x-tibt", "Noto Serif Tibetan, Times, Times New Roman"); +pref("font.name-list.sans-serif.x-tibt", "Noto Serif Tibetan, Helvetica, Arial"); +pref("font.name-list.monospace.x-tibt", "Noto Serif Tibetan, Menlo, Courier New"); +// Others (Balinese, Grantha, Khojki, Lao, Myanmar) +pref("font.name-list.serif.x-unicode", "Times, Times New Roman, Noto Serif Balinese, Noto Serif Grantha, Noto Serif Khojki, Noto Serif Lao, Noto Serif Myanmar"); +pref("font.name-list.sans-serif.x-unicode", "Helvetica, Arial, Noto Sans Balinese, Noto Sans Grantha, Noto Sans Khojki, Noto Sans Lao, Pyidaungsu"); +pref("font.name-list.monospace.x-unicode", "Menlo, Courier New, Noto Sans Balinese, Noto Sans Grantha, Noto Sans Khojki, Noto Sans Lao, Pyidaungsu"); +// The rest are not customized, because they are covered only by one font +#endif + +#ifdef XP_WIN +pref("font.system.whitelist", "Arial, Cambria Math, Consolas, Courier New, Georgia, Lucida Console, MS Gothic, MS ゴシック, MS PGothic, MS Pゴシック, MV Boli, Malgun Gothic, Microsoft Himalaya, Microsoft JhengHei, Microsoft YaHei, 微软雅黑, Segoe UI, SimSun, 宋体, Sylfaen, Tahoma, Times New Roman, Verdana, Twemoji Mozilla, Noto Sans Adlam, Noto Sans Balinese, Noto Sans Bamum, Noto Sans Bassa Vah, Noto Sans Batak, Noto Sans Bengali, Noto Sans Buginese, Noto Sans Buhid, Noto Sans Canadian Aboriginal, Noto Sans Chakma, Noto Sans Cham, Noto Sans Cherokee, Noto Sans Coptic, Noto Sans Deseret, Noto Sans Devanagari, Noto Sans Elbasan, Noto Sans Ethiopic, Noto Sans Georgian, Noto Sans Grantha, Noto Sans Gujarati, Noto Sans Gunjala Gondi, Noto Sans Gurmukhi, Noto Sans Hanifi Rohingya, Noto Sans Hanunoo, Noto Sans Kannada, Noto Sans Khmer, Noto Sans Javanese, Noto Sans Kayah Li, Noto Sans Khojki, Noto Sans Khudawadi, Noto Sans Lao, Noto Sans Lepcha, Noto Sans Limbu, Noto Sans Lisu, Noto Sans Mahajani, Noto Sans Malayalam, Noto Sans Mandaic, Noto Sans Masaram Gondi, Noto Sans Medefaidrin, Noto Sans Meetei Mayek, Noto Sans Mende Kikakui, Noto Sans Miao, Noto Sans Modi, Noto Sans Mongolian, Noto Sans Mro, Noto Sans Multani, Noto Sans Newa, Noto Sans New Tai Lue, Noto Sans NKo, Noto Sans Ol Chiki, Noto Sans Oriya, Noto Sans Osage, Noto Sans Osmanya, Noto Sans Pahawh Hmong, Noto Sans Pau Cin Hau, Noto Sans Rejang, Noto Sans Runic, Noto Sans Samaritan, Noto Sans Saurashtra, Noto Sans Sharada, Noto Sans Shavian, Noto Sans Sinhala, Noto Sans Sora Sompeng, Noto Sans Soyombo, Noto Sans Sundanese, Noto Sans Syloti Nagri, Noto Sans Symbols 2, Noto Sans Symbols, Noto Sans Syriac, Noto Sans Tagalog, Noto Sans Tagbanwa, Noto Sans Tai Le, Noto Sans Tai Tham, Noto Sans Tai Viet, Noto Sans Takri, Noto Sans Tamil, Noto Sans Telugu, Noto Sans Thaana, Noto Sans Tifinagh Adrar, Noto Sans Tifinagh Agraw Imazighen, Noto Sans Tifinagh Ahaggar, Noto Sans Tifinagh Air, Noto Sans Tifinagh APT, Noto Sans Tifinagh Azawagh, Noto Sans Tifinagh Ghat, Noto Sans Tifinagh Hawad, Noto Sans Tifinagh, Noto Sans Tifinagh Rhissa Ixa, Noto Sans Tifinagh SIL, Noto Sans Tifinagh Tawellemmet, Noto Sans Tirhuta, Noto Sans Vai, Noto Sans Wancho, Noto Sans Warang Citi, Noto Sans Yi, Noto Sans Zanabazar Square, Noto Serif Balinese, Noto Serif Bengali, Noto Serif Devanagari, Noto Serif Dogra, Noto Serif Ethiopic, Noto Serif Georgian, Noto Serif Grantha, Noto Serif Gujarati, Noto Serif Gurmukhi, Noto Serif Kannada, Noto Serif Khmer, Noto Serif Khojki, Noto Serif Lao, Noto Serif Malayalam, Noto Serif Myanmar, Noto Serif NP Hmong, Noto Serif Sinhala, Noto Serif Tamil, Noto Serif Telugu, Noto Serif Tibetan, Noto Serif Yezidi, Noto Naskh Arabic, Noto Sans, Noto Serif, Pyidaungsu"); + +// Arabic +pref("font.name-list.serif.ar", "Times New Roman, Noto Naskh Arabic"); +pref("font.name-list.sans-serif.ar", "Segoe UI, Tahoma, Arial, Noto Naskh Arabic"); +pref("font.name-list.monospace.ar", "Consolas, Noto Naskh Arabic"); +// Bengali +pref("font.name-list.serif.x-beng", "Noto Serif Bengali, Times New Roman"); +pref("font.name-list.sans-serif.x-beng", "Noto Sans Bengali, Arial"); +pref("font.name-list.monospace.x-beng", "Noto Sans Bengali, Consolas"); +// Canadian Aboriginal +pref("font.name-list.serif.x-cans", "Noto Serif Canadian Aboriginal, Times New Roman"); +pref("font.name-list.sans-serif.x-cans", "Noto Sans Canadian Aboriginal, Arial"); +pref("font.name-list.monospace.x-cans", "Noto Sans Canadian Aboriginal, Consolas"); +// Cyrillic (we use Noto only for fallback, system fonts have a good coverage) +pref("font.name-list.serif.x-cyrillic", "Times New Roman, Noto Serif"); +pref("font.name-list.sans-serif.x-cyrillic", "Arial, Noto Sans"); +// Devanagari +pref("font.name-list.serif.x-devanagari", "Noto Serif Devanagari, Times New Roman"); +pref("font.name-list.sans-serif.x-devanagari", "Noto Sans Devanagari, Arial"); +pref("font.name-list.monospace.x-devanagari", "Noto Sans Devanagari, Consolas"); +// Ethiopic +pref("font.name-list.serif.x-ethi", "Noto Serif Ethiopic, Times New Roman"); +pref("font.name-list.sans-serif.x-ethi", "Noto Sans Ethiopic, Arial"); +pref("font.name-list.monospace.x-ethi", "Noto Sans Ethiopic, Consolas"); +// Georgian +pref("font.name-list.serif.x-geor", "Noto Serif Georgian, Times New Roman"); +pref("font.name-list.sans-serif.x-geor", "Noto Sans Georgian, Arial"); +pref("font.name-list.monospace.x-geor", "Noto Sans Georgian, Consolas"); +// Gujarati +pref("font.name-list.serif.x-gujr", "Noto Serif Gujarati, Times New Roman"); +pref("font.name-list.sans-serif.x-gujr", "Noto Sans Gujarati, Arial"); +pref("font.name-list.monospace.x-gujr", "Noto Sans Gujarati, Consolas"); +// Gurmukhi +pref("font.name-list.serif.x-guru", "Noto Serif Gurmukhi, Times New Roman"); +pref("font.name-list.sans-serif.x-guru", "Noto Sans Gurmukhi, Arial"); +pref("font.name-list.monospace.x-guru", "Noto Sans Gurmukhi, Consolas"); +// Kannada +pref("font.name-list.serif.x-knda", "Noto Serif Kannada, Times New Roman"); +pref("font.name-list.sans-serif.x-knda", "Noto Sans Kannada, Arial"); +pref("font.name-list.monospace.x-knda", "Noto Sans Kannada, Consolas"); +// Khmer +pref("font.name-list.serif.x-khmr", "Noto Serif Khmer, Times New Roman"); +pref("font.name-list.sans-serif.x-khmr", "Noto Sans Khmer, Arial"); +pref("font.name-list.monospace.x-khmr", "Noto Sans Khmer, Consolas"); +// Malayalam +pref("font.name-list.serif.x-mlym", "Noto Serif Malayalam, Times New Roman"); +pref("font.name-list.sans-serif.x-mlym", "Noto Sans Malayalam, Arial"); +pref("font.name-list.monospace.x-mlym", "Noto Sans Malayalam, Consolas"); +// Oriya +pref("font.name-list.serif.x-orya", "Noto Sans Oriya, Times New Roman"); +pref("font.name-list.sans-serif.x-orya", "Noto Sans Oriya, Arial"); +pref("font.name-list.monospace.x-orya", "Noto Sans Oriya, Consolas"); +// Sinhala +pref("font.name-list.serif.x-sinh", "Noto Serif Sinhala, Times New Roman"); +pref("font.name-list.sans-serif.x-sinh", "Noto Sans Sinhala, Arial"); +pref("font.name-list.monospace.x-sinh", "Noto Sans Sinhala, Consolas"); +// Tamil +pref("font.name-list.serif.x-tamil", "Noto Serif Tamil, Times New Roman"); +pref("font.name-list.sans-serif.x-tamil", "Noto Sans Tamil, Arial"); +pref("font.name-list.monospace.x-tamil", "Noto Sans Tamil, Consolas"); +// Telugu +pref("font.name-list.serif.x-telu", "Noto Serif Telugu, Times New Roman"); +pref("font.name-list.sans-serif.x-telu", "Noto Sans Telugu, Arial"); +pref("font.name-list.monospace.x-telu", "Noto Sans Telugu, Consolas"); +// Tibetan +pref("font.name-list.serif.x-tibt", "Microsoft Himalaya, Noto Serif Tibetan, Times New Roman"); +pref("font.name-list.sans-serif.x-tibt", "Microsoft Himalaya, Noto Serif Tibetan, Arial"); +pref("font.name-list.monospace.x-tibt", "Microsoft Himalaya, Noto Serif Tibetan, Consolas"); +// Others (Balinese, Grantha, Khojki, Lao, Myanmar) +pref("font.name-list.serif.x-unicode", "Times New Roman, Noto Serif Balinese, Noto Serif Grantha, Noto Serif Khojki, Noto Serif Lao, Noto Serif Myanmar"); +pref("font.name-list.sans-serif.x-unicode", "Arial, Noto Sans Balinese, Noto Sans Grantha, Noto Sans Khojki, Noto Sans Lao, Pyidaungsu"); +pref("font.name-list.monospace.x-unicode", "Consolas, Noto Sans Balinese, Noto Sans Grantha, Noto Sans Khojki, Noto Sans Lao, Pyidaungsu"); +// The rest are not customized, because they are covered only by one font +#endif + +#ifdef XP_LINUX +pref("font.system.whitelist", "Arimo, Cousine, Noto Naskh Arabic, Noto Sans Adlam, Noto Sans Armenian, Noto Sans Balinese, Noto Sans Bamum, Noto Sans Bassa Vah, Noto Sans Batak, Noto Sans Bengali, Noto Sans Buginese, Noto Sans Buhid, Noto Sans Canadian Aboriginal, Noto Sans Chakma, Noto Sans Cham, Noto Sans Cherokee, Noto Sans Coptic, Noto Sans Deseret, Noto Sans Devanagari, Noto Sans Elbasan, Noto Sans Ethiopic, Noto Sans Georgian, Noto Sans Grantha, Noto Sans Gujarati, Noto Sans Gunjala Gondi, Noto Sans Gurmukhi, Noto Sans Hanifi Rohingya, Noto Sans Hanunoo, Noto Sans Hebrew, Noto Sans JP, Noto Sans Javanese, Noto Sans KR, Noto Sans Kannada, Noto Sans Kayah Li, Noto Sans Khmer, Noto Sans Khojki, Noto Sans Khudawadi, Noto Sans Lao, Noto Sans Lepcha, Noto Sans Limbu, Noto Sans Lisu, Noto Sans Mahajani, Noto Sans Malayalam, Noto Sans Mandaic, Noto Sans Masaram Gondi, Noto Sans Medefaidrin, Noto Sans Meetei Mayek, Noto Sans Mende Kikakui, Noto Sans Miao, Noto Sans Modi, Noto Sans Mongolian, Noto Sans Mro, Noto Sans Multani, Noto Sans NKo, Noto Sans New Tai Lue, Noto Sans Newa, Noto Sans Ol Chiki, Noto Sans Oriya, Noto Sans Osage, Noto Sans Osmanya, Noto Sans Pahawh Hmong, Noto Sans Pau Cin Hau, Noto Sans Rejang, Noto Sans Runic, Noto Sans SC, Noto Sans Samaritan, Noto Sans Saurashtra, Noto Sans Sharada, Noto Sans Shavian, Noto Sans Sinhala, Noto Sans Sora Sompeng, Noto Sans Soyombo, Noto Sans Sundanese, Noto Sans Syloti Nagri, Noto Sans Symbols, Noto Sans Symbols 2, Noto Sans Syriac, Noto Sans TC, Noto Sans Tagalog, Noto Sans Tagbanwa, Noto Sans Tai Le, Noto Sans Tai Tham, Noto Sans Tai Viet, Noto Sans Takri, Noto Sans Tamil, Noto Sans Telugu, Noto Sans Thaana, Noto Sans Thai, Noto Sans Tifinagh, Noto Sans Tifinagh APT, Noto Sans Tifinagh Adrar, Noto Sans Tifinagh Agraw Imazighen, Noto Sans Tifinagh Ahaggar, Noto Sans Tifinagh Air, Noto Sans Tifinagh Azawagh, Noto Sans Tifinagh Ghat, Noto Sans Tifinagh Hawad, Noto Sans Tifinagh Rhissa Ixa, Noto Sans Tifinagh SIL, Noto Sans Tifinagh Tawellemmet, Noto Sans Tirhuta, Noto Sans Vai, Noto Sans Wancho, Noto Sans Warang Citi, Noto Sans Yi, Noto Sans Zanabazar Square, Noto Serif Armenian, Noto Serif Balinese, Noto Serif Bengali, Noto Serif Devanagari, Noto Serif Dogra, Noto Serif Ethiopic, Noto Serif Georgian, Noto Serif Grantha, Noto Serif Gujarati, Noto Serif Gurmukhi, Noto Serif Hebrew, Noto Serif Kannada, Noto Serif Khmer, Noto Serif Khojki, Noto Serif Lao, Noto Serif Malayalam, Noto Serif Myanmar, Noto Serif NP Hmong, Noto Serif Sinhala, Noto Serif Tamil, Noto Serif Telugu, Noto Serif Thai, Noto Serif Tibetan, Noto Serif Yezidi, Pyidaungsu, STIX Two Math, Tinos, Twemoji Mozilla"); + +// Arabic +pref("font.name-list.serif.ar", "Noto Naskh Arabic, Tinos"); +pref("font.name-list.sans-serif.ar", "Noto Naskh Arabic, Arimo"); +pref("font.name-list.monospace.ar", "Noto Naskh Arabic, Cousine"); +// Armenian +pref("font.name-list.serif.x-armn", "Noto Serif Armenian, Tinos"); +pref("font.name-list.sans-serif.x-armn", "Noto Sans Armenian, Arimo"); +pref("font.name-list.sans-serif.x-armn", "Noto Sans Armenian, Cousine"); +// Bengali +pref("font.name-list.serif.x-beng", "Noto Serif Bengali, Tinos"); +pref("font.name-list.sans-serif.x-beng", "Noto Sans Bengali, Arimo"); +pref("font.name-list.monospace.x-beng", "Noto Sans Bengali, Cousine"); +// Canadian Aboriginal +pref("font.name-list.serif.x-cans", "Noto Serif Canadian Aboriginal, Tinos"); +pref("font.name-list.sans-serif.x-cans", "Noto Sans Canadian Aboriginal, Arimo"); +pref("font.name-list.monospace.x-cans", "Noto Sans Canadian Aboriginal, Cousine"); +// ChineseCN +pref("font.name-list.serif.zh-CN", "Noto Sans SC Regular, Tinos"); +pref("font.name-list.sans-serif.zh-CN", "Noto Sans SC Regular, Arimo"); +pref("font.name-list.monospace.zh-CN", "Noto Sans SC Regular, Cousine"); +// ChineseHK +pref("font.name-list.serif.zh-HK", "Noto Sans TC Regular, Tinos"); +pref("font.name-list.sans-serif.zh-HK", "Noto Sans TC Regular, Arimo"); +pref("font.name-list.monospace.zh-HK", "Noto Sans TC Regular, Cousine"); +// ChineseTW +pref("font.name-list.serif.zh-TW", "Noto Sans TC Regular, Tinos"); +pref("font.name-list.sans-serif.zh-TW", "Noto Sans TC Regular, Arimo"); +pref("font.name-list.monospace.zh-TW", "Noto Sans TC Regular, Cousine"); +// Cyrillic +pref("font.name-list.serif.x-cyrillic", "Tinos"); +pref("font.name-list.sans-serif.x-cyrillic", "Arimo"); +pref("font.name-list.monospace.x-cyrillic", "Cousine"); +// Devanagari +pref("font.name-list.serif.x-devanagari", "Noto Serif Devanagari, Tinos"); +pref("font.name-list.sans-serif.x-devanagari", "Noto Sans Devanagari, Arimo"); +pref("font.name-list.monospace.x-devanagari", "Noto Sans Devanagari, Cousine"); +// Ethiopic +pref("font.name-list.serif.x-ethi", "Noto Serif Ethiopic, Tinos"); +pref("font.name-list.sans-serif.x-ethi", "Noto Sans Ethiopic, Arimo"); +pref("font.name-list.monospace.x-ethi", "Noto Sans Ethiopic, Cousine"); +// Georgian +pref("font.name-list.serif.x-geor", "Noto Serif Georgian, Tinos"); +pref("font.name-list.sans-serif.x-geor", "Noto Sans Georgian, Arimo"); +pref("font.name-list.monospace.x-geor", "Noto Sans Georgian, Cousine"); +// Greek +pref("font.name-list.serif.el", "Tinos"); +pref("font.name-list.sans-serif.el", "Arimo"); +pref("font.name-list.monospace.el", "Cousine"); +// Gujarati +pref("font.name-list.serif.x-gujr", "Noto Serif Gujarati, Tinos"); +pref("font.name-list.sans-serif.x-gujr", "Noto Sans Gujarati, Arimo"); +pref("font.name-list.monospace.x-gujr", "Noto Sans Gujarati, Cousine"); +// Gurmukhi +pref("font.name-list.serif.x-guru", "Noto Serif Gurmukhi, Tinos"); +pref("font.name-list.sans-serif.x-guru", "Noto Sans Gurmukhi, Arimo"); +pref("font.name-list.monospace.x-guru", "Noto Sans Gurmukhi, Cousine"); +// Hebrew +pref("font.name-list.serif.he", "Noto Serif Hebrew, Tinos"); +pref("font.name-list.sans-serif.he", "Noto Sans Hebrew, Arimo"); +pref("font.name-list.monospace.he", "Noto Sans Hebrew, Cousine"); +// Japanese +pref("font.name-list.serif.ja", "Noto Sans JP Regular, Tinos"); +pref("font.name-list.sans-serif.ja", "Noto Sans JP Regular, Arimo"); +pref("font.name-list.monospace.ja", "Noto Sans JP Regular, Cousine"); +// Kannada +pref("font.name-list.serif.x-knda", "Noto Serif Kannada, Tinos"); +pref("font.name-list.sans-serif.x-knda", "Noto Sans Kannada, Arimo"); +pref("font.name-list.monospace.x-knda", "Noto Sans Kannada, Cousine"); +// Khmer +pref("font.name-list.serif.x-khmr", "Noto Serif Khmer, Tinos"); +pref("font.name-list.sans-serif.x-khmr", "Noto Sans Khmer, Arimo"); +pref("font.name-list.monospace.x-khmr", "Noto Sans Khmer, Cousine"); +// Korean +pref("font.name-list.serif.ko", "Noto Sans KR Regular"); +pref("font.name-list.sans-serif.ko", "Noto Sans KR Regular"); +pref("font.name-list.monospace.ko", "Noto Sans KR Regular"); +// Malayalam +pref("font.name-list.serif.x-mlym", "Noto Serif Malayalam, Tinos"); +pref("font.name-list.sans-serif.x-mlym", "Noto Sans Malayalam, Arimo"); +pref("font.name-list.monospace.x-mlym", "Noto Sans Malayalam, Cousine"); +// Mathematics +pref("font.name-list.serif.x-math", "STIX Two Math, Tinos"); +pref("font.name-list.sans-serif.x-math", "STIX Two Math, Arimo"); +pref("font.name-list.monospace.x-math", "STIX Two Math, Cousine"); +// Oriya +pref("font.name-list.serif.x-orya", "Noto Sans Oriya, Tinos"); +pref("font.name-list.sans-serif.x-orya", "Noto Sans Oriya, Arimo"); +pref("font.name-list.monospace.x-orya", "Noto Sans Oriya, Cousine"); +// Sinhala +pref("font.name-list.serif.x-sinh", "Noto Serif Sinhala, Tinos"); +pref("font.name-list.sans-serif.x-sinh", "Noto Sans Sinhala, Arimo"); +pref("font.name-list.monospace.x-sinh", "Noto Sans Sinhala, Cousine"); +// Tamil +pref("font.name-list.serif.x-tamil", "Noto Serif Tamil, Tinos"); +pref("font.name-list.sans-serif.x-tamil", "Noto Sans Tamil, Arimo"); +pref("font.name-list.monospace.x-tamil", "Noto Sans Tamil, Cousine"); +// Telugu +pref("font.name-list.serif.x-telu", "Noto Serif Telugu, Tinos"); +pref("font.name-list.sans-serif.x-telu", "Noto Sans Telugu, Arimo"); +pref("font.name-list.monospace.x-telu", "Noto Sans Telugu, Cousine"); +// Thai +pref("font.name-list.serif.th", "Noto Serif Thai, Tinos"); +pref("font.name-list.sans-serif.th", "Noto Sans Thai, Arimo"); +pref("font.name-list.monospace.th", "Noto Sans Thai, Cousine"); +// Tibetan +pref("font.name-list.serif.x-tibt", "Noto Serif Tibetan, Tinos"); +pref("font.name-list.sans-serif.x-tibt", "Noto Serif Tibetan, Arimo"); +pref("font.name-list.monospace.x-tibt", "Noto Serif Tibetan, Cousine"); +// Western +pref("font.name-list.serif.x-western", "Tinos"); +pref("font.name-list.sans-serif.x-western", "Arimo"); +pref("font.name-list.monospace.x-western", "Cousine"); +// Others (Balinese, Grantha, Khojki, Lao, Myanmar) +pref("font.name-list.serif.x-unicode", "Tinos, Noto Serif Balinese, Noto Serif Grantha, Noto Serif Khojki, Noto Serif Lao, Noto Serif Myanmar"); +pref("font.name-list.sans-serif.x-unicode", "Arimo, Noto Sans Balinese, Noto Sans Grantha, Noto Sans Khojki, Noto Sans Lao, Pyidaungsu"); +pref("font.name-list.monospace.x-unicode", "Cousine, Noto Sans Balinese, Noto Sans Grantha, Noto Sans Khojki, Noto Sans Lao, Pyidaungsu"); +// The rest are not customized, because they are covered only by one font +#endif +#endif diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 23409de3ce16a706ce9a2a384dd2d134085d99d4..2f3910b894d7f20891a17bc66521b209b8339520 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -50,9 +50,9 @@ pref("extensions.recommendations.themeRecommendationUrl", "https://color.firefox pref("extensions.update.autoUpdateDefault", true); -// Check AUS for system add-on updates. -pref("extensions.systemAddon.update.url", "https://aus5.mozilla.org/update/3/SystemAddons/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml"); -pref("extensions.systemAddon.update.enabled", true); +// No AUS check for system add-on updates for Tor Browser users. +pref("extensions.systemAddon.update.url", ""); +pref("extensions.systemAddon.update.enabled", false); // Disable add-ons that are not installed by the user in all scopes by default. // See the SCOPE constants in AddonManager.sys.mjs for values to use here. diff --git a/browser/base/content/aboutDialog-appUpdater.js b/browser/base/content/aboutDialog-appUpdater.js index 4f999fb5f45bb8eae307891e60092d4d1155f645..4e0ce398b54c7e5dc2283a97b077569cbc1add6f 100644 --- a/browser/base/content/aboutDialog-appUpdater.js +++ b/browser/base/content/aboutDialog-appUpdater.js @@ -205,7 +205,7 @@ appUpdater.prototype = { if (aChildID == "downloadAndInstall") { let updateVersion = gAppUpdater.update.displayVersion; // Include the build ID if this is an "a#" (nightly or aurora) build - if (/a\d+$/.test(updateVersion)) { + if (!AppConstants.BASE_BROWSER_UPDATE && /a\d+$/.test(updateVersion)) { let buildID = gAppUpdater.update.buildID; let year = buildID.slice(0, 4); let month = buildID.slice(4, 6); diff --git a/browser/base/content/aboutDialog.js b/browser/base/content/aboutDialog.js index f6e1391baf12abb91c85a95107bb3923118746c0..817bfce7f2a9743e041f20fb41709e6c5bb65b57 100644 --- a/browser/base/content/aboutDialog.js +++ b/browser/base/content/aboutDialog.js @@ -44,34 +44,21 @@ function init() { } // Include the build ID and display warning if this is an "a#" (nightly or aurora) build - let versionIdMap = new Map([ - ["base", "aboutDialog-version"], - ["base-nightly", "aboutDialog-version-nightly"], - ["base-arch", "aboutdialog-version-arch"], - ["base-arch-nightly", "aboutdialog-version-arch-nightly"], - ]); - let versionIdKey = "base"; + let versionId = "basebrowser-about-dialog-version"; let versionAttributes = { - version: AppConstants.MOZ_APP_VERSION_DISPLAY, + version: AppConstants.BASE_BROWSER_VERSION, + firefoxVersion: AppConstants.MOZ_APP_VERSION_DISPLAY, }; let arch = Services.sysinfo.get("arch"); if (["x86", "x86-64"].includes(arch)) { versionAttributes.bits = Services.appinfo.is64Bit ? 64 : 32; } else { - versionIdKey += "-arch"; versionAttributes.arch = arch; } let version = Services.appinfo.version; if (/a\d+$/.test(version)) { - versionIdKey += "-nightly"; - let buildID = Services.appinfo.appBuildID; - let year = buildID.slice(0, 4); - let month = buildID.slice(4, 6); - let day = buildID.slice(6, 8); - versionAttributes.isodate = `${year}-${month}-${day}`; - document.getElementById("experimental").hidden = false; document.getElementById("communityDesc").hidden = true; } @@ -79,11 +66,7 @@ function init() { // Use Fluent arguments for append version and the architecture of the build let versionField = document.getElementById("version"); - document.l10n.setAttributes( - versionField, - versionIdMap.get(versionIdKey), - versionAttributes - ); + document.l10n.setAttributes(versionField, versionId, versionAttributes); // Show a release notes link if we have a URL. let relNotesLink = document.getElementById("releasenotes"); diff --git a/browser/base/content/aboutDialog.xhtml b/browser/base/content/aboutDialog.xhtml index c64980810570fcea84e33fdc2d66ac42a79f4e46..65309ef710956653c4d11858ea362e9757abf2d5 100644 --- a/browser/base/content/aboutDialog.xhtml +++ b/browser/base/content/aboutDialog.xhtml @@ -14,7 +14,7 @@ data-l10n-id="aboutDialog-title" #endif role="dialog" - aria-describedby="version distribution distributionId communityDesc contributeDesc trademark" + aria-describedby="version distribution distributionId projectDesc helpDesc trademark" > #ifdef XP_MACOSX #include macWindow.inc.xhtml @@ -32,9 +32,15 @@ rel="stylesheet" href="chrome://branding/content/aboutDialog.css" /> + + + @@ -100,9 +106,12 @@ + + @@ -124,22 +133,24 @@