Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vadikgo/10da5408ded6d5478fb58af979afbe37 to your computer and use it in GitHub Desktop.
Save vadikgo/10da5408ded6d5478fb58af979afbe37 to your computer and use it in GitHub Desktop.
Detect Electron apps on mac where the Electron hasn't yet been updated to fix the system wide lag

Electron Apps Causing System-Wide Lag on Tahoe

See:

Fixed versions:

  • 36.9.2
  • 37.6.0
  • 38.2.0
  • 39.0.0
  • and all above 39

This script detects apps with not yet updated versions of Electron.

Temporary workaround:

Run

launchctl setenv CHROME_HEADLESS 1

on every system start. The CHROME_HEADLESS flag has a side effect of disabling Electron app window shadows, which makes them ugly, but also stops triggering the issue.

Example output

(as of 1st oct 2025 - it lists all electron apps, but none shows the ✅ checkmark so far)

❌ OpenMTP.app: Electron 18.3.15 (Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework)
❌ DaVinci Resolve.app: Electron 36.3.2 (Contents/Applications/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework)
❌ Electron.app: Electron 36.3.2 (Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework)
❌ Visual Studio Code.app: Electron 37.3.1 (Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework)
❌ Cursor.app: Electron 34.5.8 (Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework)
❌ Windsurf.app: Electron 34.4.0 (Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework)
❌ Claude.app: Electron 36.4.0 (Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework)
❌ Signal.app: Electron 38.1.2 (Contents/Frameworks/Electron Framework.framework/Electron Framework)
❌ Figma Beta.app: Electron 37.5.1 (Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework)
❌ Beeper Desktop.app: Electron 33.2.0 (Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework)
❌ Slack.app: Electron 38.1.2 (Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework)

A bit of promo

If you'd appreciate a visual (Tufte-like) hour by hour forecast for iOS/Apple Watch/mac with nice widgets, I made one - check out 🌦️ Weathergraph.

Thanks! Tomas

# Directly detect Electron apps using the _cornerMask override - thanks avarayr!
# Needs ripgrep - brew install ripgrep
mdfind "kind:app" 2>/dev/null | while read app; do
electronFiles=$(find "$app" -name "Electron Framework" -type f 2>/dev/null)
if [[ -n "$electronFiles" ]]; then
appName=$(basename "$app")
while IFS= read -r filename; do
if [[ -f "$filename" ]]; then
ev=$(rg -a -m1 -o -r '$1' 'Chrome/.*Electron/([0-9]+(\.[0-9]+){1,3})' -- "$filename" 2>/dev/null)
[ -z "$ev" ] && ev=$(rg -a -m1 -o -r '$1' 'Electron/([0-9]+(\.[0-9]+){1,3})' -- "$filename" 2>/dev/null)
relativePath=$(echo "$filename" | sed "s|$app/||")
if rg -a -q -F "_cornerMask" -- "$filename" 2>/dev/null; then
echo -e "❌ $appName \033[2m(Electron ${ev:-unknown}) - $relativePath\033[0m"
else
echo -e "✅ $appName \033[2m(Electron ${ev:-unknown}) - $relativePath\033[0m"
fi
break
fi
done <<< "$electronFiles"
fi
done
# Detect affected Electron versions
mdfind "kMDItemFSName == '*.app'" 2>/dev/null | while read app; do
electronFiles=$(find "$app" -name "Electron Framework" -type f 2>/dev/null)
if [[ -n "$electronFiles" ]]; then
appName=$(basename "$app")
while IFS= read -r filename; do
electronVersion=$(strings "$filename" | grep "Chrome/" | grep -i Electron | grep -v '%s' | sort -u | cut -f 3 -d '/')
if [[ -n "$electronVersion" ]]; then
IFS='.' read -r major minor patch <<< "$electronVersion"
relativePath=$(echo "$filename" | sed "s|$app/||")
if [[ $major -gt 39 ]] || \
[[ $major -eq 39 && $minor -ge 0 ]] || \
[[ $major -eq 38 && $minor -gt 2 ]] || \
[[ $major -eq 38 && $minor -eq 2 && $patch -ge 0 ]] || \
[[ $major -eq 37 && $minor -gt 6 ]] || \
[[ $major -eq 37 && $minor -eq 6 && $patch -ge 0 ]] || \
[[ $major -eq 36 && $minor -gt 9 ]] || \
[[ $major -eq 36 && $minor -eq 9 && $patch -ge 2 ]]; then
echo "✅ $appName: Electron $electronVersion ($relativePath)"
else
echo "❌ $appName: Electron $electronVersion ($relativePath)"
fi
break
fi
done <<< "$electronFiles"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment