From 00ee15236f7bbeea44f22e3a19b70c652f156481 Mon Sep 17 00:00:00 2001 From: Muko Date: Sat, 14 Sep 2024 12:08:05 +0700 Subject: [PATCH 01/13] Create appimageinstall.sh --- appimageinstall.sh | 174 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 appimageinstall.sh diff --git a/appimageinstall.sh b/appimageinstall.sh new file mode 100644 index 000000000..cd5725ac8 --- /dev/null +++ b/appimageinstall.sh @@ -0,0 +1,174 @@ +#!/bin/bash + +# Kawaii ASCII Art for the script +kawaii_art() { + echo "╔════════════════════════════════════════════════╗" + echo "║ ║" + echo "║ (ノ◕ヮ◕)ノ*:・゚✧ Zen Browser Installer ✧゚・:* ║" + echo "║ ║" + echo "╚════════════════════════════════════════════════╝" + echo +} + +# Function to download a file with unlimited retries +download_until_success() { + local url="$1" + local output_path="$2" + + while true; do + echo "+------------------------------------------------+" + echo "| Downloading... |" + echo "+------------------------------------------------+" + if curl -# -L --connect-timeout 30 --max-time 600 "$url" -o "$output_path"; then + echo "+------------------------------------------------+" + echo "| Download completed successfully! |" + echo "+------------------------------------------------+" + break + else + echo "| (⌣_⌣” ) Download failed, retrying... |" + echo "+------------------------------------------------+" + sleep 5 # Optional: wait a bit before retrying + fi + done +} + +process_appimage() { + local appimage_path="$1" + local app_name="$2" + + # Make AppImage executable + chmod +x "${appimage_path}" + + # Extract all files from AppImage + "${appimage_path}" --appimage-extract + + # Move .desktop file (from /squashfs-root only) + desktop_file=$(find squashfs-root -maxdepth 1 -name "*.desktop" | head -n 1) + mv "${desktop_file}" ~/.local/share/applications/${app_name}.desktop + + # Find PNG icon (from /squashfs-root only) + icon_file=$(find squashfs-root -maxdepth 1 -name "*.png" | head -n 1) + + # Resolve symlink if the icon is a symlink + if [ -L "${icon_file}" ]; then + icon_file=$(readlink -f "${icon_file}") + fi + + # Copy the icon to the icons directory + cp "${icon_file}" ~/.local/share/icons/${app_name}.png + + # Move AppImage to final location + mv "${appimage_path}" ~/.local/share/AppImage/ + + # Edit .desktop file to update paths + desktop_file=~/.local/share/applications/${app_name}.desktop + awk -v home="$HOME" -v app_name="$app_name" ' + BEGIN { in_action = 0 } + /^\[Desktop Action/ { in_action = 1 } + /^Exec=/ { + if (in_action) { + split($0, parts, "=") + sub(/^[^ ]+/, "", parts[2]) # Remove the first word (original command) + print "Exec=" home "/.local/share/AppImage/" app_name ".AppImage" parts[2] + } else { + print "Exec=" home "/.local/share/AppImage/" app_name ".AppImage" + } + next + } + /^Icon=/ { print "Icon=" home "/.local/share/icons/" app_name ".png"; next } + { print } + ' "${desktop_file}" > "${desktop_file}.tmp" && mv "${desktop_file}.tmp" "${desktop_file}" + + # Clean up extracted files + rm -rf squashfs-root +} + +uninstall_appimage() { + local app_name="$1" + + # Remove AppImage + rm -f ~/.local/share/AppImage/${app_name}.AppImage + + # Remove .desktop file + rm -f ~/.local/share/applications/${app_name}.desktop + + # Remove icon + rm -f ~/.local/share/icons/${app_name}.png + + echo "(︶︹︺) Uninstalled ${app_name}" +} + +choose_appimage_version() { + echo "(◕‿◕✿) Please choose the version to install:" + echo "+------------------------------------------------+" + echo "| 1) Optimized - Blazing fast and compatible |" + echo "| with modern devices |" + echo "+------------------------------------------------+" + echo "| 2) Generic - Slow but compatible with older |" + echo "| devices |" + echo "+------------------------------------------------+" + echo "| 3) Exit |" + echo "+------------------------------------------------+" + read -p "Enter your choice (1/2/3): " version_choice + + case $version_choice in + 1) + url=$(curl -s https://api.github.com/repos/zen-browser/desktop/releases/latest | grep "browser_download_url.*zen-specific.AppImage\"" | cut -d '"' -f 4) + download_until_success "$url" ~/Downloads/ZenBrowser.AppImage + process_appimage ~/Downloads/ZenBrowser.AppImage ZenBrowser + ;; + 2) + url=$(curl -s https://api.github.com/repos/zen-browser/desktop/releases/latest | grep "browser_download_url.*zen-generic.AppImage\"" | cut -d '"' -f 4) + download_until_success "$url" ~/Downloads/ZenBrowser.AppImage + process_appimage ~/Downloads/ZenBrowser.AppImage ZenBrowser + ;; + 3) + echo "(⌒‿⌒) Exiting..." + exit 0 + ;; + *) + echo "(•ˋ _ ˊ•) Invalid choice. Exiting..." + exit 1 + ;; + esac +} + +main_menu() { + echo "(★^O^★) What would you like to do?" + echo "+------------------------------------------------+" + echo "| 1) Install |" + echo "+------------------------------------------------+" + echo "| 2) Uninstall |" + echo "+------------------------------------------------+" + echo "| 3) Exit |" + echo "+------------------------------------------------+" + read -p "Enter your choice (1/2/3): " main_choice + + case $main_choice in + 1) + choose_appimage_version + ;; + 2) + uninstall_appimage ZenBrowser + ;; + 3) + echo "(⌒‿⌒) Exiting..." + exit 0 + ;; + *) + echo "(•ˋ _ ˊ•) Invalid choice. Exiting..." + exit 1 + ;; + esac +} + +# Create necessary directories +mkdir -p ~/.local/share/applications +mkdir -p ~/.local/share/icons +mkdir -p ~/.local/share/AppImage + +# Show kawaii ASCII art +kawaii_art + +# Execute the main menu +main_menu From f1c1169d42ed9a3ba19693e7b2d076e9d11c69e4 Mon Sep 17 00:00:00 2001 From: Muko Date: Sat, 14 Sep 2024 12:16:29 +0700 Subject: [PATCH 02/13] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 9bb3a8778..f3c5876ae 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,18 @@ You can also install Zen using Homebrew: brew install --cask zen-browser ``` +### Linux + +#### AppImage +``` +curl -sL https://github.com/Muko-Tabi/desktop/raw/main/appimageinstall.sh -o /tmp/appimageinstall.sh && bash /tmp/appimageinstall.sh && rm /tmp/appimageinstall.sh +``` + +#### Flatpak +``` +flatpak install flathub io.github.zen_browser.zen +``` + To upgrade the browser to a newer version, use the embedded update functionality in `About Zen`. # Core Components From cf6c72df08cc2dd14f9c83fe809417505e7b77fa Mon Sep 17 00:00:00 2001 From: Muko Date: Sat, 14 Sep 2024 12:51:17 +0700 Subject: [PATCH 03/13] Fix wrong link for AppImage script --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f3c5876ae..2ae27f270 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ brew install --cask zen-browser #### AppImage ``` -curl -sL https://github.com/Muko-Tabi/desktop/raw/main/appimageinstall.sh -o /tmp/appimageinstall.sh && bash /tmp/appimageinstall.sh && rm /tmp/appimageinstall.sh +curl -sL https://github.com/zen-browser/desktop/raw/main/appimageinstall.sh -o /tmp/appimageinstall.sh && bash /tmp/appimageinstall.sh && rm /tmp/appimageinstall.sh ``` #### Flatpak From 6508c86dca5a3b401265b7a2cb4e71104a6a43ca Mon Sep 17 00:00:00 2001 From: Muko Date: Sat, 14 Sep 2024 17:38:51 +0700 Subject: [PATCH 04/13] Add in Version Dectection, Update, and Status --- appimageinstall.sh | 223 +++++++++++++++++++++++++++++++++------------ 1 file changed, 167 insertions(+), 56 deletions(-) diff --git a/appimageinstall.sh b/appimageinstall.sh index cd5725ac8..a9b0e97a7 100644 --- a/appimageinstall.sh +++ b/appimageinstall.sh @@ -1,12 +1,58 @@ #!/bin/bash +# Function to check if AVX2 is supported +check_avx2_support() { + if grep -q avx2 /proc/cpuinfo; then + return 0 # AVX2 supported + else + return 1 # AVX2 not supported + fi +} + +# Function to check if Zen Browser is installed +check_installation_status() { + if [ -f ~/.local/share/AppImage/ZenBrowser.AppImage ]; then + return 0 # Zen Browser installed + else + return 1 # Zen Browser not installed + fi +} + +# Function to check if zsync is installed +check_zsync_installed() { + if command -v zsync &> /dev/null; then + return 0 # zsync is installed + else + return 1 # zsync is not installed + fi +} + # Kawaii ASCII Art for the script kawaii_art() { - echo "╔════════════════════════════════════════════════╗" - echo "║ ║" - echo "║ (ノ◕ヮ◕)ノ*:・゚✧ Zen Browser Installer ✧゚・:* ║" - echo "║ ║" - echo "╚════════════════════════════════════════════════╝" + echo "╔════════════════════════════════════════════════════╗" + echo "║ ║" + echo "║ (ノ◕ヮ◕)ノ*:・゚✧ Zen Browser Installer ✧゚・:* ║" + echo "║ ║" + + if check_avx2_support; then + echo "║ CPU: AVX2 Supported (Optimized Version) ║" + else + echo "║ CPU: AVX2 Not Supported (Generic Version) ║" + fi + + if check_installation_status; then + echo "║ Status: Zen Browser Installed ║" + else + echo "║ Status: Zen Browser Not Installed ║" + fi + + if check_zsync_installed; then + echo "║ zsync: Installed (Needed for Updates) ║" + else + echo "║ zsync: Not Installed (Needed for Updates) ║" + fi + + echo "╚════════════════════════════════════════════════════╝" echo } @@ -14,19 +60,51 @@ kawaii_art() { download_until_success() { local url="$1" local output_path="$2" + local mode="$3" # New parameter to indicate the mode while true; do - echo "+------------------------------------------------+" - echo "| Downloading... |" - echo "+------------------------------------------------+" + echo "+----------------------------------------------------+" + case "$mode" in + "zsync") + echo "| Checking for Update... |" + ;; + "update") + echo "| Updating... |" + ;; + "install") + echo "| Installing... |" + ;; + esac + echo "+----------------------------------------------------+" if curl -# -L --connect-timeout 30 --max-time 600 "$url" -o "$output_path"; then - echo "+------------------------------------------------+" - echo "| Download completed successfully! |" - echo "+------------------------------------------------+" + echo "+----------------------------------------------------+" + case "$mode" in + "zsync") + echo "| Checking for Update successfully! |" + ;; + "update") + echo "| Update completed successfully! |" + ;; + "install") + echo "| Install completed successfully! |" + ;; + esac + echo "+----------------------------------------------------+" break else - echo "| (⌣_⌣” ) Download failed, retrying... |" - echo "+------------------------------------------------+" + echo "+----------------------------------------------------+" + case "$mode" in + "zsync") + echo "| (⌣_⌣” ) Checking for Update failed, retrying... |" + ;; + "update") + echo "| (⌣_⌣” ) Update failed, retrying... |" + ;; + "install") + echo "| (⌣_⌣” ) Install failed, retrying... |" + ;; + esac + echo "+----------------------------------------------------+" sleep 5 # Optional: wait a bit before retrying fi done @@ -57,8 +135,10 @@ process_appimage() { # Copy the icon to the icons directory cp "${icon_file}" ~/.local/share/icons/${app_name}.png - # Move AppImage to final location - mv "${appimage_path}" ~/.local/share/AppImage/ + # Move AppImage to final location, only if it's not already there + if [ "${appimage_path}" != "$HOME/.local/share/AppImage/${app_name}.AppImage" ]; then + mv "${appimage_path}" ~/.local/share/AppImage/ + fi # Edit .desktop file to update paths desktop_file=~/.local/share/applications/${app_name}.desktop @@ -98,60 +178,91 @@ uninstall_appimage() { echo "(︶︹︺) Uninstalled ${app_name}" } -choose_appimage_version() { - echo "(◕‿◕✿) Please choose the version to install:" - echo "+------------------------------------------------+" - echo "| 1) Optimized - Blazing fast and compatible |" - echo "| with modern devices |" - echo "+------------------------------------------------+" - echo "| 2) Generic - Slow but compatible with older |" - echo "| devices |" - echo "+------------------------------------------------+" - echo "| 3) Exit |" - echo "+------------------------------------------------+" - read -p "Enter your choice (1/2/3): " version_choice +check_for_updates() { + local zsync_url + local zsync_file + local appimage_url - case $version_choice in - 1) - url=$(curl -s https://api.github.com/repos/zen-browser/desktop/releases/latest | grep "browser_download_url.*zen-specific.AppImage\"" | cut -d '"' -f 4) - download_until_success "$url" ~/Downloads/ZenBrowser.AppImage - process_appimage ~/Downloads/ZenBrowser.AppImage ZenBrowser - ;; - 2) - url=$(curl -s https://api.github.com/repos/zen-browser/desktop/releases/latest | grep "browser_download_url.*zen-generic.AppImage\"" | cut -d '"' -f 4) - download_until_success "$url" ~/Downloads/ZenBrowser.AppImage - process_appimage ~/Downloads/ZenBrowser.AppImage ZenBrowser - ;; - 3) - echo "(⌒‿⌒) Exiting..." - exit 0 - ;; - *) - echo "(•ˋ _ ˊ•) Invalid choice. Exiting..." - exit 1 - ;; - esac + if check_avx2_support; then + zsync_url="https://github.com/zen-browser/desktop/releases/latest/download/zen-specific.AppImage.zsync" + appimage_url="https://github.com/zen-browser/desktop/releases/latest/download/zen-specific.AppImage" + else + zsync_url="https://github.com/zen-browser/desktop/releases/latest/download/zen-generic.AppImage.zsync" + appimage_url="https://github.com/zen-browser/desktop/releases/latest/download/zen-generic.AppImage" + fi + + zsync_file="${HOME}/Downloads/zen-browser.AppImage.zsync" + + if check_installation_status; then + echo "Checking for updates..." + if ! check_zsync_installed; then + echo "( ͡° ʖ̯ ͡°) zsync is not installed. Please install zsync to enable update functionality." + return 1 + fi + download_until_success "$zsync_url" "$zsync_file" "zsync" + update_output=$(zsync -i ~/.local/share/AppImage/ZenBrowser.AppImage -o ~/.local/share/AppImage/ZenBrowser.AppImage "$zsync_file" 2>&1) + if echo "$update_output" | grep -q "verifying download...checksum matches OK"; then + local version + version="1.0.0-a.39" + echo "(。♥‿♥。) Zen Browser is up-to-date! Version: $version" + else + echo "Updating Zen Browser..." + download_until_success "$appimage_url" ~/.local/share/AppImage/ZenBrowser.AppImage "update" + process_appimage ~/.local/share/AppImage/ZenBrowser.AppImage ZenBrowser + echo "(。♥‿♥。) Zen Browser updated to version: 1.0.0-a.39!" + fi + rm -f "$zsync_file" + else + echo "( ͡° ʖ̯ ͡°) Zen Browser is not installed." + main_menu + fi +} + +install_zen_browser() { + local appimage_url + + if check_avx2_support; then + appimage_url="https://github.com/zen-browser/desktop/releases/latest/download/zen-specific.AppImage" + else + appimage_url="https://github.com/zen-browser/desktop/releases/latest/download/zen-generic.AppImage" + fi + + download_until_success "$appimage_url" ~/Downloads/ZenBrowser.AppImage "install" + process_appimage ~/Downloads/ZenBrowser.AppImage ZenBrowser + echo "(。♥‿♥。) Zen Browser installed successfully!" } main_menu() { echo "(★^O^★) What would you like to do?" - echo "+------------------------------------------------+" - echo "| 1) Install |" - echo "+------------------------------------------------+" - echo "| 2) Uninstall |" - echo "+------------------------------------------------+" - echo "| 3) Exit |" - echo "+------------------------------------------------+" - read -p "Enter your choice (1/2/3): " main_choice + echo "+----------------------------------------------------+" + echo "| 1) Install |" + echo "+----------------------------------------------------+" + echo "| 2) Uninstall |" + echo "+----------------------------------------------------+" + if check_zsync_installed; then + echo "| 3) Check for Updates |" + echo "+----------------------------------------------------+" + fi + echo "| 0) Exit |" + echo "+----------------------------------------------------+" + read -p "Enter your choice (0-3): " main_choice case $main_choice in 1) - choose_appimage_version + install_zen_browser ;; 2) uninstall_appimage ZenBrowser ;; 3) + if check_zsync_installed; then + check_for_updates + else + echo "(•ˋ _ ˊ•) Invalid choice. Exiting..." + exit 1 + fi + ;; + 0) echo "(⌒‿⌒) Exiting..." exit 0 ;; From b73f16f09a3c013a584bcfe91905bfcbdc2f56f7 Mon Sep 17 00:00:00 2001 From: Muko Date: Sat, 14 Sep 2024 17:40:13 +0700 Subject: [PATCH 05/13] Add in zsync requirement for Updating --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 2ae27f270..b448d28df 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,9 @@ brew install --cask zen-browser ### Linux #### AppImage + +- `zsync` is required for the Update feature of the script below + ``` curl -sL https://github.com/zen-browser/desktop/raw/main/appimageinstall.sh -o /tmp/appimageinstall.sh && bash /tmp/appimageinstall.sh && rm /tmp/appimageinstall.sh ``` From 329becfff6f90b27564f495d4c639a5115b8eb56 Mon Sep 17 00:00:00 2001 From: mauro-balades Date: Sun, 15 Sep 2024 09:07:12 +0200 Subject: [PATCH 06/13] Update @zen-browser/surfer to version 1.4.11 --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 1c181bcb7..d7b92e657 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ }, "homepage": "https://github.com/zen-browser/core#readme", "dependencies": { - "@zen-browser/surfer": "^1.4.10" + "@zen-browser/surfer": "^1.4.11" }, "devDependencies": { "husky": "^9.1.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ee6ba906e..807c13d75 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@zen-browser/surfer': - specifier: ^1.4.10 - version: 1.4.10 + specifier: ^1.4.11 + version: 1.4.11 devDependencies: husky: specifier: ^9.1.5 @@ -119,8 +119,8 @@ packages: '@types/node@17.0.45': resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} - '@zen-browser/surfer@1.4.10': - resolution: {integrity: sha512-ycncjECWX7uZh23bYxd9a6rnYfxQqw53EgUwDiYDSEuSOMtydYIg1+Rntra8DIM3DvFs56OH46xtLGSU2CJ+sw==} + '@zen-browser/surfer@1.4.11': + resolution: {integrity: sha512-n/B9Ik6yXiG/oJ1FkCbQrVDvM4oum4oN95ks2X7JmLQ5spQtOsz+nRzdhHuHlMrPsqqatkL3/2ryNlQL1tbQIg==} hasBin: true ansi-escapes@7.0.0: @@ -1003,7 +1003,7 @@ snapshots: '@types/node@17.0.45': {} - '@zen-browser/surfer@1.4.10': + '@zen-browser/surfer@1.4.11': dependencies: '@resvg/resvg-js': 1.4.0 async-icns: 1.0.2 From b9d343962fcd21b1bcbbdef99582de013b1afd94 Mon Sep 17 00:00:00 2001 From: mauro-balades Date: Sun, 15 Sep 2024 09:40:57 +0200 Subject: [PATCH 07/13] Update @zen-browser/surfer to version 1.4.12 Refactor build/winsign/sign.ps1 to download windows-x64-obj-generic Update subproject commit reference Fix sidebar flashing issue when in split view mode --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- src/browser/base/content/ZenUIManager.mjs | 3 ++- src/browser/base/content/zen-components | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index d7b92e657..87cb7a982 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ }, "homepage": "https://github.com/zen-browser/core#readme", "dependencies": { - "@zen-browser/surfer": "^1.4.11" + "@zen-browser/surfer": "^1.4.12" }, "devDependencies": { "husky": "^9.1.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 807c13d75..cb3efc394 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@zen-browser/surfer': - specifier: ^1.4.11 - version: 1.4.11 + specifier: ^1.4.12 + version: 1.4.12 devDependencies: husky: specifier: ^9.1.5 @@ -119,8 +119,8 @@ packages: '@types/node@17.0.45': resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} - '@zen-browser/surfer@1.4.11': - resolution: {integrity: sha512-n/B9Ik6yXiG/oJ1FkCbQrVDvM4oum4oN95ks2X7JmLQ5spQtOsz+nRzdhHuHlMrPsqqatkL3/2ryNlQL1tbQIg==} + '@zen-browser/surfer@1.4.12': + resolution: {integrity: sha512-bey4Jhsb0W0nXj/BBPAvaofXPiFFT47El4sNSLyUlWY+spq7cZ39/oJvfmOMEQFb5K5bXBQM1NmA99nZDEhWeA==} hasBin: true ansi-escapes@7.0.0: @@ -1003,7 +1003,7 @@ snapshots: '@types/node@17.0.45': {} - '@zen-browser/surfer@1.4.11': + '@zen-browser/surfer@1.4.12': dependencies: '@resvg/resvg-js': 1.4.0 async-icns: 1.0.2 diff --git a/src/browser/base/content/ZenUIManager.mjs b/src/browser/base/content/ZenUIManager.mjs index d567f87a0..40d87ef70 100644 --- a/src/browser/base/content/ZenUIManager.mjs +++ b/src/browser/base/content/ZenUIManager.mjs @@ -169,7 +169,8 @@ var gZenCompactModeManager = { flashSidebar() { let sidebar = document.getElementById('navigator-toolbox'); - if (sidebar.matches(':hover')) { + let tabPanels = document.getElementById('tabbrowser-tabpanels'); + if (sidebar.matches(':hover') || tabPanels.matches("[zen-split-view='true']")) { return; } if (this._flashSidebarTimeout) { diff --git a/src/browser/base/content/zen-components b/src/browser/base/content/zen-components index 4101126d5..7692662dd 160000 --- a/src/browser/base/content/zen-components +++ b/src/browser/base/content/zen-components @@ -1 +1 @@ -Subproject commit 4101126d541ba234c4b0892b19c7ddedadcffd95 +Subproject commit 7692662dd76d087ca905fa898273e0059a4dba92 From 41dd9b684eb58f27ea76422f81e4a5359a1d92b3 Mon Sep 17 00:00:00 2001 From: mauro-balades Date: Sun, 15 Sep 2024 10:58:33 +0200 Subject: [PATCH 08/13] Updated surfer --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 87cb7a982..0e0de4f81 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ }, "homepage": "https://github.com/zen-browser/core#readme", "dependencies": { - "@zen-browser/surfer": "^1.4.12" + "@zen-browser/surfer": "^1.4.13" }, "devDependencies": { "husky": "^9.1.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cb3efc394..29c7ad32c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@zen-browser/surfer': - specifier: ^1.4.12 - version: 1.4.12 + specifier: ^1.4.13 + version: 1.4.13 devDependencies: husky: specifier: ^9.1.5 @@ -119,8 +119,8 @@ packages: '@types/node@17.0.45': resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} - '@zen-browser/surfer@1.4.12': - resolution: {integrity: sha512-bey4Jhsb0W0nXj/BBPAvaofXPiFFT47El4sNSLyUlWY+spq7cZ39/oJvfmOMEQFb5K5bXBQM1NmA99nZDEhWeA==} + '@zen-browser/surfer@1.4.13': + resolution: {integrity: sha512-dPDullNjRx9dcnB/Di/EYmspgKvHsW8J5o1i1xQS6SgaDpqtYqTlaZGRWyYkfJvn+iIpgfrmKcoXYmor0okhdQ==} hasBin: true ansi-escapes@7.0.0: @@ -1003,7 +1003,7 @@ snapshots: '@types/node@17.0.45': {} - '@zen-browser/surfer@1.4.12': + '@zen-browser/surfer@1.4.13': dependencies: '@resvg/resvg-js': 1.4.0 async-icns: 1.0.2 From 8f7b8506a625f242d22a85a2621ca31937088ade Mon Sep 17 00:00:00 2001 From: mauro-balades Date: Sun, 15 Sep 2024 13:50:52 +0200 Subject: [PATCH 09/13] Fixed addon updates --- .vscode/settings.json | 10 +++++++++- l10n | 2 +- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- src/browser/app/profile/firefox-js.patch | 4 ++-- src/browser/base/content/zen-components | 2 +- src/toolkit/modules/AppConstants-sys-mjs.patch | 13 +++++++++++++ src/toolkit/modules/moz-build.patch | 12 ++++++++++++ src/toolkit/moz-configure.patch | 18 ++++++++++++++++-- .../extensions/AddonManager-sys-mjs.patch | 13 +++++++++++++ 10 files changed, 73 insertions(+), 13 deletions(-) create mode 100644 src/toolkit/modules/AppConstants-sys-mjs.patch create mode 100644 src/toolkit/modules/moz-build.patch create mode 100644 src/toolkit/mozapps/extensions/AddonManager-sys-mjs.patch diff --git a/.vscode/settings.json b/.vscode/settings.json index aea013817..a71c154eb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,6 +17,14 @@ "string": "cpp", "string_view": "cpp", "span": "cpp", - "vector": "cpp" + "vector": "cpp", + "charconv": "cpp", + "chrono": "cpp", + "optional": "cpp", + "format": "cpp", + "ratio": "cpp", + "system_error": "cpp", + "regex": "cpp", + "type_traits": "cpp" } } diff --git a/l10n b/l10n index 57a77d3dc..33a69b150 160000 --- a/l10n +++ b/l10n @@ -1 +1 @@ -Subproject commit 57a77d3dc93f11e771a11317f10a31e9f6a532c6 +Subproject commit 33a69b1500f90d860d13ec5cd92ee2effe409e7b diff --git a/package.json b/package.json index 0e0de4f81..35fac0e0e 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ }, "homepage": "https://github.com/zen-browser/core#readme", "dependencies": { - "@zen-browser/surfer": "^1.4.13" + "@zen-browser/surfer": "^1.4.14" }, "devDependencies": { "husky": "^9.1.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 29c7ad32c..0c8ef65c5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@zen-browser/surfer': - specifier: ^1.4.13 - version: 1.4.13 + specifier: ^1.4.14 + version: 1.4.14 devDependencies: husky: specifier: ^9.1.5 @@ -119,8 +119,8 @@ packages: '@types/node@17.0.45': resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} - '@zen-browser/surfer@1.4.13': - resolution: {integrity: sha512-dPDullNjRx9dcnB/Di/EYmspgKvHsW8J5o1i1xQS6SgaDpqtYqTlaZGRWyYkfJvn+iIpgfrmKcoXYmor0okhdQ==} + '@zen-browser/surfer@1.4.14': + resolution: {integrity: sha512-v8M8eSoHxduSETxRD1P9suLOzPm1c2vPXexTVXIAh+5Kzd+nHyOKpbjteSDcB3tL5W0s76nLb9WhwZShcxpT/A==} hasBin: true ansi-escapes@7.0.0: @@ -1003,7 +1003,7 @@ snapshots: '@types/node@17.0.45': {} - '@zen-browser/surfer@1.4.13': + '@zen-browser/surfer@1.4.14': dependencies: '@resvg/resvg-js': 1.4.0 async-icns: 1.0.2 diff --git a/src/browser/app/profile/firefox-js.patch b/src/browser/app/profile/firefox-js.patch index e39319d72..679b1e681 100644 --- a/src/browser/app/profile/firefox-js.patch +++ b/src/browser/app/profile/firefox-js.patch @@ -1,8 +1,8 @@ diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js -index b8aa71126c2bb4521caf25f9caf845a8a429dc64..59cdc2e9998e802d6c79ff967eaa30088a3b7a21 100644 +index a39a4f287ef843f7e0cdeac8320eeff81318116f..f84cdb85c249221522089667010d547cfab67819 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js -@@ -3110,3 +3110,5 @@ pref("toolkit.contentRelevancy.enabled", false); +@@ -3190,3 +3190,5 @@ pref("toolkit.contentRelevancy.enabled", false); pref("toolkit.contentRelevancy.ingestEnabled", false); // Pref to enable extra logging for the content relevancy feature pref("toolkit.contentRelevancy.log", false); diff --git a/src/browser/base/content/zen-components b/src/browser/base/content/zen-components index 7692662dd..64768bd51 160000 --- a/src/browser/base/content/zen-components +++ b/src/browser/base/content/zen-components @@ -1 +1 @@ -Subproject commit 7692662dd76d087ca905fa898273e0059a4dba92 +Subproject commit 64768bd518043029665f7cb914d5e801d1f20497 diff --git a/src/toolkit/modules/AppConstants-sys-mjs.patch b/src/toolkit/modules/AppConstants-sys-mjs.patch new file mode 100644 index 000000000..5ab1dfcfa --- /dev/null +++ b/src/toolkit/modules/AppConstants-sys-mjs.patch @@ -0,0 +1,13 @@ +diff --git a/toolkit/modules/AppConstants.sys.mjs b/toolkit/modules/AppConstants.sys.mjs +index a20e45c6135d24e42594700fe57184a560facd0f..7650dd88dc67d774c3af05704f2539ff92e21be2 100644 +--- a/toolkit/modules/AppConstants.sys.mjs ++++ b/toolkit/modules/AppConstants.sys.mjs +@@ -338,6 +338,8 @@ export var AppConstants = Object.freeze({ + MOZ_UPDATE_CHANNEL: "@MOZ_UPDATE_CHANNEL@", + MOZ_WIDGET_TOOLKIT: "@MOZ_WIDGET_TOOLKIT@", + ++ ZEN_FIREFOX_VERSION: "@ZEN_FIREFOX_VERSION@", ++ + DEBUG_JS_MODULES: "@DEBUG_JS_MODULES@", + + MOZ_BING_API_CLIENTID: "@MOZ_BING_API_CLIENTID@", diff --git a/src/toolkit/modules/moz-build.patch b/src/toolkit/modules/moz-build.patch new file mode 100644 index 000000000..822947a0a --- /dev/null +++ b/src/toolkit/modules/moz-build.patch @@ -0,0 +1,12 @@ +diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build +index 6ba1e92026f6f1618ce3a477f74bb6d0fa20f7c1..ccf3fa076771da7c9a5cb2bb732558cb73d810af 100644 +--- a/toolkit/modules/moz.build ++++ b/toolkit/modules/moz.build +@@ -281,6 +281,7 @@ for var in ( + "DLL_SUFFIX", + "DEBUG_JS_MODULES", + "OMNIJAR_NAME", ++ "ZEN_FIREFOX_VERSION" + ): + DEFINES[var] = CONFIG[var] or "" + diff --git a/src/toolkit/moz-configure.patch b/src/toolkit/moz-configure.patch index 037e9f032..a2b529500 100644 --- a/src/toolkit/moz-configure.patch +++ b/src/toolkit/moz-configure.patch @@ -1,8 +1,22 @@ diff --git a/toolkit/moz.configure b/toolkit/moz.configure -index dfef4ee7bd74a232f8f9eaa158303e59a2a32e62..77864261c8dbf2947738b97733553da67608c060 100644 +index 1f85d2831f2f71ebe4c7216bd604926d71e5189e..fb0d07554a592339f5a794151d953cb9269afd75 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure -@@ -905,9 +905,9 @@ set_define("MOZ_AV1", av1) +@@ -81,6 +81,13 @@ option( + ) + set_config("MOZ_INCLUDE_SOURCE_INFO", True, when="MOZ_INCLUDE_SOURCE_INFO") + ++option( ++ env="ZEN_FIREFOX_VERSION", ++ default="130.0", ++ help="Set the version of the browser", ++) ++set_config("ZEN_FIREFOX_VERSION", "130.0", when="ZEN_FIREFOX_VERSION") ++ + option( + "--with-distribution-id", + nargs=1, +@@ -905,9 +912,9 @@ set_define("MOZ_AV1", av1) option("--disable-jxl", help="Disable jxl image support") diff --git a/src/toolkit/mozapps/extensions/AddonManager-sys-mjs.patch b/src/toolkit/mozapps/extensions/AddonManager-sys-mjs.patch new file mode 100644 index 000000000..6c76c73d5 --- /dev/null +++ b/src/toolkit/mozapps/extensions/AddonManager-sys-mjs.patch @@ -0,0 +1,13 @@ +diff --git a/toolkit/mozapps/extensions/AddonManager.sys.mjs b/toolkit/mozapps/extensions/AddonManager.sys.mjs +index 2f855e6e48f420e3782d3be31cfdfa6c40db479b..911a6494812f0496ac928489244f2ac7bf0ed025 100644 +--- a/toolkit/mozapps/extensions/AddonManager.sys.mjs ++++ b/toolkit/mozapps/extensions/AddonManager.sys.mjs +@@ -1214,7 +1214,7 @@ var AddonManagerInternal = { + ITEM_VERSION: aAddon.version, + ITEM_STATUS: addonStatus, + APP_ID: Services.appinfo.ID, +- APP_VERSION: aAppVersion ? aAppVersion : Services.appinfo.version, ++ APP_VERSION: AppConstants.ZEN_FIREFOX_VERSION, + REQ_VERSION: UPDATE_REQUEST_VERSION, + APP_OS: Services.appinfo.OS, + APP_ABI: Services.appinfo.XPCOMABI, From a60816ee2aa3d1f9c914d48783da4d2987ce07ed Mon Sep 17 00:00:00 2001 From: mauro-balades Date: Sun, 15 Sep 2024 13:51:08 +0200 Subject: [PATCH 10/13] Update l10n submodule to commit 39b0110 --- l10n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n b/l10n index 33a69b150..39b011023 160000 --- a/l10n +++ b/l10n @@ -1 +1 @@ -Subproject commit 33a69b1500f90d860d13ec5cd92ee2effe409e7b +Subproject commit 39b011023d038fb8bb58eece6113919eb5c52770 From 7eebce2fded3306ef9c9da304029fe4a248cfb5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?mauro=20=F0=9F=A4=99?= <91018726+mauro-balades@users.noreply.github.com> Date: Sun, 15 Sep 2024 14:05:32 +0200 Subject: [PATCH 11/13] Delete appimageinstall.sh --- appimageinstall.sh | 285 --------------------------------------------- 1 file changed, 285 deletions(-) delete mode 100644 appimageinstall.sh diff --git a/appimageinstall.sh b/appimageinstall.sh deleted file mode 100644 index a9b0e97a7..000000000 --- a/appimageinstall.sh +++ /dev/null @@ -1,285 +0,0 @@ -#!/bin/bash - -# Function to check if AVX2 is supported -check_avx2_support() { - if grep -q avx2 /proc/cpuinfo; then - return 0 # AVX2 supported - else - return 1 # AVX2 not supported - fi -} - -# Function to check if Zen Browser is installed -check_installation_status() { - if [ -f ~/.local/share/AppImage/ZenBrowser.AppImage ]; then - return 0 # Zen Browser installed - else - return 1 # Zen Browser not installed - fi -} - -# Function to check if zsync is installed -check_zsync_installed() { - if command -v zsync &> /dev/null; then - return 0 # zsync is installed - else - return 1 # zsync is not installed - fi -} - -# Kawaii ASCII Art for the script -kawaii_art() { - echo "╔════════════════════════════════════════════════════╗" - echo "║ ║" - echo "║ (ノ◕ヮ◕)ノ*:・゚✧ Zen Browser Installer ✧゚・:* ║" - echo "║ ║" - - if check_avx2_support; then - echo "║ CPU: AVX2 Supported (Optimized Version) ║" - else - echo "║ CPU: AVX2 Not Supported (Generic Version) ║" - fi - - if check_installation_status; then - echo "║ Status: Zen Browser Installed ║" - else - echo "║ Status: Zen Browser Not Installed ║" - fi - - if check_zsync_installed; then - echo "║ zsync: Installed (Needed for Updates) ║" - else - echo "║ zsync: Not Installed (Needed for Updates) ║" - fi - - echo "╚════════════════════════════════════════════════════╝" - echo -} - -# Function to download a file with unlimited retries -download_until_success() { - local url="$1" - local output_path="$2" - local mode="$3" # New parameter to indicate the mode - - while true; do - echo "+----------------------------------------------------+" - case "$mode" in - "zsync") - echo "| Checking for Update... |" - ;; - "update") - echo "| Updating... |" - ;; - "install") - echo "| Installing... |" - ;; - esac - echo "+----------------------------------------------------+" - if curl -# -L --connect-timeout 30 --max-time 600 "$url" -o "$output_path"; then - echo "+----------------------------------------------------+" - case "$mode" in - "zsync") - echo "| Checking for Update successfully! |" - ;; - "update") - echo "| Update completed successfully! |" - ;; - "install") - echo "| Install completed successfully! |" - ;; - esac - echo "+----------------------------------------------------+" - break - else - echo "+----------------------------------------------------+" - case "$mode" in - "zsync") - echo "| (⌣_⌣” ) Checking for Update failed, retrying... |" - ;; - "update") - echo "| (⌣_⌣” ) Update failed, retrying... |" - ;; - "install") - echo "| (⌣_⌣” ) Install failed, retrying... |" - ;; - esac - echo "+----------------------------------------------------+" - sleep 5 # Optional: wait a bit before retrying - fi - done -} - -process_appimage() { - local appimage_path="$1" - local app_name="$2" - - # Make AppImage executable - chmod +x "${appimage_path}" - - # Extract all files from AppImage - "${appimage_path}" --appimage-extract - - # Move .desktop file (from /squashfs-root only) - desktop_file=$(find squashfs-root -maxdepth 1 -name "*.desktop" | head -n 1) - mv "${desktop_file}" ~/.local/share/applications/${app_name}.desktop - - # Find PNG icon (from /squashfs-root only) - icon_file=$(find squashfs-root -maxdepth 1 -name "*.png" | head -n 1) - - # Resolve symlink if the icon is a symlink - if [ -L "${icon_file}" ]; then - icon_file=$(readlink -f "${icon_file}") - fi - - # Copy the icon to the icons directory - cp "${icon_file}" ~/.local/share/icons/${app_name}.png - - # Move AppImage to final location, only if it's not already there - if [ "${appimage_path}" != "$HOME/.local/share/AppImage/${app_name}.AppImage" ]; then - mv "${appimage_path}" ~/.local/share/AppImage/ - fi - - # Edit .desktop file to update paths - desktop_file=~/.local/share/applications/${app_name}.desktop - awk -v home="$HOME" -v app_name="$app_name" ' - BEGIN { in_action = 0 } - /^\[Desktop Action/ { in_action = 1 } - /^Exec=/ { - if (in_action) { - split($0, parts, "=") - sub(/^[^ ]+/, "", parts[2]) # Remove the first word (original command) - print "Exec=" home "/.local/share/AppImage/" app_name ".AppImage" parts[2] - } else { - print "Exec=" home "/.local/share/AppImage/" app_name ".AppImage" - } - next - } - /^Icon=/ { print "Icon=" home "/.local/share/icons/" app_name ".png"; next } - { print } - ' "${desktop_file}" > "${desktop_file}.tmp" && mv "${desktop_file}.tmp" "${desktop_file}" - - # Clean up extracted files - rm -rf squashfs-root -} - -uninstall_appimage() { - local app_name="$1" - - # Remove AppImage - rm -f ~/.local/share/AppImage/${app_name}.AppImage - - # Remove .desktop file - rm -f ~/.local/share/applications/${app_name}.desktop - - # Remove icon - rm -f ~/.local/share/icons/${app_name}.png - - echo "(︶︹︺) Uninstalled ${app_name}" -} - -check_for_updates() { - local zsync_url - local zsync_file - local appimage_url - - if check_avx2_support; then - zsync_url="https://github.com/zen-browser/desktop/releases/latest/download/zen-specific.AppImage.zsync" - appimage_url="https://github.com/zen-browser/desktop/releases/latest/download/zen-specific.AppImage" - else - zsync_url="https://github.com/zen-browser/desktop/releases/latest/download/zen-generic.AppImage.zsync" - appimage_url="https://github.com/zen-browser/desktop/releases/latest/download/zen-generic.AppImage" - fi - - zsync_file="${HOME}/Downloads/zen-browser.AppImage.zsync" - - if check_installation_status; then - echo "Checking for updates..." - if ! check_zsync_installed; then - echo "( ͡° ʖ̯ ͡°) zsync is not installed. Please install zsync to enable update functionality." - return 1 - fi - download_until_success "$zsync_url" "$zsync_file" "zsync" - update_output=$(zsync -i ~/.local/share/AppImage/ZenBrowser.AppImage -o ~/.local/share/AppImage/ZenBrowser.AppImage "$zsync_file" 2>&1) - if echo "$update_output" | grep -q "verifying download...checksum matches OK"; then - local version - version="1.0.0-a.39" - echo "(。♥‿♥。) Zen Browser is up-to-date! Version: $version" - else - echo "Updating Zen Browser..." - download_until_success "$appimage_url" ~/.local/share/AppImage/ZenBrowser.AppImage "update" - process_appimage ~/.local/share/AppImage/ZenBrowser.AppImage ZenBrowser - echo "(。♥‿♥。) Zen Browser updated to version: 1.0.0-a.39!" - fi - rm -f "$zsync_file" - else - echo "( ͡° ʖ̯ ͡°) Zen Browser is not installed." - main_menu - fi -} - -install_zen_browser() { - local appimage_url - - if check_avx2_support; then - appimage_url="https://github.com/zen-browser/desktop/releases/latest/download/zen-specific.AppImage" - else - appimage_url="https://github.com/zen-browser/desktop/releases/latest/download/zen-generic.AppImage" - fi - - download_until_success "$appimage_url" ~/Downloads/ZenBrowser.AppImage "install" - process_appimage ~/Downloads/ZenBrowser.AppImage ZenBrowser - echo "(。♥‿♥。) Zen Browser installed successfully!" -} - -main_menu() { - echo "(★^O^★) What would you like to do?" - echo "+----------------------------------------------------+" - echo "| 1) Install |" - echo "+----------------------------------------------------+" - echo "| 2) Uninstall |" - echo "+----------------------------------------------------+" - if check_zsync_installed; then - echo "| 3) Check for Updates |" - echo "+----------------------------------------------------+" - fi - echo "| 0) Exit |" - echo "+----------------------------------------------------+" - read -p "Enter your choice (0-3): " main_choice - - case $main_choice in - 1) - install_zen_browser - ;; - 2) - uninstall_appimage ZenBrowser - ;; - 3) - if check_zsync_installed; then - check_for_updates - else - echo "(•ˋ _ ˊ•) Invalid choice. Exiting..." - exit 1 - fi - ;; - 0) - echo "(⌒‿⌒) Exiting..." - exit 0 - ;; - *) - echo "(•ˋ _ ˊ•) Invalid choice. Exiting..." - exit 1 - ;; - esac -} - -# Create necessary directories -mkdir -p ~/.local/share/applications -mkdir -p ~/.local/share/icons -mkdir -p ~/.local/share/AppImage - -# Show kawaii ASCII art -kawaii_art - -# Execute the main menu -main_menu From 6846b8398558affba7957c82ce09b86e8d46bdbf Mon Sep 17 00:00:00 2001 From: mauro-balades Date: Sun, 15 Sep 2024 14:06:26 +0200 Subject: [PATCH 12/13] Update appimage installation method --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b448d28df..3981acc7a 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ brew install --cask zen-browser - `zsync` is required for the Update feature of the script below ``` -curl -sL https://github.com/zen-browser/desktop/raw/main/appimageinstall.sh -o /tmp/appimageinstall.sh && bash /tmp/appimageinstall.sh && rm /tmp/appimageinstall.sh +curl -sL https://updates.zen-browser.app/appimage.sh | bash ``` #### Flatpak From 193e1598b049ad031e7e3f70784bf0f8513f4a7b Mon Sep 17 00:00:00 2001 From: mauro-balades Date: Sun, 15 Sep 2024 14:39:50 +0200 Subject: [PATCH 13/13] Update appimage installation method --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3981acc7a..a0c112610 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ brew install --cask zen-browser - `zsync` is required for the Update feature of the script below ``` -curl -sL https://updates.zen-browser.app/appimage.sh | bash +bash <(curl https://updates.zen-browser.app/appimage.sh) ``` #### Flatpak