From ce7c1f797fc97d5b0e214d5fb05f38307d1015a0 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Thu, 23 Jan 2025 12:10:26 +0100 Subject: [PATCH 001/318] Refactor macOS build workflow and remove deprecated entitlements files --- .github/workflows/build.yml | 13 +- .github/workflows/macos-release-build.yml | 42 +--- .../macos-universal-release-build.yml | 201 ++++++++++++++++++ .../browser.developer.entitlements.xml | 39 ---- build/codesign/codesign.bash | 179 ---------------- ...lugin-container.developer.entitlements.xml | 32 --- configs/macos/mozconfig | 8 +- 7 files changed, 219 insertions(+), 295 deletions(-) create mode 100644 .github/workflows/macos-universal-release-build.yml delete mode 100644 build/codesign/browser.developer.entitlements.xml delete mode 100644 build/codesign/codesign.bash delete mode 100644 build/codesign/plugin-container.developer.entitlements.xml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 518265a08..4ac5e4999 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -350,6 +350,17 @@ jobs: build-version: ${{ needs.build-data.outputs.version }} release-branch: ${{ inputs.update_branch }} + mac-uni: + name: macOS build (Universal) + uses: ./.github/workflows/macos-universal-release-build.yml + permissions: + contents: write + secrets: inherit + needs: [build-data] + with: + build-version: ${{ needs.build-data.outputs.version }} + release-branch: ${{ inputs.update_branch }} + appimage: name: AppImage build - Linux ${{ matrix.arch }} permissions: @@ -453,7 +464,7 @@ jobs: if: ${{ inputs.create_release || inputs.update_branch == 'twilight' }} permissions: write-all name: Release - needs: [build-data, linux, windows-step-3, check-release, mac, appimage, source, lint, stop-self-hosted] + needs: [build-data, linux, windows-step-3, check-release, mac-uni, appimage, source, lint, stop-self-hosted] runs-on: ubuntu-latest environment: name: ${{ inputs.update_branch == 'release' && 'Deploy-Release' || 'Deploy-Twilight' }} diff --git a/.github/workflows/macos-release-build.yml b/.github/workflows/macos-release-build.yml index e3bb85823..c7f352113 100644 --- a/.github/workflows/macos-release-build.yml +++ b/.github/workflows/macos-release-build.yml @@ -120,27 +120,12 @@ jobs: export SURFER_PLATFORM="darwin" bash .github/workflows/src/release-build.sh - - name: Import APPLE DEVELOPER ID CERTIFICATE for .app - uses: Apple-Actions/import-codesign-certs@v3 - with: - p12-file-base64: ${{ secrets.macOS_CERTIFICATES_P12_For_App_BASE64 }} - p12-password: ${{ secrets.macOS_CERTIFICATES_P12_PASSWORD }} - - - name: Import provisioning profile for .app - run: | - echo "${{ secrets.macOS_PROVISIONING_PROFILE }}" | base64 --decode > ./engine/Zen_Browser.provisionprofile - ls -la - - name: Package env: SURFER_COMPAT: ${{ matrix.arch }} ZEN_GA_DISABLE_PGO: true - MACOS_APPLE_ACCOUNT_ID: ${{ secrets.macOS_AppleAccountId }} - MACOS_APPLE_DEVELOPER_ID_TEAM_ID: ${{ secrets.macOS_AppleDeveloperIdTeamId }} - MACOS_APPLE_DEVELOPER_ID_PASSWORD: ${{ secrets.macOS_AppleDeveloperIdPassword }} run: | export SURFER_PLATFORM="darwin" - export MACOS_APPLE_DEVELOPER_ID="${{ secrets.macOS_AppleDeveloperId }}" export ZEN_RELEASE=1 pnpm package @@ -148,31 +133,12 @@ jobs: run: | mv ./dist/output.mar macos-${{ matrix.arch }}.mar - - name: Remove sensitive information - run: | - rm -f ./engine/Zen_Browser.provisionprofile - - - name: Sign .dmg - run: | - set -ex - hdiutil convert ./dist/*.dmg -format UDZO -imagekey zlib-level=9 -o zen.macos-${{ matrix.arch }}.dmg - xattr -cr zen.macos-${{ matrix.arch }}.dmg - codesign -s "${{ secrets.macOS_AppleDeveloperId }}" zen.macos-${{ matrix.arch }}.dmg - xcrun notarytool submit "zen.macos-${{ matrix.arch }}.dmg" \ - --apple-id "${{ secrets.macOS_AppleAccountId }}" \ - --team-id "${{ secrets.macOS_AppleDeveloperIdTeamId }}" \ - --password "${{ secrets.macOS_AppleDeveloperIdPassword }}" \ - --no-s3-acceleration \ - --verbose \ - --wait - xcrun stapler staple "zen.macos-${{ matrix.arch }}.dmg" - - - name: Upload build artifact + - name: Upload dist app folder uses: actions/upload-artifact@v4 with: - retention-days: 5 - name: zen.macos-${{ matrix.arch }}.dmg - path: ./zen.macos-${{ matrix.arch }}.dmg + retention-days: 1 + name: obj-${{ matrix.arch }}-apple-darwin + path: ./engine/obj-${{ matrix.arch }}-apple-darwin - name: Upload build artifact (.mar) uses: actions/upload-artifact@v4 diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml new file mode 100644 index 000000000..04d95a992 --- /dev/null +++ b/.github/workflows/macos-universal-release-build.yml @@ -0,0 +1,201 @@ +name: macOS Release Build + +on: + workflow_call: + inputs: + build-version: + description: 'The version to build' + required: true + type: string + release-branch: + description: 'The branch to build' + required: true + type: string + +jobs: + mac-build: + name: Unify macOS (Universal) + runs-on: 'macos-14' + + strategy: + fail-fast: false + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + token: ${{ secrets.DEPLOY_KEY }} + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + + - name: Setup Python + uses: actions/setup-python@v5 + # note: This will use the version defined in '.python-version' by default + + - name: Setup Git + run: | + git config --global user.email "mauro-balades@users.noreply.github.com" + git config --global user.name "mauro-balades" + + - name: Install system dependencies + run: | + brew update + brew install cairo sccache gnu-tar mercurial + sudo pip install setuptools + + brew uninstall --ignore-dependencies python3.12 -f + + export PATH="$(python3 -m site --user-base)/bin":$PATH + python3 -m pip install --user mercurial + + rm '/usr/local/bin/2to3-3.11' '/usr/local/bin/2to3-3.12' '/usr/local/bin/2to3' + rm '/usr/local/bin/idle3.11' '/usr/local/bin/idle3.12' '/usr/local/bin/idle3' + rm '/usr/local/bin/pydoc3.11' '/usr/local/bin/pydoc3.12' '/usr/local/bin/pydoc3' + rm '/usr/local/bin/python3.11' '/usr/local/bin/python3.12' '/usr/local/bin/python3' + rm '/usr/local/bin/python3.11-config' '/usr/local/bin/python3.12-config' '/usr/local/bin/python3-config' + + brew install watchman + + cargo install apple-codesign + + - name: Force usage of gnu-tar + run: | + echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bash_profile + echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.zsh + source ~/.bash_profile + + - name: Setup pnpm + run: npm install -g pnpm + + - name: Get pnpm store directory + id: pnpm-cache + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + + - name: Install dependencies + run: | + pnpm install + + - name: Load surfer CI setup + run: pnpm surfer ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }} + + - name: Download Firefox source and dependencies + run: pnpm surfer download + + - name: Download x86_64 app folder from artifacts + uses: actions/download-artifact@v4 + with: + name: obj-x86_64-apple-darwin + path: engine + + - name: Download aarch64 app folder from artifacts + uses: actions/download-artifact@v4 + with: + name: obj-aarch64-apple-darwin + path: engine + + - name: Find first .app folder name + run: | + cd engine/obj-x86_64-apple-darwin/dist + export APP_NAME=$(basename $(find . -name "*.app" -type d | head -n 1)) + echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV + echo "APP_NAME=$APP_NAME" + + - name: Bootstrap + run: | + cd engine + export SURFER_PLATFORM="darwin" + export PATH="$(python3 -m site --user-base)/bin":$PATH + ./mach --no-interactive bootstrap --application-choice browser --no-system-changes + cd .. + + - name: Import + run: pnpm surfer import + + - name: create .p12 for codesign 🖊️ + run: | + cd engine + echo ${{ secrets.macOS_CERTIFICATES_P12_For_App_BASE64 }} > cert.txt + base64 --decode -i cert.txt -o zenCert.p12 + echo ${{ secrets.macOS_CERTIFICATES_P12_PASSWORD }} > zenpCertPassword.passwd + + - name: Remove certificate sensitive information + run: | + rm engine/cert.txt || true + + - name: Import provisioning profile for .app + run: | + echo "${{ secrets.macOS_PROVISIONING_PROFILE }}" | base64 --decode > ./engine/Zen_Browser.provisionprofile + ls -la + + - name: Copy provisioning profile for .app on both architectures (embedded in .app) + run: | + cd engine + echo "Copying provisioning profile for .app on both architectures (${{ env.APP_NAME }})" + cp ./Zen_Browser.provisionprofile ./obj-x86_64-apple-darwin/dist/${{ env.APP_NAME }}/Contents/embedded.provisionprofile + cp ./Zen_Browser.provisionprofile ./obj-aarch64-apple-darwin/dist/${{ env.APP_NAME }}/Contents/embedded.provisionprofile + + - name: Unify architectures + run: | + cd engine + ./mach python "./toolkit/mozapps/installer/unify.py" "./obj-x86_64-apple-darwin/dist/${{ env.APP_NAME }}" "./obj-aarch64-apple-darwin/dist/${{ env.APP_NAME }}" + echo "Merged aaarch64 into x86_64!" + + - name: Import APPLE DEVELOPER ID CERTIFICATE for .app + uses: Apple-Actions/import-codesign-certs@v3 + with: + p12-file-base64: ${{ secrets.macOS_CERTIFICATES_P12_For_App_BASE64 }} + p12-password: ${{ secrets.macOS_CERTIFICATES_P12_PASSWORD }} + + - name: Sign .app + run: | + cd engine + ./mach macos-sign -v -r -c "release" -e "production" -a "./obj-x86_64-apple-darwin/dist/zen/${{ env.APP_NAME }}" --rcodesign-p12-file zenCert.p12 --rcodesign-p12-password-file zenpCertPassword.passwd + + - name: Remove sensitive information + run: | + rm -f ./engine/Zen_Browser.provisionprofile + + - name: Create DMG + run: | + cd engine + ./mach python -m mozbuild.action.make_dmg ./obj-x86_64-apple-darwin/dist/zen zen-macOS-universal-temp.dmg + + - name: Sign .dmg + run: | + set -ex + hdiutil convert zen-macOS-universal-temp.dmg -format UDZO -imagekey zlib-level=9 -o zen.macos-universal.dmg + codesign -s "${{ secrets.macOS_AppleDeveloperId }}" zen.macos-universal.dmg + xcrun notarytool submit "zen.macos-universal.dmg" \ + --apple-id "${{ secrets.macOS_AppleAccountId }}" \ + --team-id "${{ secrets.macOS_AppleDeveloperIdTeamId }}" \ + --password "${{ secrets.macOS_AppleDeveloperIdPassword }}" \ + --no-s3-acceleration \ + --wait + xcrun stapler staple "zen.macos-universal.dmg" + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + retention-days: 5 + name: zen.macos-${{ matrix.arch }}.dmg + path: ./zen.macos-${{ matrix.arch }}.dmg + + - name: Upload build artifact (.mar) + uses: actions/upload-artifact@v4 + with: + retention-days: 5 + name: macos-${{ matrix.arch }}.mar + path: ./macos-${{ matrix.arch }}.mar + + - name: Upload build artifact (update manifests) + uses: actions/upload-artifact@v4 + with: + retention-days: 5 + name: macos_update_manifest_${{ matrix.arch }} + path: ./dist/update diff --git a/build/codesign/browser.developer.entitlements.xml b/build/codesign/browser.developer.entitlements.xml deleted file mode 100644 index 7722dd8df..000000000 --- a/build/codesign/browser.developer.entitlements.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - com.apple.security.cs.allow-unsigned-executable-memory - - - com.apple.security.cs.allow-jit - - - com.apple.security.cs.disable-library-validation - - - com.apple.security.device.audio-input - - - com.apple.security.device.camera - - - com.apple.security.personal-information.location - - - com.apple.security.automation.apple-events - - - com.apple.security.smartcard - - - com.apple.application-identifier - H36NPCN86W.app.zen-browser.zen - - diff --git a/build/codesign/codesign.bash b/build/codesign/codesign.bash deleted file mode 100644 index 74104451b..000000000 --- a/build/codesign/codesign.bash +++ /dev/null @@ -1,179 +0,0 @@ -#!/bin/bash -# -# 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 https://mozilla.org/MPL/2.0/. -# -# Runs codesign commands to codesign a Firefox .app bundle and enable macOS -# Hardened Runtime. Intended to be manually run by developers working on macOS -# 10.14+ who want to enable Hardened Runtime for manual testing. This is -# provided as a stop-gap until automated build tooling is available that signs -# binaries with a certificate generated during builds (bug 1522409). This -# script requires macOS 10.14 because Hardened Runtime is only available for -# applications running on 10.14 despite support for the codesign "-o runtime" -# option being available in 10.13.6 and newer. -# -# The script requires an identity string (-i option) from an Apple Developer -# ID certificate. This can be found in the macOS KeyChain after configuring an -# Apple Developer ID certificate. -# -# Example usage on macOS 10.14: -# -# $ ./mach build -# $ ./mach build package -# $ open -# -# $ ./security/mac/hardenedruntime/codesign.bash \ -# -a ~/Nightly.app \ -# -i \ -# -b security/mac/hardenedruntime/browser.developer.entitlements.xml -# -p security/mac/hardenedruntime/plugin-container.developer.entitlements.xml -# $ open ~/Nightly.app -# - -usage () -{ - echo "Usage: $0 " - echo " -a " - echo " -i " - echo " -b " - echo " -p " - echo " [-o ]" - exit -1 -} - -# Make sure we are running on macOS with the sw_vers command available. -SWVERS=/usr/bin/sw_vers -if [ ! -x ${SWVERS} ]; then - echo "ERROR: macOS 10.14 or later is required" - exit -1 -fi - -# Require macOS 10.14 or newer. -#OSVERSION=`${SWVERS} -productVersion|sed -En 's/[0-9]+\.([0-9]+)\.[0-9]+/\1/p'`; -#if [ ${OSVERSION} \< 14 ]; then -# echo "ERROR: macOS 10.14 or later is required" -# exit -1 -#fi - -while getopts "a:i:b:o:p:" opt; do - case ${opt} in - a ) BUNDLE=$OPTARG ;; - i ) IDENTITY=$OPTARG ;; - b ) BROWSER_ENTITLEMENTS_FILE=$OPTARG ;; - p ) PLUGINCONTAINER_ENTITLEMENTS_FILE=$OPTARG ;; - o ) OUTPUT_DMG_FILE=$OPTARG ;; - \? ) usage; exit -1 ;; - esac -done - -if [ -z "${BUNDLE}" ] || - [ -z "${IDENTITY}" ] || - [ -z "${PLUGINCONTAINER_ENTITLEMENTS_FILE}" ] || - [ -z "${BROWSER_ENTITLEMENTS_FILE}" ]; then - usage - exit -1 -fi - -if [ ! -d "${BUNDLE}" ]; then - echo "Invalid bundle. Bundle should be a .app directory" - usage - exit -1 -fi - -if [ ! -e "${PLUGINCONTAINER_ENTITLEMENTS_FILE}" ]; then - echo "Invalid entitlements file" - usage - exit -1 -fi - -if [ ! -e "${BROWSER_ENTITLEMENTS_FILE}" ]; then - echo "Invalid entitlements file" - usage - exit -1 -fi - -# DMG file output flag is optional -if [ ! -z "${OUTPUT_DMG_FILE}" ] && - [ -e "${OUTPUT_DMG_FILE}" ]; then - echo "Output dmg file ${OUTPUT_DMG_FILE} exists. Please delete it first." - usage - exit -1 -fi - -echo "-------------------------------------------------------------------------" -echo "bundle: $BUNDLE" -echo "identity: $IDENTITY" -echo "browser entitlements file: $BROWSER_ENTITLEMENTS_FILE" -echo "plugin-container entitlements file: $PLUGINCONTAINER_ENTITLEMENTS_FILE" -echo "output dmg file (optional): $OUTPUT_DMG_FILE" -echo "-------------------------------------------------------------------------" - -set -x - -# move Zen_Browser.provisionprofile to the Contents directory -#cp Zen_Browser.provisionprofile "${BUNDLE}"/Contents/embedded.provisionprofile - -# Clear extended attributes which cause codesign to fail -xattr -cr "${BUNDLE}" - -# Sign these binaries first. Signing of some binaries has an ordering -# requirement where other binaries must be signed first. -codesign --force -o runtime --verbose --sign "$IDENTITY" \ -"${BUNDLE}/Contents/Library/LaunchServices/org.mozilla.updater" \ -"${BUNDLE}/Contents/MacOS/XUL" \ -"${BUNDLE}"/Contents/embedded.provisionprofile \ -"${BUNDLE}/Contents/MacOS/pingsender" - -# Sign every ${BUNDLE}/Contents/MacOS/*.dylib -find "${BUNDLE}"/Contents/MacOS -type f -name "*.dylib" -exec \ -codesign --force --verbose --sign "$IDENTITY" {} \; - -find "${BUNDLE}"/Contents/MacOS -type f -name "*.dylib" -exec \ -codesign -vvv --strict --deep --verbose {} \; - -codesign --force -o runtime --verbose --sign "$IDENTITY" --deep \ -"${BUNDLE}"/Contents/MacOS/updater.app - -# Sign zen main executable -codesign --force -o runtime --verbose --sign "$IDENTITY" --deep \ ---entitlements ${BROWSER_ENTITLEMENTS_FILE} \ -"${BUNDLE}"/Contents/MacOS/zen - -# Sign Library/LaunchServices -codesign --force -o runtime --verbose --sign "$IDENTITY" --deep \ -"${BUNDLE}"/Contents/Library/LaunchServices/org.mozilla.updater - -# Sign gmp-clearkey files -find "${BUNDLE}"/Contents/Resources/gmp-clearkey -type f -exec \ -codesign --force -o runtime --verbose --sign "$IDENTITY" {} \; - -# Sign the main bundle -codesign --force -o runtime --verbose --sign "$IDENTITY" \ ---entitlements ${BROWSER_ENTITLEMENTS_FILE} "${BUNDLE}" - -# Sign the plugin-container bundle with deep -codesign --force -o runtime --verbose --sign "$IDENTITY" --deep \ ---entitlements ${PLUGINCONTAINER_ENTITLEMENTS_FILE} \ -"${BUNDLE}"/Contents/MacOS/plugin-container.app - -# Validate -codesign -vvv --deep --strict "${BUNDLE}" - -# Create a DMG -if [ ! -z "${OUTPUT_DMG_FILE}" ]; then - DISK_IMAGE_DIR=`mktemp -d` - TEMP_FILE=`mktemp` - TEMP_DMG=${TEMP_FILE}.dmg - NAME=`basename "${BUNDLE}"` - - ditto "${BUNDLE}" "${DISK_IMAGE_DIR}/${NAME}" - hdiutil create -size 400m -fs HFS+ \ - -volname Firefox -srcfolder "${DISK_IMAGE_DIR}" "${TEMP_DMG}" - hdiutil convert -format UDZO \ - -o "${OUTPUT_DMG_FILE}" "${TEMP_DMG}" - - rm ${TEMP_FILE} - rm ${TEMP_DMG} - rm -rf "${DISK_IMAGE_DIR}" -fi diff --git a/build/codesign/plugin-container.developer.entitlements.xml b/build/codesign/plugin-container.developer.entitlements.xml deleted file mode 100644 index 050c2df66..000000000 --- a/build/codesign/plugin-container.developer.entitlements.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - com.apple.security.cs.allow-unsigned-executable-memory - - - com.apple.security.cs.allow-jit - - - com.apple.security.cs.disable-library-validation - - - com.apple.security.device.audio-input - - - com.apple.security.device.camera - - - com.apple.security.personal-information.location - - - com.apple.security.automation.apple-events - - \ No newline at end of file diff --git a/configs/macos/mozconfig b/configs/macos/mozconfig index 34ee5c6a5..7ab6a2275 100644 --- a/configs/macos/mozconfig +++ b/configs/macos/mozconfig @@ -12,12 +12,8 @@ export MOZ_LTO=cross,thin ac_add_options --enable-lto=cross,thin if test "$ZEN_RELEASE"; then - if test "$ZEN_GA_DISABLE_PGO"; then - export ZEN_DUMMY=1 - else - export MOZ_PGO=1 - ac_add_options MOZ_PGO=1 - fi + export ZEN_DUMMY=1 + fi if test "$SURFER_COMPAT" = "x86_64"; then From 83f8975a503714185fd389053e3c4e42379bf9d7 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Thu, 23 Jan 2025 12:20:20 +0100 Subject: [PATCH 002/318] Update macOS build workflow to include mac dependency and modify Firefox browser identifier in hardened runtime configuration --- .github/workflows/build.yml | 2 +- .../v2/production/firefox-browser-xml.patch | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/security/mac/hardenedruntime/v2/production/firefox-browser-xml.patch diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ac5e4999..75fa36403 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -356,7 +356,7 @@ jobs: permissions: contents: write secrets: inherit - needs: [build-data] + needs: [build-data, mac] with: build-version: ${{ needs.build-data.outputs.version }} release-branch: ${{ inputs.update_branch }} diff --git a/src/security/mac/hardenedruntime/v2/production/firefox-browser-xml.patch b/src/security/mac/hardenedruntime/v2/production/firefox-browser-xml.patch new file mode 100644 index 000000000..f6c9b347e --- /dev/null +++ b/src/security/mac/hardenedruntime/v2/production/firefox-browser-xml.patch @@ -0,0 +1,13 @@ +diff --git a/security/mac/hardenedruntime/v2/production/firefox.browser.xml b/security/mac/hardenedruntime/v2/production/firefox.browser.xml +index abbf33e9d2b3c9d1e0a34bd46e7cd289c435533b..4d988ca8201fa6aba6ca049e97d3cdc6b772b5eb 100644 +--- a/security/mac/hardenedruntime/v2/production/firefox.browser.xml ++++ b/security/mac/hardenedruntime/v2/production/firefox.browser.xml +@@ -26,7 +26,7 @@ + + + com.apple.application-identifier +- 43AQ936H96.org.mozilla.firefox ++ H36NPCN86W.app.zen-browser.zen + + + com.apple.developer.web-browser.public-key-credential From f6bad14087c7f03568a9a67149e2101c20a53637 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Thu, 23 Jan 2025 12:23:26 +0100 Subject: [PATCH 003/318] Update @zen-browser/surfer dependency to version 1.9.9 --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 5cf332487..cd45ff95f 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ }, "homepage": "https://github.com/zen-browser/core#readme", "dependencies": { - "@zen-browser/surfer": "^1.9.8" + "@zen-browser/surfer": "^1.9.9" }, "devDependencies": { "husky": "^9.1.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c4a6d2148..b6be83968 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@zen-browser/surfer': - specifier: ^1.9.8 - version: 1.9.8(glob@7.2.3) + specifier: ^1.9.9 + version: 1.9.9(glob@7.2.3) devDependencies: husky: specifier: ^9.1.7 @@ -122,8 +122,8 @@ packages: '@types/node@17.0.45': resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} - '@zen-browser/surfer@1.9.8': - resolution: {integrity: sha512-dx4ouPDB7bg+eWR+NNuhdroR0JyZ+bWlxpAFskl9TiR3cvr1qtmZG9bYSF27nLNOUSWgKNamjevP785B08Cxjg==} + '@zen-browser/surfer@1.9.9': + resolution: {integrity: sha512-MBttoXC1qfS0hv/6tBZIykD808B+7I8OB69fmH5EvFXstgDGJnOfFv1MAxbt1I0SC26iWCi6hqO+kqgoPGaBdw==} hasBin: true ansi-escapes@7.0.0: @@ -1036,7 +1036,7 @@ snapshots: '@types/node@17.0.45': {} - '@zen-browser/surfer@1.9.8(glob@7.2.3)': + '@zen-browser/surfer@1.9.9(glob@7.2.3)': dependencies: '@resvg/resvg-js': 1.4.0 async-icns: 1.0.2 From ea0a808e150d32b6e08c23324f6173b2b3e70df2 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Thu, 23 Jan 2025 14:26:33 +0100 Subject: [PATCH 004/318] Update @zen-browser/surfer dependency to version 1.9.10 --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index cd45ff95f..8a4de24d8 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ }, "homepage": "https://github.com/zen-browser/core#readme", "dependencies": { - "@zen-browser/surfer": "^1.9.9" + "@zen-browser/surfer": "^1.9.10" }, "devDependencies": { "husky": "^9.1.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b6be83968..c16dc387e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@zen-browser/surfer': - specifier: ^1.9.9 - version: 1.9.9(glob@7.2.3) + specifier: ^1.9.10 + version: 1.9.10(glob@7.2.3) devDependencies: husky: specifier: ^9.1.7 @@ -122,8 +122,8 @@ packages: '@types/node@17.0.45': resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} - '@zen-browser/surfer@1.9.9': - resolution: {integrity: sha512-MBttoXC1qfS0hv/6tBZIykD808B+7I8OB69fmH5EvFXstgDGJnOfFv1MAxbt1I0SC26iWCi6hqO+kqgoPGaBdw==} + '@zen-browser/surfer@1.9.10': + resolution: {integrity: sha512-0M95qvc1IPKed/4F4mCH5k+dadfRkaCpJJtyNHgMGEjlimueQ05M0fzJz9oS0KBR/k74tLB0H6MqWhx5h93BBg==} hasBin: true ansi-escapes@7.0.0: @@ -1036,7 +1036,7 @@ snapshots: '@types/node@17.0.45': {} - '@zen-browser/surfer@1.9.9(glob@7.2.3)': + '@zen-browser/surfer@1.9.10(glob@7.2.3)': dependencies: '@resvg/resvg-js': 1.4.0 async-icns: 1.0.2 From a640509e04c5b2c06b2bed56b2e927a4fd666b70 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Thu, 23 Jan 2025 16:47:33 +0100 Subject: [PATCH 005/318] Enhance macOS build workflows by renaming artifact paths and adding a step to list .app folders --- .github/workflows/macos-release-build.yml | 3 ++- .github/workflows/macos-universal-release-build.yml | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos-release-build.yml b/.github/workflows/macos-release-build.yml index c7f352113..a1b2e06b9 100644 --- a/.github/workflows/macos-release-build.yml +++ b/.github/workflows/macos-release-build.yml @@ -132,13 +132,14 @@ jobs: - name: Rename artifacts run: | mv ./dist/output.mar macos-${{ matrix.arch }}.mar + mv ./engine/obj-${{ matrix.arch }}-apple-darwin ./obj-${{ matrix.arch }}-apple-darwin - name: Upload dist app folder uses: actions/upload-artifact@v4 with: retention-days: 1 name: obj-${{ matrix.arch }}-apple-darwin - path: ./engine/obj-${{ matrix.arch }}-apple-darwin + path: ./obj-${{ matrix.arch }}-apple-darwin - name: Upload build artifact (.mar) uses: actions/upload-artifact@v4 diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index 04d95a992..008fae110 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -99,6 +99,14 @@ jobs: name: obj-aarch64-apple-darwin path: engine + - name: List .app folders + run: | + ls engine/ + echo "--------------------" + cd engine/obj-x86_64-apple-darwin/dist + find . -name "*.app" -type d + cd ../.. + - name: Find first .app folder name run: | cd engine/obj-x86_64-apple-darwin/dist From c3f22ec7ebf26885961adc684b545838e298667f Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Thu, 23 Jan 2025 19:47:47 +0100 Subject: [PATCH 006/318] Update macOS build workflow to specify artifact download paths for architecture-specific folders --- .github/workflows/macos-universal-release-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index 008fae110..4c76cdcab 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -91,13 +91,13 @@ jobs: uses: actions/download-artifact@v4 with: name: obj-x86_64-apple-darwin - path: engine + path: engine/obj-x86_64-apple-darwin - name: Download aarch64 app folder from artifacts uses: actions/download-artifact@v4 with: name: obj-aarch64-apple-darwin - path: engine + path: engine/obj-aarch64-apple-darwin - name: List .app folders run: | From 3972f3e2a75c33b6eb88cd7b16f3bbe43de5f734 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Thu, 23 Jan 2025 19:51:12 +0100 Subject: [PATCH 007/318] Fixed glance opening on essential tabs even if it's disabled (closes https://github.com/zen-browser/desktop/issues/4564) --- src/browser/base/zen-components/ZenGlanceManager.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/browser/base/zen-components/ZenGlanceManager.mjs b/src/browser/base/zen-components/ZenGlanceManager.mjs index 69dd437f6..6e7b0e5af 100644 --- a/src/browser/base/zen-components/ZenGlanceManager.mjs +++ b/src/browser/base/zen-components/ZenGlanceManager.mjs @@ -330,7 +330,8 @@ this._lazyPref.SHOULD_OPEN_EXTERNAL_TABS_IN_GLANCE && owner.linkedBrowser?.docShellIsActive && owner.linkedBrowser?.browsingContext?.isAppTab && - this.tabDomainsDiffer(owner, uri) + this.tabDomainsDiffer(owner, uri) && + Services.prefs.getBoolPref('zen.glance.enabled', true) ); } From 5f7fcd57d20e68d8c5a6742e9c15608795baf470 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Thu, 23 Jan 2025 21:47:17 +0100 Subject: [PATCH 008/318] Fix quoting for environment variable expansion in macOS build workflow --- .github/workflows/macos-universal-release-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index 4c76cdcab..36731b99e 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -128,9 +128,9 @@ jobs: - name: create .p12 for codesign 🖊️ run: | cd engine - echo ${{ secrets.macOS_CERTIFICATES_P12_For_App_BASE64 }} > cert.txt + echo "${{ secrets.macOS_CERTIFICATES_P12_For_App_BASE64 }}" > cert.txt base64 --decode -i cert.txt -o zenCert.p12 - echo ${{ secrets.macOS_CERTIFICATES_P12_PASSWORD }} > zenpCertPassword.passwd + echo "${{ secrets.macOS_CERTIFICATES_P12_PASSWORD }}" > zenpCertPassword.passwd - name: Remove certificate sensitive information run: | From a09f3ab32c9de4815e3d45a45c9035444afd03b4 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Thu, 23 Jan 2025 23:55:02 +0100 Subject: [PATCH 009/318] Limit search depth for .app folders and refine APP_NAME extraction in macOS build workflow --- .github/workflows/macos-universal-release-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index 36731b99e..830c5c14b 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -104,13 +104,13 @@ jobs: ls engine/ echo "--------------------" cd engine/obj-x86_64-apple-darwin/dist - find . -name "*.app" -type d + find . -maxdepth 1 -name "*.app" -type d cd ../.. - name: Find first .app folder name run: | cd engine/obj-x86_64-apple-darwin/dist - export APP_NAME=$(basename $(find . -name "*.app" -type d | head -n 1)) + export APP_NAME=$(basename $(find . -maxdepth 1 -name "Zen *.app" -type d | head -n 1)) echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV echo "APP_NAME=$APP_NAME" From 0def2c24c80e39a9c4298f964522b67cc60432d4 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mauro-balades@users.noreply.github.com> Date: Fri, 24 Jan 2025 02:00:22 +0100 Subject: [PATCH 010/318] Update macos-universal-release-build.yml Signed-off-by: mr. m <91018726+mauro-balades@users.noreply.github.com> --- .github/workflows/macos-universal-release-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index 830c5c14b..f9724993b 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -110,8 +110,8 @@ jobs: - name: Find first .app folder name run: | cd engine/obj-x86_64-apple-darwin/dist - export APP_NAME=$(basename $(find . -maxdepth 1 -name "Zen *.app" -type d | head -n 1)) - echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV + export APP_NAME="$(basename $(find . -maxdepth 1 -name "Zen *.app" -type d | head -n 1))" + echo "APP_NAME=\"$APP_NAME\"" >> $GITHUB_ENV echo "APP_NAME=$APP_NAME" - name: Bootstrap @@ -145,8 +145,8 @@ jobs: run: | cd engine echo "Copying provisioning profile for .app on both architectures (${{ env.APP_NAME }})" - cp ./Zen_Browser.provisionprofile ./obj-x86_64-apple-darwin/dist/${{ env.APP_NAME }}/Contents/embedded.provisionprofile - cp ./Zen_Browser.provisionprofile ./obj-aarch64-apple-darwin/dist/${{ env.APP_NAME }}/Contents/embedded.provisionprofile + cp ./Zen_Browser.provisionprofile "./obj-x86_64-apple-darwin/dist/${{ env.APP_NAME }}/Contents/embedded.provisionprofile" + cp ./Zen_Browser.provisionprofile "./obj-aarch64-apple-darwin/dist/${{ env.APP_NAME }}/Contents/embedded.provisionprofile" - name: Unify architectures run: | From 22a042d35d1d5818780f919aad53a7fe6e1e92ef Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Fri, 24 Jan 2025 17:04:10 +0100 Subject: [PATCH 011/318] Refine APP_NAME extraction and add verification step in macOS build workflow --- .github/workflows/macos-universal-release-build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index f9724993b..5a6314b64 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -110,10 +110,13 @@ jobs: - name: Find first .app folder name run: | cd engine/obj-x86_64-apple-darwin/dist - export APP_NAME="$(basename $(find . -maxdepth 1 -name "Zen *.app" -type d | head -n 1))" + export APP_NAME=$(basename "$(find . -maxdepth 1 -name "Zen *.app" -type d | head -n 1)") echo "APP_NAME=\"$APP_NAME\"" >> $GITHUB_ENV echo "APP_NAME=$APP_NAME" + - name: Make sure APP_NAME works + run: ls "engine/obj-x86_64-apple-darwin/dist/${{ env.APP_NAME }}" + - name: Bootstrap run: | cd engine From ac600ad91b14b26cf76d58668d1ba51ca754b7d0 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Fri, 24 Jan 2025 19:08:04 +0100 Subject: [PATCH 012/318] Remove redundant APP_NAME verification step in macOS build workflow --- .github/workflows/macos-universal-release-build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index 5a6314b64..1b4c7e743 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -114,9 +114,6 @@ jobs: echo "APP_NAME=\"$APP_NAME\"" >> $GITHUB_ENV echo "APP_NAME=$APP_NAME" - - name: Make sure APP_NAME works - run: ls "engine/obj-x86_64-apple-darwin/dist/${{ env.APP_NAME }}" - - name: Bootstrap run: | cd engine From 952385f36207c976e93731f707fde47c8232fe75 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Fri, 24 Jan 2025 21:25:49 +0100 Subject: [PATCH 013/318] Fix quoting for APP_NAME environment variable in macOS build workflow --- .github/workflows/macos-universal-release-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index 1b4c7e743..6153ab252 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -111,7 +111,7 @@ jobs: run: | cd engine/obj-x86_64-apple-darwin/dist export APP_NAME=$(basename "$(find . -maxdepth 1 -name "Zen *.app" -type d | head -n 1)") - echo "APP_NAME=\"$APP_NAME\"" >> $GITHUB_ENV + echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV echo "APP_NAME=$APP_NAME" - name: Bootstrap From ca4952c02cbf2996a51fc9bfd746a735b0b80cc1 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 25 Jan 2025 00:44:40 +0100 Subject: [PATCH 014/318] Add build ID generation and pass to build workflows --- .github/workflows/build.yml | 24 +++++++++++++++++---- .github/workflows/linux-release-build.yml | 7 ++++++ .github/workflows/macos-release-build.yml | 7 ++++++ .github/workflows/windows-release-build.yml | 7 ++++++ 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 75fa36403..66c177bb3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,6 +54,18 @@ jobs: echo "GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}" echo "GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}" + buildid: + name: Generate build ID + runs-on: ubuntu-latest + outputs: + buildids: ${{ steps.get.outputs.bid }} + steps: + - id: get + shell: bash -xe {0} + run: | + bdat=`date +"%Y%m%d%I%M%S"` + echo "bid=${bdat}" >> $GITHUB_OUTPUT + start-self-host: runs-on: ubuntu-latest needs: debug-inputs @@ -294,7 +306,7 @@ jobs: windows-step-1: name: Windows build step 1 (PGO build) uses: ./.github/workflows/windows-release-build.yml - needs: [build-data] + needs: [build-data, buildid] permissions: contents: write secrets: inherit @@ -303,6 +315,7 @@ jobs: generate-gpo: true profile-data-path-archive: zen-windows-profile-data-and-jarlog.zip release-branch: ${{ inputs.update_branch }} + MOZ_BUILD_DATE: ${{needs.buildid.outputs.buildids}} windows-step-2: name: Windows build step 2 (Generate profile data) @@ -322,11 +335,12 @@ jobs: permissions: contents: write secrets: inherit - needs: [build-data, windows-step-2, start-self-host] + needs: [build-data, windows-step-2, start-self-host, buildid] with: build-version: ${{ needs.build-data.outputs.version }} generate-gpo: false release-branch: ${{ inputs.update_branch }} + MOZ_BUILD_DATE: ${{needs.buildid.outputs.buildids}} linux: name: Linux build @@ -334,10 +348,11 @@ jobs: permissions: contents: write secrets: inherit - needs: [build-data, start-self-host] + needs: [build-data, start-self-host, buildid] with: build-version: ${{ needs.build-data.outputs.version }} release-branch: ${{ inputs.update_branch }} + MOZ_BUILD_DATE: ${{needs.buildid.outputs.buildids}} mac: name: macOS build @@ -345,10 +360,11 @@ jobs: permissions: contents: write secrets: inherit - needs: [build-data] + needs: [build-data, buildid] with: build-version: ${{ needs.build-data.outputs.version }} release-branch: ${{ inputs.update_branch }} + MOZ_BUILD_DATE: ${{needs.buildid.outputs.buildids}} mac-uni: name: macOS build (Universal) diff --git a/.github/workflows/linux-release-build.yml b/.github/workflows/linux-release-build.yml index 6875bf682..d112eb5fd 100644 --- a/.github/workflows/linux-release-build.yml +++ b/.github/workflows/linux-release-build.yml @@ -11,6 +11,10 @@ on: description: 'The branch to build' required: true type: string + MOZ_BUILD_DATE: + type: string + required: true + default: "" jobs: build-linux: @@ -130,6 +134,9 @@ jobs: continue-on-error: true run: | export SURFER_PLATFORM="linux" + if [[ -n ${{ inputs.MOZ_BUILD_DATE }} ]];then + export MOZ_BUILD_DATE=${{ inputs.MOZ_BUILD_DATE }} + fi bash .github/workflows/src/release-build.sh - name: Package diff --git a/.github/workflows/macos-release-build.yml b/.github/workflows/macos-release-build.yml index a1b2e06b9..8c4d93622 100644 --- a/.github/workflows/macos-release-build.yml +++ b/.github/workflows/macos-release-build.yml @@ -11,6 +11,10 @@ on: description: 'The branch to build' required: true type: string + MOZ_BUILD_DATE: + type: string + required: true + default: "" jobs: mac-build: @@ -118,6 +122,9 @@ jobs: ZEN_RELEASE_BRANCH: ${{ inputs.release-branch }} run: | export SURFER_PLATFORM="darwin" + if [[ -n ${{ inputs.MOZ_BUILD_DATE }} ]];then + export MOZ_BUILD_DATE=${{ inputs.MOZ_BUILD_DATE }} + fi bash .github/workflows/src/release-build.sh - name: Package diff --git a/.github/workflows/windows-release-build.yml b/.github/workflows/windows-release-build.yml index c6333e8b0..6f0126e2f 100644 --- a/.github/workflows/windows-release-build.yml +++ b/.github/workflows/windows-release-build.yml @@ -18,6 +18,10 @@ on: description: 'The branch to build' required: true type: string + MOZ_BUILD_DATE: + type: string + required: true + default: "" jobs: windows-build: @@ -215,6 +219,9 @@ jobs: if test ${{ inputs.generate-gpo }} = true; then export ZEN_GA_GENERATE_PROFILE=1 fi + if [[ -n ${{ inputs.MOZ_BUILD_DATE }} ]];then + export MOZ_BUILD_DATE=${{ inputs.MOZ_BUILD_DATE }} + fi bash .github/workflows/src/release-build.sh - name: Package From 504faad0771e9ad128f02af768f80c9e3e9de0f8 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 25 Jan 2025 10:49:47 +0100 Subject: [PATCH 015/318] Refactor macOS build workflows to improve artifact handling and extraction process --- .github/workflows/macos-release-build.yml | 8 +- .../macos-universal-release-build.yml | 93 +++++++++++++------ 2 files changed, 69 insertions(+), 32 deletions(-) diff --git a/.github/workflows/macos-release-build.yml b/.github/workflows/macos-release-build.yml index 8c4d93622..4f5dcf107 100644 --- a/.github/workflows/macos-release-build.yml +++ b/.github/workflows/macos-release-build.yml @@ -139,14 +139,14 @@ jobs: - name: Rename artifacts run: | mv ./dist/output.mar macos-${{ matrix.arch }}.mar - mv ./engine/obj-${{ matrix.arch }}-apple-darwin ./obj-${{ matrix.arch }}-apple-darwin + tar -czf zen-${{ matrix.arch }}-apple-darwin-dist.tar.gz ./engine/obj-${arch}-apple-darwin/dist/ - - name: Upload dist app folder + - name: Upload dist dmg uses: actions/upload-artifact@v4 with: retention-days: 1 - name: obj-${{ matrix.arch }}-apple-darwin - path: ./obj-${{ matrix.arch }}-apple-darwin + name: zen-${{ matrix.arch }}-apple-darwin-dist.tar.gz + path: ./zen-${{ matrix.arch }}-apple-darwin-dist.tar.gz - name: Upload build artifact (.mar) uses: actions/upload-artifact@v4 diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index 6153ab252..693510388 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -87,17 +87,64 @@ jobs: - name: Download Firefox source and dependencies run: pnpm surfer download - - name: Download x86_64 app folder from artifacts - uses: actions/download-artifact@v4 - with: - name: obj-x86_64-apple-darwin - path: engine/obj-x86_64-apple-darwin + - name: Bootstrap + run: | + cd engine + export SURFER_PLATFORM="darwin" + export PATH="$(python3 -m site --user-base)/bin":$PATH + ./mach --no-interactive bootstrap --application-choice browser --no-system-changes + cd .. - - name: Download aarch64 app folder from artifacts + - name: Download x86_64 dist from artifacts uses: actions/download-artifact@v4 with: - name: obj-aarch64-apple-darwin - path: engine/obj-aarch64-apple-darwin + name: zen-x86_64-apple-darwin-dist.tar.gz + + - name: Download aarch64 dist from artifacts + uses: actions/download-artifact@v4 + with: + name: zen-aarch64-apple-darwin-dist.tar.gz + + - name: Extract 📦 + run: | + brew install gnu-tar + export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH + + mv ./zen-x86_64-apple-darwin-dist.tar.gz ./engine/ + mv ./zen-aarch64-apple-darwin-dist.tar.gz ./engine/ + + tar -xf ./zen-x86_64-apple-darwin-dist.tar.gz + tar -xf ./zen-aarch64-apple-darwin-dist.tar.gz + + - name: Find first .app folder name + run: | + cd engine/obj-x86_64-apple-darwin/dist + export APP_NAME=$(basename "$(find . -maxdepth 1 -name "Zen *.app" -type d | head -n 1)" .app) + echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV + echo "APP_NAME=$APP_NAME" + + - name: Remove any existing .app folders + run: | + rm -rf "./obj-x86_64-apple-darwin/dist/zen/*.app" || true + rm -rf "./obj-aarch64-apple-darwin/dist/zen/*.app" || true + + - name: Extract .app from dmg + run: | + hdiutil attach ./obj-x86_64-apple-darwin/dist/zen.macos-x86_64.dmg + ls -la /Volumes + ls -la "/Volumes/${{ env.APP_NAME }}" + echo "---" + cp -R "/Volumes/${{ env.APP_NAME }}/${{ env.APP_NAME }}.app" "./obj-x86_64-apple-darwin/dist/zen/" + hdiutil detach "/Volumes/${{ env.APP_NAME }}" + echo "Done extracting x86_64 .app" + echo "--------------------" + hdiutil attach ./obj-aarch64-apple-darwin/dist/zen.macos-aarch64.dmg + ls -la /Volumes + ls -la "/Volumes/${{ env.APP_NAME }}" + cp -R "/Volumes/${{ env.APP_NAME }}/${{ env.APP_NAME }}.app" "./obj-aarch64-apple-darwin/dist/zen/" + hdiutil detach "/Volumes/${{ env.APP_NAME }}" + echo "Done extracting aarch64 .app" + echo "--------------------" - name: List .app folders run: | @@ -107,21 +154,6 @@ jobs: find . -maxdepth 1 -name "*.app" -type d cd ../.. - - name: Find first .app folder name - run: | - cd engine/obj-x86_64-apple-darwin/dist - export APP_NAME=$(basename "$(find . -maxdepth 1 -name "Zen *.app" -type d | head -n 1)") - echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV - echo "APP_NAME=$APP_NAME" - - - name: Bootstrap - run: | - cd engine - export SURFER_PLATFORM="darwin" - export PATH="$(python3 -m site --user-base)/bin":$PATH - ./mach --no-interactive bootstrap --application-choice browser --no-system-changes - cd .. - - name: Import run: pnpm surfer import @@ -145,13 +177,13 @@ jobs: run: | cd engine echo "Copying provisioning profile for .app on both architectures (${{ env.APP_NAME }})" - cp ./Zen_Browser.provisionprofile "./obj-x86_64-apple-darwin/dist/${{ env.APP_NAME }}/Contents/embedded.provisionprofile" - cp ./Zen_Browser.provisionprofile "./obj-aarch64-apple-darwin/dist/${{ env.APP_NAME }}/Contents/embedded.provisionprofile" + cp ./Zen_Browser.provisionprofile "./obj-x86_64-apple-darwin/dist/${{ env.APP_NAME }}.app/Contents/embedded.provisionprofile" + cp ./Zen_Browser.provisionprofile "./obj-aarch64-apple-darwin/dist/${{ env.APP_NAME }}.app/Contents/embedded.provisionprofile" - name: Unify architectures run: | cd engine - ./mach python "./toolkit/mozapps/installer/unify.py" "./obj-x86_64-apple-darwin/dist/${{ env.APP_NAME }}" "./obj-aarch64-apple-darwin/dist/${{ env.APP_NAME }}" + ./mach python "./toolkit/mozapps/installer/unify.py" "./obj-x86_64-apple-darwin/dist/${{ env.APP_NAME }}.app" "./obj-aarch64-apple-darwin/dist/${{ env.APP_NAME }}.app" echo "Merged aaarch64 into x86_64!" - name: Import APPLE DEVELOPER ID CERTIFICATE for .app @@ -163,7 +195,7 @@ jobs: - name: Sign .app run: | cd engine - ./mach macos-sign -v -r -c "release" -e "production" -a "./obj-x86_64-apple-darwin/dist/zen/${{ env.APP_NAME }}" --rcodesign-p12-file zenCert.p12 --rcodesign-p12-password-file zenpCertPassword.passwd + ./mach macos-sign -v -r -c "release" -e "production" -a "./obj-x86_64-apple-darwin/dist/zen/${{ env.APP_NAME }}.app" --rcodesign-p12-file zenCert.p12 --rcodesign-p12-password-file zenpCertPassword.passwd - name: Remove sensitive information run: | @@ -172,7 +204,12 @@ jobs: - name: Create DMG run: | cd engine - ./mach python -m mozbuild.action.make_dmg ./obj-x86_64-apple-darwin/dist/zen zen-macOS-universal-temp.dmg + ./mach python -m mozbuild.action.make_dmg \ + --volume-name "${{ env.APP_NAME }}" \ + --background ./browser/branding/${{ inputs.release-branch }}/background.png \ + --icon ./browser/branding/${{ inputs.release-branch }}/firefox.icns \ + --dsstore ./browser/branding/${{ inputs.release-branch }}/dsstore \ + ./obj-x86_64-apple-darwin/dist/zen zen-macOS-universal-temp.dmg - name: Sign .dmg run: | From c67440a9404ad79cc7a4b8b8f0eed3b43c98fe7c Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 25 Jan 2025 12:15:37 +0100 Subject: [PATCH 016/318] Fix variable reference in artifact packaging step of macOS build workflow --- .github/workflows/macos-release-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos-release-build.yml b/.github/workflows/macos-release-build.yml index 4f5dcf107..5478daf3d 100644 --- a/.github/workflows/macos-release-build.yml +++ b/.github/workflows/macos-release-build.yml @@ -139,7 +139,7 @@ jobs: - name: Rename artifacts run: | mv ./dist/output.mar macos-${{ matrix.arch }}.mar - tar -czf zen-${{ matrix.arch }}-apple-darwin-dist.tar.gz ./engine/obj-${arch}-apple-darwin/dist/ + tar -czf zen-${{ matrix.arch }}-apple-darwin-dist.tar.gz ./engine/obj-${{ matrix.arch }}-apple-darwin/dist/ - name: Upload dist dmg uses: actions/upload-artifact@v4 From a724f9c6f21f0431f628a7d9ad4218dfae0a3f77 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mauro-balades@users.noreply.github.com> Date: Sat, 25 Jan 2025 12:18:52 +0100 Subject: [PATCH 017/318] Discard changes to src/browser/base/zen-components/ZenGlanceManager.mjs --- src/browser/base/zen-components/ZenGlanceManager.mjs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/browser/base/zen-components/ZenGlanceManager.mjs b/src/browser/base/zen-components/ZenGlanceManager.mjs index 6e7b0e5af..69dd437f6 100644 --- a/src/browser/base/zen-components/ZenGlanceManager.mjs +++ b/src/browser/base/zen-components/ZenGlanceManager.mjs @@ -330,8 +330,7 @@ this._lazyPref.SHOULD_OPEN_EXTERNAL_TABS_IN_GLANCE && owner.linkedBrowser?.docShellIsActive && owner.linkedBrowser?.browsingContext?.isAppTab && - this.tabDomainsDiffer(owner, uri) && - Services.prefs.getBoolPref('zen.glance.enabled', true) + this.tabDomainsDiffer(owner, uri) ); } From abedcd889669d4166b3397bcd577457ad53b68cd Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 25 Jan 2025 13:52:12 +0100 Subject: [PATCH 018/318] Remove emoji from extract step name in macOS build workflow --- .github/workflows/macos-universal-release-build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index 693510388..97031b235 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -105,7 +105,7 @@ jobs: with: name: zen-aarch64-apple-darwin-dist.tar.gz - - name: Extract 📦 + - name: Extract run: | brew install gnu-tar export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH @@ -113,6 +113,7 @@ jobs: mv ./zen-x86_64-apple-darwin-dist.tar.gz ./engine/ mv ./zen-aarch64-apple-darwin-dist.tar.gz ./engine/ + cd engine tar -xf ./zen-x86_64-apple-darwin-dist.tar.gz tar -xf ./zen-aarch64-apple-darwin-dist.tar.gz From 7fc4c03659a4452ee1569b2c3666692a67a90a6a Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 25 Jan 2025 13:53:59 +0100 Subject: [PATCH 019/318] Change event listener from 'MozAfterPaint' to 'DOMContentLoaded' for better timing of resize event dispatch --- src/browser/base/content/ZenCustomizableUI.sys.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/base/content/ZenCustomizableUI.sys.mjs b/src/browser/base/content/ZenCustomizableUI.sys.mjs index 2a210cba3..fcd92ea1d 100644 --- a/src/browser/base/content/ZenCustomizableUI.sys.mjs +++ b/src/browser/base/content/ZenCustomizableUI.sys.mjs @@ -126,7 +126,7 @@ export var ZenCustomizableUI = new (class { window.CustomizableUI.registerToolbarNode(window.document.getElementById('zen-sidebar-top-buttons')); window.CustomizableUI.registerToolbarNode(window.document.getElementById('zen-sidebar-icons-wrapper')); window.addEventListener( - 'MozAfterPaint', + 'DOMContentLoaded', () => { this._dispatchResizeEvent(window); }, From 9850c977beed26f5577fc8e4a3a34d3d0997442a Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 25 Jan 2025 15:45:37 +0100 Subject: [PATCH 020/318] Refactor macOS build workflow to improve artifact packaging process --- .github/workflows/macos-release-build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos-release-build.yml b/.github/workflows/macos-release-build.yml index 5478daf3d..4e5b4ec1e 100644 --- a/.github/workflows/macos-release-build.yml +++ b/.github/workflows/macos-release-build.yml @@ -139,7 +139,11 @@ jobs: - name: Rename artifacts run: | mv ./dist/output.mar macos-${{ matrix.arch }}.mar - tar -czf zen-${{ matrix.arch }}-apple-darwin-dist.tar.gz ./engine/obj-${{ matrix.arch }}-apple-darwin/dist/ + cd engine + echo "Tarballing dist..." + tar -czf zen-${{ matrix.arch }}-apple-darwin-dist.tar.gz ./obj-${{ matrix.arch }}-apple-darwin/dist/ + echo "Tarballing dist done" + mv zen-${{ matrix.arch }}-apple-darwin-dist.tar.gz ../ - name: Upload dist dmg uses: actions/upload-artifact@v4 From 9ebfc973f3d593385039ffbe26a35e2151230994 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 25 Jan 2025 15:46:56 +0100 Subject: [PATCH 021/318] Add set -ex to macOS build workflow for improved error handling during .app extraction --- .github/workflows/macos-universal-release-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index 97031b235..6e7f4bf3d 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -131,6 +131,7 @@ jobs: - name: Extract .app from dmg run: | + set -ex hdiutil attach ./obj-x86_64-apple-darwin/dist/zen.macos-x86_64.dmg ls -la /Volumes ls -la "/Volumes/${{ env.APP_NAME }}" From d41f0d7cf4b4e7071c6dca5dfaa15c400dad86ff Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 25 Jan 2025 15:47:47 +0100 Subject: [PATCH 022/318] Add directory change to macOS build workflow before extracting .app from dmg --- .github/workflows/macos-universal-release-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index 6e7f4bf3d..b5a66caad 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -132,6 +132,7 @@ jobs: - name: Extract .app from dmg run: | set -ex + cd engine hdiutil attach ./obj-x86_64-apple-darwin/dist/zen.macos-x86_64.dmg ls -la /Volumes ls -la "/Volumes/${{ env.APP_NAME }}" From 74a4d982a543c8a871955ec7530f3c113e0577a8 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 25 Jan 2025 17:41:08 +0100 Subject: [PATCH 023/318] Update macOS build workflow to use wildcard for DMG file attachment --- .github/workflows/macos-universal-release-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index b5a66caad..7141b2dd8 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -133,7 +133,7 @@ jobs: run: | set -ex cd engine - hdiutil attach ./obj-x86_64-apple-darwin/dist/zen.macos-x86_64.dmg + hdiutil attach ./obj-x86_64-apple-darwin/dist/zen*.dmg ls -la /Volumes ls -la "/Volumes/${{ env.APP_NAME }}" echo "---" @@ -141,7 +141,7 @@ jobs: hdiutil detach "/Volumes/${{ env.APP_NAME }}" echo "Done extracting x86_64 .app" echo "--------------------" - hdiutil attach ./obj-aarch64-apple-darwin/dist/zen.macos-aarch64.dmg + hdiutil attach ./obj-aarch64-apple-darwin/dist/zen*.dmg ls -la /Volumes ls -la "/Volumes/${{ env.APP_NAME }}" cp -R "/Volumes/${{ env.APP_NAME }}/${{ env.APP_NAME }}.app" "./obj-aarch64-apple-darwin/dist/zen/" From ac53d731e9803f8723290882153e3c73eb68a910 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 25 Jan 2025 21:19:26 +0100 Subject: [PATCH 024/318] Refactor macOS build workflow to streamline .app extraction from DMG files --- .../macos-universal-release-build.yml | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index 7141b2dd8..279bd181a 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -126,28 +126,22 @@ jobs: - name: Remove any existing .app folders run: | - rm -rf "./obj-x86_64-apple-darwin/dist/zen/*.app" || true - rm -rf "./obj-aarch64-apple-darwin/dist/zen/*.app" || true + set -x + rm -rf "./obj-x86_64-apple-darwin/dist/zen/*.app" + rm -rf "./obj-aarch64-apple-darwin/dist/zen/*.app" - name: Extract .app from dmg run: | set -ex cd engine - hdiutil attach ./obj-x86_64-apple-darwin/dist/zen*.dmg - ls -la /Volumes - ls -la "/Volumes/${{ env.APP_NAME }}" - echo "---" - cp -R "/Volumes/${{ env.APP_NAME }}/${{ env.APP_NAME }}.app" "./obj-x86_64-apple-darwin/dist/zen/" - hdiutil detach "/Volumes/${{ env.APP_NAME }}" - echo "Done extracting x86_64 .app" - echo "--------------------" - hdiutil attach ./obj-aarch64-apple-darwin/dist/zen*.dmg - ls -la /Volumes - ls -la "/Volumes/${{ env.APP_NAME }}" - cp -R "/Volumes/${{ env.APP_NAME }}/${{ env.APP_NAME }}.app" "./obj-aarch64-apple-darwin/dist/zen/" - hdiutil detach "/Volumes/${{ env.APP_NAME }}" - echo "Done extracting aarch64 .app" - echo "--------------------" + echo "Extracting x86_64 .app from dmg" + ./mach python -m mozbuild.action.extract_dmg \ + ./obj-x86_64-apple-darwin/dist/zen*.dmg \ + ./obj-x86_64-apple-darwin/dist + echo "Extracting aarch64 .app from dmg" + ./mach python -m mozbuild.action.extract_dmg \ + ./obj-aarch64-apple-darwin/dist/zen*.dmg \ + ./obj-aarch64-apple-darwin/dist - name: List .app folders run: | @@ -186,6 +180,8 @@ jobs: - name: Unify architectures run: | cd engine + ls -la "./obj-x86_64-apple-darwin/dist/${{ env.APP_NAME }}.app/Contents" + ls -la "./obj-x86_64-apple-darwin/dist/${{ env.APP_NAME }}.app/Contents/MacOS" ./mach python "./toolkit/mozapps/installer/unify.py" "./obj-x86_64-apple-darwin/dist/${{ env.APP_NAME }}.app" "./obj-aarch64-apple-darwin/dist/${{ env.APP_NAME }}.app" echo "Merged aaarch64 into x86_64!" From b863045a8fde99ee1428248c1e46fc545f460113 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 25 Jan 2025 22:55:42 +0100 Subject: [PATCH 025/318] Rename extract_dmg to unpack_dmg in macOS build workflow and fix newline in surfer.json --- .github/workflows/macos-universal-release-build.yml | 4 ++-- surfer.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index 279bd181a..9b3994248 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -135,11 +135,11 @@ jobs: set -ex cd engine echo "Extracting x86_64 .app from dmg" - ./mach python -m mozbuild.action.extract_dmg \ + ./mach python -m mozbuild.action.unpack_dmg \ ./obj-x86_64-apple-darwin/dist/zen*.dmg \ ./obj-x86_64-apple-darwin/dist echo "Extracting aarch64 .app from dmg" - ./mach python -m mozbuild.action.extract_dmg \ + ./mach python -m mozbuild.action.unpack_dmg \ ./obj-aarch64-apple-darwin/dist/zen*.dmg \ ./obj-aarch64-apple-darwin/dist diff --git a/surfer.json b/surfer.json index 1cd560986..847c55d81 100644 --- a/surfer.json +++ b/surfer.json @@ -53,4 +53,4 @@ "licenseType": "MPL-2.0" }, "updateHostname": "updates.zen-browser.app" -} +} \ No newline at end of file From df745e1b43ea3fef5c18ccb3857fa18610b06ba0 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sun, 26 Jan 2025 12:12:11 +0100 Subject: [PATCH 026/318] Remove generation of EventArtifactDefinitions.json from telemetry build process --- .../components/telemetry/moz-build.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/toolkit/components/telemetry/moz-build.patch diff --git a/src/toolkit/components/telemetry/moz-build.patch b/src/toolkit/components/telemetry/moz-build.patch new file mode 100644 index 000000000..70d262dbf --- /dev/null +++ b/src/toolkit/components/telemetry/moz-build.patch @@ -0,0 +1,22 @@ +diff --git a/toolkit/components/telemetry/moz.build b/toolkit/components/telemetry/moz.build +index baaddec36152f073ff76b3c5f8e0b6459a9f66b8..32c9d040ed95fcb68f27cbb38cb655da17708b05 100644 +--- a/toolkit/components/telemetry/moz.build ++++ b/toolkit/components/telemetry/moz.build +@@ -221,17 +221,7 @@ GeneratedFile( + inputs=event_files, + ) + +-# Generate the JSON event definitions. They will only be +-# used in artifact or "build faster" builds. +-GeneratedFile( +- "EventArtifactDefinitions.json", +- script="build_scripts/gen_event_data.py", +- entry_point="generate_JSON_definitions", +- inputs=event_files, +-) + +-# Move the events JSON file to the directory where the Firefox binary is. +-FINAL_TARGET_FILES += ["!EventArtifactDefinitions.json"] + + # Generate data from Processes.yaml + processes_files = [ From cfa03fe1f992aa19f9456f904abd97ed801e2ffb Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sun, 26 Jan 2025 13:40:31 +0100 Subject: [PATCH 027/318] Remove unused onThemePickerClick method from ZenGradientGenerator --- .../zen-components/ZenGradientGenerator.mjs | 45 ------------------- 1 file changed, 45 deletions(-) diff --git a/src/browser/base/zen-components/ZenGradientGenerator.mjs b/src/browser/base/zen-components/ZenGradientGenerator.mjs index e5b169004..8080d686a 100644 --- a/src/browser/base/zen-components/ZenGradientGenerator.mjs +++ b/src/browser/base/zen-components/ZenGradientGenerator.mjs @@ -246,51 +246,6 @@ } } - onThemePickerClick(event) { - event.preventDefault(); - if (event.button !== 0 || this.dragging) return; - const gradient = this.panel.querySelector('.zen-theme-picker-gradient'); - const rect = gradient.getBoundingClientRect(); - const padding = 90; // each side - - const centerX = rect.left + rect.width / 2; - const centerY = rect.top + rect.height / 2; - const radius = (rect.width - padding) / 2; - let pixelX = event.clientX; - let pixelY = event.clientY; - - // Check if the click is within the circle - const distance = Math.sqrt((pixelX - centerX) ** 2 + (pixelY - centerY) ** 2); - if (distance > radius) { - return; // Don't create a dot if clicking outside the circle - } - - // Check if we clicked on an existing dot - const clickedElement = event.target; - const isExistingDot = clickedElement.classList.contains('zen-theme-picker-dot'); - - // Only proceed if not clicking on an existing dot - if (!isExistingDot) { - const relativeX = event.clientX - rect.left; - const relativeY = event.clientY - rect.top; - - const color = this.getColorFromPosition(relativeX, relativeY); - - // Create new dot - const dot = document.createElement('div'); - dot.classList.add('zen-theme-picker-dot'); - dot.addEventListener('mousedown', this.onDotMouseDown.bind(this)); - - dot.style.left = `${relativeX}px`; - dot.style.top = `${relativeY}px`; - dot.style.setProperty('--zen-theme-picker-dot-color', `rgb(${color[0]}, ${color[1]}, ${color[2]})`); - - gradient.appendChild(dot); - - this.updateCurrentWorkspace(true); - } - } - onDotMouseDown(event) { event.preventDefault(); if (event.button === 2) { From 9c5ae70562b4532c24e3823ee672f008112e4942 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sun, 26 Jan 2025 14:06:50 +0100 Subject: [PATCH 028/318] Remove generation of ScalarArtifactDefinitions.json from telemetry build process --- .../components/telemetry/moz-build.patch | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/toolkit/components/telemetry/moz-build.patch b/src/toolkit/components/telemetry/moz-build.patch index 70d262dbf..7e3365335 100644 --- a/src/toolkit/components/telemetry/moz-build.patch +++ b/src/toolkit/components/telemetry/moz-build.patch @@ -1,8 +1,26 @@ diff --git a/toolkit/components/telemetry/moz.build b/toolkit/components/telemetry/moz.build -index baaddec36152f073ff76b3c5f8e0b6459a9f66b8..32c9d040ed95fcb68f27cbb38cb655da17708b05 100644 +index baaddec36152f073ff76b3c5f8e0b6459a9f66b8..d374d3688d829989d3e255e755320635dafacaa0 100644 --- a/toolkit/components/telemetry/moz.build +++ b/toolkit/components/telemetry/moz.build -@@ -221,17 +221,7 @@ GeneratedFile( +@@ -192,17 +192,7 @@ GeneratedFile( + inputs=scalar_files, + ) + +-# Generate the JSON scalar definitions. They will only be +-# used in artifact or "build faster" builds. +-GeneratedFile( +- "ScalarArtifactDefinitions.json", +- script="build_scripts/gen_scalar_data.py", +- entry_point="generate_JSON_definitions", +- inputs=scalar_files, +-) + +-# Move the scalars JSON file to the directory where the Firefox binary is. +-FINAL_TARGET_FILES += ["!ScalarArtifactDefinitions.json"] + + # Generate event files. + event_files = [ +@@ -221,17 +211,7 @@ GeneratedFile( inputs=event_files, ) From d9939ea9be80dec97db320fb857fc71fc7380c59 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sun, 26 Jan 2025 15:57:11 +0100 Subject: [PATCH 029/318] Refactor macOS build workflow to remove specific .app cleanup and delete unused telemetry build scripts --- .../macos-universal-release-build.yml | 5 ++- .../components/telemetry/moz-build.patch | 40 ------------------- 2 files changed, 3 insertions(+), 42 deletions(-) delete mode 100644 src/toolkit/components/telemetry/moz-build.patch diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index 9b3994248..2bab4ed7a 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -127,8 +127,9 @@ jobs: - name: Remove any existing .app folders run: | set -x - rm -rf "./obj-x86_64-apple-darwin/dist/zen/*.app" - rm -rf "./obj-aarch64-apple-darwin/dist/zen/*.app" + cd engine + rm -rf "./obj-x86_64-apple-darwin/dist/zen/${{ env.APP_NAME }}.app" + rm -rf "./obj-aarch64-apple-darwin/dist/zen/${{ env.APP_NAME }}.app" - name: Extract .app from dmg run: | diff --git a/src/toolkit/components/telemetry/moz-build.patch b/src/toolkit/components/telemetry/moz-build.patch deleted file mode 100644 index 7e3365335..000000000 --- a/src/toolkit/components/telemetry/moz-build.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/toolkit/components/telemetry/moz.build b/toolkit/components/telemetry/moz.build -index baaddec36152f073ff76b3c5f8e0b6459a9f66b8..d374d3688d829989d3e255e755320635dafacaa0 100644 ---- a/toolkit/components/telemetry/moz.build -+++ b/toolkit/components/telemetry/moz.build -@@ -192,17 +192,7 @@ GeneratedFile( - inputs=scalar_files, - ) - --# Generate the JSON scalar definitions. They will only be --# used in artifact or "build faster" builds. --GeneratedFile( -- "ScalarArtifactDefinitions.json", -- script="build_scripts/gen_scalar_data.py", -- entry_point="generate_JSON_definitions", -- inputs=scalar_files, --) - --# Move the scalars JSON file to the directory where the Firefox binary is. --FINAL_TARGET_FILES += ["!ScalarArtifactDefinitions.json"] - - # Generate event files. - event_files = [ -@@ -221,17 +211,7 @@ GeneratedFile( - inputs=event_files, - ) - --# Generate the JSON event definitions. They will only be --# used in artifact or "build faster" builds. --GeneratedFile( -- "EventArtifactDefinitions.json", -- script="build_scripts/gen_event_data.py", -- entry_point="generate_JSON_definitions", -- inputs=event_files, --) - --# Move the events JSON file to the directory where the Firefox binary is. --FINAL_TARGET_FILES += ["!EventArtifactDefinitions.json"] - - # Generate data from Processes.yaml - processes_files = [ From d3f14bd9c3c0048c4a0689434cb7db005693627a Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sun, 26 Jan 2025 19:54:03 +0100 Subject: [PATCH 030/318] Refactor macOS build workflows to unify artifact naming and update dependencies --- .github/workflows/build.yml | 5 +- .github/workflows/macos-release-build.yml | 18 +---- .../macos-universal-release-build.yml | 77 +++++++++---------- package.json | 2 +- pnpm-lock.yaml | 10 +-- 5 files changed, 49 insertions(+), 63 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 66c177bb3..ec3270619 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -560,12 +560,11 @@ jobs: linux-aarch64.mar windows.mar windows-arm64.mar - macos-x86_64.mar + macos.mar macos-aarch64.mar zen.installer.exe zen.installer-arm64.exe - zen.macos-x86_64.dmg - zen.macos-aarch64.dmg + zen.macos-universal.dmg automatic_release_tag: 'twilight' title: 'Twilight build - ${{ needs.build-data.outputs.version }} (${{ needs.build-data.outputs.build_date }} at ${{ needs.build-data.outputs.build_time }})' draft: false diff --git a/.github/workflows/macos-release-build.yml b/.github/workflows/macos-release-build.yml index 4e5b4ec1e..682109e7a 100644 --- a/.github/workflows/macos-release-build.yml +++ b/.github/workflows/macos-release-build.yml @@ -138,26 +138,16 @@ jobs: - name: Rename artifacts run: | - mv ./dist/output.mar macos-${{ matrix.arch }}.mar cd engine - echo "Tarballing dist..." - tar -czf zen-${{ matrix.arch }}-apple-darwin-dist.tar.gz ./obj-${{ matrix.arch }}-apple-darwin/dist/ - echo "Tarballing dist done" - mv zen-${{ matrix.arch }}-apple-darwin-dist.tar.gz ../ + echo "Tarballing DMG" + mv ./dist/zen-*.dmg ./zen-${{ matrix.arch }}-apple-darwin-dist.dmg - name: Upload dist dmg uses: actions/upload-artifact@v4 with: retention-days: 1 - name: zen-${{ matrix.arch }}-apple-darwin-dist.tar.gz - path: ./zen-${{ matrix.arch }}-apple-darwin-dist.tar.gz - - - name: Upload build artifact (.mar) - uses: actions/upload-artifact@v4 - with: - retention-days: 5 - name: macos-${{ matrix.arch }}.mar - path: ./macos-${{ matrix.arch }}.mar + name: zen-${{ matrix.arch }}-apple-darwin-dist.dmg + path: ./zen-${{ matrix.arch }}-apple-darwin-dist.dmg - name: Upload build artifact (update manifests) uses: actions/upload-artifact@v4 diff --git a/.github/workflows/macos-universal-release-build.yml b/.github/workflows/macos-universal-release-build.yml index 2bab4ed7a..e86311882 100644 --- a/.github/workflows/macos-universal-release-build.yml +++ b/.github/workflows/macos-universal-release-build.yml @@ -95,27 +95,37 @@ jobs: ./mach --no-interactive bootstrap --application-choice browser --no-system-changes cd .. - - name: Download x86_64 dist from artifacts + - name: Download x86_64 DMG from artifacts uses: actions/download-artifact@v4 with: - name: zen-x86_64-apple-darwin-dist.tar.gz + name: zen-x86_64-apple-darwin-dist.dmg - - name: Download aarch64 dist from artifacts + - name: Download aarch64 DMG from artifacts uses: actions/download-artifact@v4 with: - name: zen-aarch64-apple-darwin-dist.tar.gz + name: zen-aarch64-apple-darwin-dist.dmg - - name: Extract + - name: Remove any existing .app folders run: | - brew install gnu-tar - export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH - - mv ./zen-x86_64-apple-darwin-dist.tar.gz ./engine/ - mv ./zen-aarch64-apple-darwin-dist.tar.gz ./engine/ - + set -x cd engine - tar -xf ./zen-x86_64-apple-darwin-dist.tar.gz - tar -xf ./zen-aarch64-apple-darwin-dist.tar.gz + rm -rf "./obj-x86_64-apple-darwin/" || true + rm -rf "./obj-aarch64-apple-darwin/" || true + + - name: Extract .app from dmg + run: | + set -ex + cd engine + echo "Extracting x86_64 .app from dmg" + mkdir -p ./obj-x86_64-apple-darwin/dist + mkdir -p ./obj-aarch64-apple-darwin/dist + ./mach python -m mozbuild.action.unpack_dmg \ + ../zen-x86_64-apple-darwin-dist.dmg \ + ./obj-x86_64-apple-darwin/dist + echo "Extracting aarch64 .app from dmg" + ./mach python -m mozbuild.action.unpack_dmg \ + ../zen-aarch64-apple-darwin-dist.dmg \ + ./obj-aarch64-apple-darwin/dist - name: Find first .app folder name run: | @@ -124,26 +134,6 @@ jobs: echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV echo "APP_NAME=$APP_NAME" - - name: Remove any existing .app folders - run: | - set -x - cd engine - rm -rf "./obj-x86_64-apple-darwin/dist/zen/${{ env.APP_NAME }}.app" - rm -rf "./obj-aarch64-apple-darwin/dist/zen/${{ env.APP_NAME }}.app" - - - name: Extract .app from dmg - run: | - set -ex - cd engine - echo "Extracting x86_64 .app from dmg" - ./mach python -m mozbuild.action.unpack_dmg \ - ./obj-x86_64-apple-darwin/dist/zen*.dmg \ - ./obj-x86_64-apple-darwin/dist - echo "Extracting aarch64 .app from dmg" - ./mach python -m mozbuild.action.unpack_dmg \ - ./obj-aarch64-apple-darwin/dist/zen*.dmg \ - ./obj-aarch64-apple-darwin/dist - - name: List .app folders run: | ls engine/ @@ -181,8 +171,6 @@ jobs: - name: Unify architectures run: | cd engine - ls -la "./obj-x86_64-apple-darwin/dist/${{ env.APP_NAME }}.app/Contents" - ls -la "./obj-x86_64-apple-darwin/dist/${{ env.APP_NAME }}.app/Contents/MacOS" ./mach python "./toolkit/mozapps/installer/unify.py" "./obj-x86_64-apple-darwin/dist/${{ env.APP_NAME }}.app" "./obj-aarch64-apple-darwin/dist/${{ env.APP_NAME }}.app" echo "Merged aaarch64 into x86_64!" @@ -209,7 +197,7 @@ jobs: --background ./browser/branding/${{ inputs.release-branch }}/background.png \ --icon ./browser/branding/${{ inputs.release-branch }}/firefox.icns \ --dsstore ./browser/branding/${{ inputs.release-branch }}/dsstore \ - ./obj-x86_64-apple-darwin/dist/zen zen-macOS-universal-temp.dmg + ./obj-x86_64-apple-darwin/dist/zen ../zen-macOS-universal-temp.dmg - name: Sign .dmg run: | @@ -224,19 +212,28 @@ jobs: --wait xcrun stapler staple "zen.macos-universal.dmg" + - name: Package for mar + env: + JUST_MAR: true + run: | + export SURFER_PLATFORM="darwin" + export ZEN_RELEASE=1 + pnpm package + mv ./dist/output.mar ./macos.mar + - name: Upload build artifact uses: actions/upload-artifact@v4 with: retention-days: 5 - name: zen.macos-${{ matrix.arch }}.dmg - path: ./zen.macos-${{ matrix.arch }}.dmg + name: zen.macos-universal.dmg + path: ./zen.macos-universal.dmg - name: Upload build artifact (.mar) uses: actions/upload-artifact@v4 with: retention-days: 5 - name: macos-${{ matrix.arch }}.mar - path: ./macos-${{ matrix.arch }}.mar + name: macos.mar + path: ./macos.mar - name: Upload build artifact (update manifests) uses: actions/upload-artifact@v4 diff --git a/package.json b/package.json index 8a4de24d8..1e190e2cd 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ }, "homepage": "https://github.com/zen-browser/core#readme", "dependencies": { - "@zen-browser/surfer": "^1.9.10" + "@zen-browser/surfer": "^1.9.12" }, "devDependencies": { "husky": "^9.1.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c16dc387e..91cd80a9d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@zen-browser/surfer': - specifier: ^1.9.10 - version: 1.9.10(glob@7.2.3) + specifier: ^1.9.12 + version: 1.9.12(glob@7.2.3) devDependencies: husky: specifier: ^9.1.7 @@ -122,8 +122,8 @@ packages: '@types/node@17.0.45': resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} - '@zen-browser/surfer@1.9.10': - resolution: {integrity: sha512-0M95qvc1IPKed/4F4mCH5k+dadfRkaCpJJtyNHgMGEjlimueQ05M0fzJz9oS0KBR/k74tLB0H6MqWhx5h93BBg==} + '@zen-browser/surfer@1.9.12': + resolution: {integrity: sha512-58BWcC+xix9LKd9A2HNLOMD98yTKlH9ZftudxZDYDBkbMxOrqvCSr2d8QBX30n8Y3PZ3E8iSZtwti4+uV81XQw==} hasBin: true ansi-escapes@7.0.0: @@ -1036,7 +1036,7 @@ snapshots: '@types/node@17.0.45': {} - '@zen-browser/surfer@1.9.10(glob@7.2.3)': + '@zen-browser/surfer@1.9.12(glob@7.2.3)': dependencies: '@resvg/resvg-js': 1.4.0 async-icns: 1.0.2 From 462f354a9d660b76b6828f8707fd9e71f0ea0ea7 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sun, 26 Jan 2025 20:04:35 +0100 Subject: [PATCH 031/318] Removed panel ui button for macos users --- src/browser/app/profile/zen-browser.js | 3 +++ .../base/content/zen-styles/zen-tabs/vertical-tabs.css | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/browser/app/profile/zen-browser.js b/src/browser/app/profile/zen-browser.js index afd33a56f..0de4d8340 100644 --- a/src/browser/app/profile/zen-browser.js +++ b/src/browser/app/profile/zen-browser.js @@ -142,6 +142,9 @@ pref('zen.glance.activation-method', 'alt'); // ctrl, alt, shift, none, hold pref('zen.view.sidebar-height-throttle', 200); // in ms pref('zen.view.sidebar-expanded.max-width', 500); +#ifdef XP_MACOSX +pref('zen.view.mac.show-three-dot-menu', false); +#endif pref('zen.view.show-bottom-border', false); pref('zen.view.use-single-toolbar', true); pref('zen.view.sidebar-expanded', true); diff --git a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css index 984fd9a9e..3f02cf6d9 100644 --- a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css +++ b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css @@ -19,6 +19,12 @@ height: var(--zen-toolbar-height); } + @media (-moz-platform: macos) and (not (-moz-bool-pref: 'zen.view.mac.show-three-dot-menu')) { + &:not([customizing]) #PanelUI-button { + display: none; + } + } + & #zen-sidebar-top-buttons .toolbarbutton-1 { & > .toolbarbutton-icon { padding: 5px; From 405b2180cf796495c944e4aacd77d10d7dfa1ab7 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sun, 26 Jan 2025 21:36:09 +0100 Subject: [PATCH 032/318] Enable smooth scrolling in tabs and adjust tab height calculations for better UI responsiveness --- src/browser/app/profile/zen-browser.js | 2 +- src/browser/base/content/ZenStartup.mjs | 10 +++--- src/browser/base/content/ZenUIManager.mjs | 33 +++++++++++-------- .../content/navigator-toolbox-inc-xhtml.patch | 27 +++++++-------- .../zen-styles/zen-tabs/vertical-tabs.css | 24 ++++++++++---- .../base/content/zen-styles/zen-urlbar.css | 3 +- .../content/zen-styles/zen-workspaces.css | 1 + 7 files changed, 59 insertions(+), 41 deletions(-) diff --git a/src/browser/app/profile/zen-browser.js b/src/browser/app/profile/zen-browser.js index 0de4d8340..6753cad85 100644 --- a/src/browser/app/profile/zen-browser.js +++ b/src/browser/app/profile/zen-browser.js @@ -193,7 +193,7 @@ pref('zen.splitView.change-on-hover', false); pref('zen.splitView.rearrange-hover-size', 24); // Startup flags -pref('zen.startup.smooth-scroll-in-tabs', false); +pref('zen.startup.smooth-scroll-in-tabs', true); // Zen Workspaces pref('zen.workspaces.disabled_for_testing', false); diff --git a/src/browser/base/content/ZenStartup.mjs b/src/browser/base/content/ZenStartup.mjs index 363dababe..1d149308b 100644 --- a/src/browser/base/content/ZenStartup.mjs +++ b/src/browser/base/content/ZenStartup.mjs @@ -32,10 +32,12 @@ } // Disable smooth scroll - gBrowser.tabContainer.arrowScrollbox.smoothScroll = Services.prefs.getBoolPref( - 'zen.startup.smooth-scroll-in-tabs', - false - ); + if (!Services.prefs.getBoolPref('zen.startup.smooth-scroll-in-tabs', false)) { + gBrowser.tabContainer.addEventListener('wheel', (event) => { + event.preventDefault(); // Prevent the smooth scroll behavior + gBrowser.tabContainer.scrollTop += event.deltaY * 20; // Apply immediate scroll + }); + } gZenCompactModeManager.init(); ZenWorkspaces.init(); diff --git a/src/browser/base/content/ZenUIManager.mjs b/src/browser/base/content/ZenUIManager.mjs index bb1416956..82094366a 100644 --- a/src/browser/base/content/ZenUIManager.mjs +++ b/src/browser/base/content/ZenUIManager.mjs @@ -13,7 +13,7 @@ var gZenUIManager = { }); new ResizeObserver(gZenCommonActions.throttle(this.updateTabsToolbar.bind(this), this.sidebarHeightThrottle)).observe( - document.getElementById('tabbrowser-tabs') + document.getElementById('TabsToolbar') ); new ResizeObserver( @@ -26,20 +26,25 @@ var gZenUIManager = { updateTabsToolbar() { // Set tabs max-height to the "toolbar-items" height - const toolbarItems = document.getElementById('tabbrowser-tabs'); - const tabs = document.getElementById('tabbrowser-arrowscrollbox'); - tabs.style.maxHeight = '0px'; // reset to 0 - const toolbarRect = toolbarItems.getBoundingClientRect(); - let height = toolbarRect.height; - // -5 for the controls padding - let totalHeight = toolbarRect.height - this.contentElementSeparation * 2 - 5; - // remove the height from other elements that aren't hidden - const otherElements = document.querySelectorAll('#tabbrowser-tabs > *:not([hidden="true"])'); - for (let tab of otherElements) { - if (tabs === tab) continue; - totalHeight -= tab.getBoundingClientRect().height; + const tabs = document.getElementById('tabbrowser-tabs'); + // Remove tabs so we can accurately calculate the height + // without them affecting the height of the toolbar + for (const tab of gBrowser.tabs) { + if (tab.hasAttribute('zen-essential')) { + continue; + } + tab.style.maxHeight = '0px'; } - tabs.style.maxHeight = totalHeight + 'px'; + tabs.style.removeProperty('max-height'); + const toolbarRect = tabs.getBoundingClientRect(); + let height = toolbarRect.height; + for (const tab of gBrowser.tabs) { + if (tab.hasAttribute('zen-essential')) { + continue; + } + tab.style.maxHeight = height + 'px'; + } + tabs.style.maxHeight = height + 'px'; //console.info('ZenThemeModifier: set tabs max-height to', totalHeight + 'px'); }, diff --git a/src/browser/base/content/navigator-toolbox-inc-xhtml.patch b/src/browser/base/content/navigator-toolbox-inc-xhtml.patch index 26f8253e4..44cf0f9cd 100644 --- a/src/browser/base/content/navigator-toolbox-inc-xhtml.patch +++ b/src/browser/base/content/navigator-toolbox-inc-xhtml.patch @@ -1,5 +1,5 @@ diff --git a/browser/base/content/navigator-toolbox.inc.xhtml b/browser/base/content/navigator-toolbox.inc.xhtml -index 00391af141d9015fe5839534e5e6b22a91ba65d9..17d8ac96986e698b09033b870c24fc2f61c47a05 100644 +index 00391af141d9015fe5839534e5e6b22a91ba65d9..ee31d5f5116bc8f19f56fb868eceefea558659d6 100644 --- a/browser/base/content/navigator-toolbox.inc.xhtml +++ b/browser/base/content/navigator-toolbox.inc.xhtml @@ -2,7 +2,7 @@ @@ -29,23 +29,24 @@ index 00391af141d9015fe5839534e5e6b22a91ba65d9..17d8ac96986e698b09033b870c24fc2f