Last active
July 12, 2026 12:11
-
-
Save anxkhn/cb2f1c3e5fa82908a264fd04c220331d to your computer and use it in GitHub Desktop.
Brave Origin macOS setup and policy script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e | |
| ############################################################################### | |
| # BRAVE ORIGIN - Complete debloat & speed fix + icon swap | |
| # Platform: macOS | |
| # Usage: chmod +x setup_mac.sh && sudo ./setup_mac.sh | |
| # Icon: Place BO.png in same folder (optional) | |
| # Verif: brave://policy | |
| ############################################################################### | |
| echo "==========================================" | |
| echo " Brave Origin - macOS Setup" | |
| echo " ☕ buymeacoffee.com/AilieIsQueen" | |
| echo "==========================================" | |
| echo "" | |
| # --- Detect which channel is installed --- | |
| BRAVE_BUNDLE="" | |
| BROWSER="Brave Browser" | |
| if [ -d "/Applications/Brave Browser.app" ]; then | |
| BRAVE_BUNDLE="com.brave.Browser" | |
| elif [ -d "/Applications/Brave Browser Beta.app" ]; then | |
| BRAVE_BUNDLE="com.brave.Browser.beta" | |
| BROWSER="Brave Browser Beta" | |
| elif [ -d "/Applications/Brave Browser Nightly.app" ]; then | |
| BRAVE_BUNDLE="com.brave.Browser.nightly" | |
| BROWSER="Brave Browser Nightly" | |
| else | |
| echo "[!] Brave Browser not found in /Applications." | |
| exit 1 | |
| fi | |
| echo "[*] Detected: $BROWSER ($BRAVE_BUNDLE)" | |
| # --- Setup managed preferences --- | |
| MANAGED_PREFS_DIR="/Library/Managed Preferences" | |
| if [ ! -d "$MANAGED_PREFS_DIR" ]; then | |
| sudo mkdir -p "$MANAGED_PREFS_DIR" | |
| sudo chown root:wheel "$MANAGED_PREFS_DIR" | |
| sudo chmod 755 "$MANAGED_PREFS_DIR" | |
| fi | |
| # --- Apply policies --- | |
| echo "[1] Deploying system policies..." | |
| write_policy() { | |
| local key="$1" | |
| local type="$2" | |
| local val="$3" | |
| sudo /usr/libexec/PlistBuddy -c "Add :$key $type $val" /Library/Managed\ Preferences/$BRAVE_BUNDLE.plist 2>/dev/null || \ | |
| sudo /usr/libexec/PlistBuddy -c "Set :$key $val" /Library/Managed\ Preferences/$BRAVE_BUNDLE.plist | |
| } | |
| POLICY_FILE="/Library/Managed Preferences/$BRAVE_BUNDLE.plist" | |
| if ! sudo plutil -lint "$POLICY_FILE" >/dev/null 2>&1; then | |
| sudo rm -f "$POLICY_FILE" | |
| sudo /usr/libexec/PlistBuddy -c "Clear dict" "$POLICY_FILE" >/dev/null | |
| fi | |
| write_policy "BraveRewardsDisabled" bool true | |
| write_policy "BraveWalletDisabled" bool true | |
| write_policy "BraveVPNDisabled" bool true | |
| write_policy "BraveAIChatEnabled" bool false | |
| write_policy "BraveNewsDisabled" bool true | |
| write_policy "BraveTalkDisabled" bool true | |
| write_policy "TorDisabled" bool true | |
| write_policy "BraveSpeedreaderEnabled" bool false | |
| write_policy "BraveWaybackMachineEnabled" bool false | |
| write_policy "BravePlaylistEnabled" bool false | |
| write_policy "BraveP3AEnabled" bool false | |
| write_policy "BraveStatsPingEnabled" bool false | |
| write_policy "BraveWebDiscoveryEnabled" bool false | |
| write_policy "SyncDisabled" bool true | |
| write_policy "BackgroundModeEnabled" bool false | |
| write_policy "MetricsReportingEnabled" bool false | |
| write_policy "ComponentUpdatesEnabled" bool true | |
| write_policy "HighEfficiencyModeEnabled" bool true | |
| write_policy "DnsOverHttpsMode" string "secure" | |
| write_policy "DnsOverHttpsTemplates" string "https://dns.adguard-dns.com/dns-query" | |
| write_policy "SafeBrowsingProtectionLevel" integer 2 | |
| write_policy "AlternateErrorPagesEnabled" bool false | |
| write_policy "NetworkPredictionOptions" integer 0 | |
| write_policy "PrivacySandboxAdTopicsEnabled" bool false | |
| write_policy "PrivacySandboxPromptEnabled" bool false | |
| write_policy "PrivacySandboxSiteEnabledAdsEnabled" bool false | |
| write_policy "PaymentMethodQueryEnabled" bool false | |
| write_policy "UserFeedbackAllowed" bool false | |
| write_policy "SearchSuggestEnabled" bool false | |
| write_policy "SpellcheckEnabled" bool false | |
| write_policy "HttpsUpgradesEnabled" bool true | |
| write_policy "PasswordManagerEnabled" bool false | |
| write_policy "AutofillAddressEnabled" bool false | |
| write_policy "AutofillCreditCardEnabled" bool false | |
| write_policy "TranslateEnabled" bool false | |
| write_policy "DeveloperToolsAvailability" integer 0 | |
| write_policy "IncognitoModeAvailability" integer 0 | |
| write_policy "BrowserAddPersonEnabled" bool false | |
| write_policy "BrowserGuestModeEnabled" bool false | |
| write_policy "DefaultBrowserSettingEnabled" bool false | |
| write_policy "BookmarkBarEnabled" bool false | |
| write_policy "ShowHomeButton" bool false | |
| write_policy "HomepageLocation" string "about:blank" | |
| write_policy "NewTabPageLocation" string "about:blank" | |
| write_policy "DefaultSearchProviderEnabled" bool true | |
| write_policy "DefaultSearchProviderName" string "Brave Search" | |
| write_policy "DefaultSearchProviderSearchURL" string "https://search.brave.com/search?q={searchTerms}" | |
| write_policy "DownloadRestrictions" integer 0 | |
| write_policy "PromptForDownloadLocation" bool true | |
| write_policy "PrintingEnabled" bool true | |
| sudo /usr/libexec/PlistBuddy -c "Save" "/Library/Managed Preferences/$BRAVE_BUNDLE.plist" 2>/dev/null | |
| sudo chown root:wheel "/Library/Managed Preferences/$BRAVE_BUNDLE.plist" 2>/dev/null | |
| sudo chmod 644 "/Library/Managed Preferences/$BRAVE_BUNDLE.plist" 2>/dev/null | |
| sudo killall cfprefsd 2>/dev/null || true | |
| echo " -> Policies applied to $BRAVE_BUNDLE" | |
| # --- 2. Create Brave Origin launcher app --- | |
| echo "[2] Creating Brave Origin launcher app..." | |
| LAUNCHER_APP="$HOME/Applications/Brave Origin.app" | |
| mkdir -p "$LAUNCHER_APP/Contents/MacOS" | |
| mkdir -p "$LAUNCHER_APP/Contents/Resources" | |
| cat > "$LAUNCHER_APP/Contents/MacOS/Brave Origin" << 'LAUNCHER_EOF' | |
| #!/bin/bash | |
| BROWSER_APP="" | |
| for app in "/Applications/Brave Browser.app" "/Applications/Brave Browser Beta.app" "/Applications/Brave Browser Nightly.app"; do | |
| if [ -d "$app" ]; then | |
| BROWSER_APP="$app" | |
| break | |
| fi | |
| done | |
| exec "$BROWSER_APP/Contents/MacOS/$(basename "$BROWSER_APP" .app)" \ | |
| --disable-features=AIChat,BraveVPN \ | |
| --enable-features=HighEfficiencyMode \ | |
| "$@" | |
| LAUNCHER_EOF | |
| chmod +x "$LAUNCHER_APP/Contents/MacOS/Brave Origin" | |
| cat > "$LAUNCHER_APP/Contents/Info.plist" << PLIST_EOF | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>CFBundleExecutable</key> | |
| <string>Brave Origin</string> | |
| <key>CFBundleIdentifier</key> | |
| <string>com.brave.origin</string> | |
| <key>CFBundleName</key> | |
| <string>Brave Origin</string> | |
| <key>CFBundlePackageType</key> | |
| <string>APPL</string> | |
| <key>CFBundleIconFile</key> | |
| <string>app</string> | |
| </dict> | |
| </plist> | |
| PLIST_EOF | |
| echo "" | |
| echo "==========================================" | |
| echo " DONE" | |
| echo " ☕ buymeacoffee.com/AilieIsQueen" | |
| echo "==========================================" | |
| echo "" | |
| echo "Open 'Brave Origin' from your Applications folder" | |
| echo "(instead of normal Brave) for the flags to take effect." | |
| echo "" | |
| echo "Manual steps (do once in Brave):" | |
| echo "" | |
| echo " brave://flags/#brave-sidebar -> Disabled" | |
| echo " brave://flags/#enable-zero-copy -> Enabled" | |
| echo " brave://flags/#enable-parallel-downloading -> Enabled" | |
| echo " brave://settings/appearance -> Use system title bar and borders ON" | |
| echo " brave://settings/system -> Memory Saver ON" | |
| echo "" | |
| echo "Verify: brave://policy" | |
| echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment