4

I have a Mac mini 2020 with an M1 processor and running macOS Big Sur.

On older macs I had this script to set Safari preferences

# Show status bar
defaults write com.apple.Safari ShowStatusBar -bool true
defaults write com.apple.Safari ShowOverlayStatusBar -bool true
# Show the full URL in the address bar (note: this still hides the scheme)
defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true
# Safari opens with: last session
defaults write com.apple.Safari AlwaysRestoreSessionAtLaunch -bool true
# Set Safari’s home page to `about:blank` for faster loading
defaults write com.apple.Safari HomePage -string "about:blank"
# Enable the Develop menu and the Web Inspector in Safari
defaults write com.apple.Safari IncludeDevelopMenu -bool true
# Enable Safari’s debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
# Update extensions automatically
defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool true
# Make Safari’s search banners default to Contains instead of Starts With
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
# Website use of location services
# 0 = Deny without prompting
# 1 = Prompt for each website once each day
# 2 = Prompt for each website one time only
defaults write com.apple.Safari SafariGeolocationPermissionPolicy -int 2

However, none of them seem to work anymore. Is there a new way to set similar preferences?

2
  • The subset of these that I use are working just fine, for me (new M1 MacBook Pro). Can you clarify what you mean by not working? Try defaults read com.apple.Safari > a.txt, then Safari > Settings > change something, then defaults read com.apple.Safari > b.txt and diff a.txt b.txt to see what's changing. If Safari is open then defaults write changes might not show up right away. Commented Jan 10, 2021 at 19:39
  • For me the settings are completely ignored Commented Jan 10, 2021 at 19:54

2 Answers 2

2

I had to enable Disk Access to terminal app (or in my case iTerm). Once access was granted all Safari settings were honored and persistent.

See this answer: How can I disable inline attachment previews (i.e. view as icon by default) in Mac Mail in macOS Mojave?

1
  • Thank you for sharing this!! This has been driving me mad!! I was wondering why I couldn't read or write anything from terminal, but sure enough, this setting did the trick! Once I granted access, I could read and write exactly as I needed. So now, I have to make sure that is the absolute first thing I do before doing any scripting. Thanks again! Commented Sep 24, 2022 at 7:05
1

The one for "Show Status Bar" is

defaults write com.apple.Safari ShowOverlayStatusBar -bool true

Found here along with others. https://gist.github.com/alanzeino/42b6d983c7aa2f29d64ea2749621f7cf

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .