From 65cec7c29371f7836c9098cc74fd87d64264a4b9 Mon Sep 17 00:00:00 2001 From: Matti Schneider Date: Thu, 2 Jan 2020 15:12:19 +0100 Subject: [PATCH] Support containerized Safari See https://github.com/mathiasbynens/dotfiles/issues/849 --- init.sh | 6 ++++ session/osx-defaults.sh | 72 ++++++++++++++++++++--------------------- 2 files changed, 42 insertions(+), 36 deletions(-) diff --git a/init.sh b/init.sh index cc5733f..bd5c3a8 100755 --- a/init.sh +++ b/init.sh @@ -10,6 +10,12 @@ if [[ $machineAlreadySetUp != 'n' ]] then echo 'Nothing to do for the machine' else + echo "Before anything, you need to give Terminal and bash full disk access through System Preferences" + echo "See how to do this on " + echo "If requested to restart Terminal, accept it and relaunch this script" + echo "Quit System Preferences once you've set this up to continue" + open -W /System/Library/PreferencePanes/Security.prefPane + echo "Opening AppStore for manual install" open -a "App Store" diff --git a/session/osx-defaults.sh b/session/osx-defaults.sh index 88303ad..6a4b161 100755 --- a/session/osx-defaults.sh +++ b/session/osx-defaults.sh @@ -375,88 +375,88 @@ defaults write com.apple.dock wvous-bl-modifier -int 0 ############################################################################### # Privacy: don’t send search queries to Apple -defaults write com.apple.Safari UniversalSearchEnabled -bool false -defaults write com.apple.Safari SuppressSearchSuggestions -bool true +defaults write -app Safari UniversalSearchEnabled -bool false +defaults write -app Safari SuppressSearchSuggestions -bool true # Press Tab to highlight each item on a web page -#defaults write com.apple.Safari WebKitTabToLinksPreferenceKey -bool true -#defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks -bool true +#defaults write -app Safari WebKitTabToLinksPreferenceKey -bool true +#defaults write -app Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks -bool true # Show the full URL in the address bar (note: this still hides the scheme) -defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true +defaults write -app Safari ShowFullURLInSmartSearchField -bool true # Set Safari’s home page to `about:blank` for faster loading -defaults write com.apple.Safari HomePage -string "about:blank" +defaults write -app Safari HomePage -string "about:blank" # Prevent Safari from opening ‘safe’ files automatically after downloading -#defaults write com.apple.Safari AutoOpenSafeDownloads -bool false +defaults write -app Safari AutoOpenSafeDownloads -bool false # Allow hitting the Backspace key to go to the previous page in history -defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true +defaults write -app Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true # Hide Safari’s bookmarks bar by default -defaults write com.apple.Safari ShowFavoritesBar -bool false +defaults write -app Safari ShowFavoritesBar -bool false # Hide Safari’s sidebar in Top Sites -#defaults write com.apple.Safari ShowSidebarInTopSites -bool false +#defaults write -app Safari ShowSidebarInTopSites -bool false # Disable Safari’s thumbnail cache for History and Top Sites -defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2 +defaults write -app Safari DebugSnapshotsUpdatePolicy -int 2 # Enable Safari’s debug menu -defaults write com.apple.Safari IncludeInternalDebugMenu -bool true +defaults write -app Safari IncludeInternalDebugMenu -bool true # Make Safari’s search banners default to Contains instead of Starts With -defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false +defaults write -app Safari FindOnPageMatchesWordStartsOnly -bool false # Remove useless icons from Safari’s bookmarks bar -defaults write com.apple.Safari ProxiesInBookmarksBar "()" +defaults write -app Safari ProxiesInBookmarksBar "()" # Enable the Develop menu and the Web Inspector in Safari -defaults write com.apple.Safari IncludeDevelopMenu -bool true -defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true -defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true +defaults write -app Safari IncludeDevelopMenu -bool true +defaults write -app Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true +defaults write -app Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true # Add a context menu item for showing the Web Inspector in web views defaults write NSGlobalDomain WebKitDeveloperExtras -bool true # Enable continuous spellchecking -defaults write com.apple.Safari WebContinuousSpellCheckingEnabled -bool true +defaults write -app Safari WebContinuousSpellCheckingEnabled -bool true # Disable auto-correct -#defaults write com.apple.Safari WebAutomaticSpellingCorrectionEnabled -bool false +#defaults write -app Safari WebAutomaticSpellingCorrectionEnabled -bool false # Disable AutoFill -defaults write com.apple.Safari AutoFillFromAddressBook -bool false -#defaults write com.apple.Safari AutoFillPasswords -bool false -#defaults write com.apple.Safari AutoFillCreditCardData -bool false -#defaults write com.apple.Safari AutoFillMiscellaneousForms -bool false +defaults write -app Safari AutoFillFromAddressBook -bool false +#defaults write -app Safari AutoFillPasswords -bool false +#defaults write -app Safari AutoFillCreditCardData -bool false +#defaults write -app Safari AutoFillMiscellaneousForms -bool false # Warn about fraudulent websites -defaults write com.apple.Safari WarnAboutFraudulentWebsites -bool true +defaults write -app Safari WarnAboutFraudulentWebsites -bool true # Disable plug-ins -defaults write com.apple.Safari WebKitPluginsEnabled -bool false -defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2PluginsEnabled -bool false +defaults write -app Safari WebKitPluginsEnabled -bool false +defaults write -app Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2PluginsEnabled -bool false # Disable Java -defaults write com.apple.Safari WebKitJavaEnabled -bool false -defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabled -bool false +defaults write -app Safari WebKitJavaEnabled -bool false +defaults write -app Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabled -bool false # Block pop-up windows -defaults write com.apple.Safari WebKitJavaScriptCanOpenWindowsAutomatically -bool false -defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically -bool false +defaults write -app Safari WebKitJavaScriptCanOpenWindowsAutomatically -bool false +defaults write -app Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically -bool false # Disable auto-playing video -#defaults write com.apple.Safari WebKitMediaPlaybackAllowsInline -bool false -#defaults write com.apple.SafariTechnologyPreview WebKitMediaPlaybackAllowsInline -bool false -#defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false -#defaults write com.apple.SafariTechnologyPreview com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false +#defaults write -app Safari WebKitMediaPlaybackAllowsInline -bool false +#defaults write -app SafariTechnologyPreview WebKitMediaPlaybackAllowsInline -bool false +#defaults write -app Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false +#defaults write -app SafariTechnologyPreview com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false # Enable “Do Not Track” -defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true +defaults write -app Safari SendDoNotTrackHTTPHeader -bool true # Update extensions automatically -#defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool true +#defaults write -app Safari InstallExtensionUpdatesAutomatically -bool true ############################################################################### # Mail #