Use custom XUL binary on macOS (#4010)

Backports the following Mozilla fixes:

https://bugzilla.mozilla.org/show_bug.cgi?id=1858409
(AutoFill/Services menus; fixes #3927)

https://bugzilla.mozilla.org/show_bug.cgi?id=1884631
(sheets → dialogs; fixes #3936)

https://bugzilla.mozilla.org/show_bug.cgi?id=148624
(ghost tooltips, because why not)
This commit is contained in:
Dan Stillman 2024-04-19 07:04:42 -04:00 committed by GitHub
parent 1dbbb708a7
commit dfaa0ce129
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 1396 additions and 15 deletions

View file

@ -498,8 +498,8 @@ if [ $BUILD_MAC == 1 ]; then
xz -d --stdout "$CALLDIR/mac/zotero.xz" > "$CONTENTSDIR/MacOS/zotero"
chmod 755 "$CONTENTSDIR/MacOS/zotero"
# TEMP: Modified versions of some Firefox components for Big Sur, placed in xulrunner/MacOS
#cp "$MAC_RUNTIME_PATH/../MacOS/"{libc++.1.dylib,libnss3.dylib,XUL} "$CONTENTSDIR/MacOS/"
# TEMP: Custom version of XUL with some backported Mozilla bug fixes
cp "$MAC_RUNTIME_PATH/../MacOS/XUL" "$CONTENTSDIR/MacOS/"
# Use our own updater, because Mozilla's requires updates signed by Mozilla
cd "$CONTENTSDIR/MacOS"

View file

@ -7,7 +7,8 @@ GECKO_VERSION_WIN="115.9.1esr"
RUST_VERSION=1.69.0
# URL prefix for custom builds of Firefox components
custom_components_url="https://download.zotero.org/dev/"
custom_components_url="https://download.zotero.org/dev/firefox-components/"
custom_components_hash_mac="bec8e3adebf8d5021f1f35fd2c65d752d4979839cbdd1ee1aa4b1d3d5ba0953b"
APP_NAME="Zotero"
APP_ID="zotero\@zotero.org"

View file

@ -56,6 +56,9 @@ cp x64/$fx_app_name/Contents/MacOS/firefox zotero
xz zotero
mv zotero.xz "$APP_ROOT_DIR/mac/zotero.xz"
# TEMP: Copy a unified XUL for now
cp x64/$fx_app_name/Contents/MacOS/XUL "$APP_ROOT_DIR/mac/XUL"
# Uncomment to build updater
#cd x64/$fx_app_name/Contents/MacOS/
#"$APP_ROOT_DIR/mac/updater_renamer"

File diff suppressed because it is too large Load diff

View file

@ -355,6 +355,10 @@ function modify_omni {
}
popupset.appendChild(this._autoScrollPopup);' chrome/toolkit/content/global/elements/browser-custom-element.js
# Show Services menu on input fields
# (JS part of https://hg.mozilla.org/mozilla-central/rev/defc298879844981e7c1817f13e3fc2caf84f148 for input boxes)
replace_line '<menupopup class="textbox-contextmenu">' '<menupopup class="textbox-contextmenu" showservicesmenu="true">' chrome/toolkit/content/global/elements/moz-input-box.js
zip -qr9XD omni.ja *
mv omni.ja ..
cd ..
@ -409,18 +413,33 @@ if [ $BUILD_MAC == 1 ]; then
hdiutil detach -quiet /Volumes/Firefox
fi
# Download custom components
#echo
#rm -rf MacOS
#if [ -e "Firefox $GECKO_VERSION MacOS.zip" ]; then
# echo "Using Firefox $GECKO_VERSION MacOS.zip"
# unzip "Firefox $GECKO_VERSION MacOS.zip"
#else
# echo "Downloading Firefox $GECKO_VERSION MacOS.zip"
# curl -o MacOS.zip "${custom_components_url}Firefox%20$GECKO_VERSION%20MacOS.zip"
# unzip MacOS.zip
#fi
#echo
# Download custom components (e.g., XUL), as an xz-compressed tarball of the MacOS folder with
# custom files in it
echo
rm -rf MacOS
if [ -n "$custom_components_hash_mac" ]; then
if [ -e "Firefox $GECKO_VERSION MacOS.zip" ]; then
echo "Using Firefox $GECKO_VERSION MacOS.zip"
unzip "Firefox $GECKO_VERSION MacOS.zip"
else
echo "Downloading custom Firefox components"
echo
curl -o MacOS.tar.xz "${custom_components_url}mac/$custom_components_hash_mac.tar.xz"
# Verify hash
if [[ "`uname`" = "Darwin" ]]; then
shasum=sha256sum
else
shasum=shasum
fi
echo
echo "$custom_components_hash_mac MacOS.tar.xz" | $shasum -c -
echo
tar xvf MacOS.tar.xz
fi
echo
fi
pushd Firefox.app/Contents/Resources
modify_omni mac