Get rid of aggressive Safari promotions in macOS

One of the new features of OS X “Yosemite” is the newRecommendSafariHandlerservice. To any web browser competing with Safari, this service doesn’t sound like a good thing.

CoreServices’UIAgent负责提供反馈的the system’s security features like the GateKeeper application signing verification and quarantining of downloaded files. New in Yosemite,UIAgentis also responsible for thedefault browser protection mechanismand the outright promotion of the Safari web browser. (Both of these are separate from the similarly soundingdefault browser helper plug-in.)

Notification promoting the Safari web browser in OS X
“Try the new Safari. Fast, energy-efficient, and with a beautiful new design.
[Later] [Try Now]”

The timing of the notification is worth noticing. The notifications show up as the user is launching the browser of any competitor to Safari. Clicking the Later button in the notification or just ignoring it will delay the notification for three days. The notification will then show up again and again until the user eventually agrees to click Try Now or learns to live with the notification.

Trying out Safari will not immediately change the default browser on the system. The user will, however, be asked upon quitting Safari to change their default to Safari. More on thislater.

Disabling the notification

烦人,通知不能从通知中心内禁用;因为它来自系统代理,而不是面向用户的应用程序。你可以,但是,仍然摆脱它。按照下面的说明禁用通知:

  1. Open Terminal (search for it on your Mac using Spotlight)
  2. 键入以下三个命令,然后按Enterafter each one
defaults write com.apple.coreservices.uiagent CSUIHasSafariBeenLaunched -bool YES defaults write com.apple.coreservices.uiagent CSUIRecommendSafariNextNotificationDate -date 2050-01-01T00:00:00Z defaults write com.apple.coreservices.uiagent CSUILastOSVersionWhereSafariRecommendationWasMade -float 10.99

Both commands should be silently accepted (no feedback is printed) and will take effect the next time the user logs in to the Mac.

The notification will possibly be used again in a future version of OS X and Safari. I can’t predict the future and whether Apple will continue using this mechanism. From their code, however, I can tell that everything is in place for future use. Assuming nothing changes, the second and third command listed above will disable future notifications until 2050.

Safari prompting to be default on exit

Every 18 hours or so, Safari may prompt you to set itself as the default browser as you quit Safari. This only happens when another browser is set as the default web browser. These dialogs can be annoying if you’ve already chosen another web browser as your preferred browser and just wanted to open something quickly in Safari for whatever reason.

Dialog prompting “Do you want to change your default browser?”
“Do you want to change your default browser to Safari or keep using a competing product? Your default browser opens when you click links in places like email messages, documents, and other apps.
[Keep Competitor] [Use Safari]”

Luckily, you can get rid of this dialog permanently by following a few quick steps:

  1. Quit Safari
  2. Open Terminal (search for it on your Mac using Spotlight)
  3. Type in the two commands below and pressEnterafter each one
defaults write com.apple.Safari DefaultBrowserDateOfLastPrompt -date '2050-01-01T00:00:00Z' defaults write com.apple.Safari DefaultBrowserPromptingState -int 2

The changes will apply the next time you open Safari. Assuming Apple’s methods remain the same, this should prevent Safari from prompting you about becoming the default browser until January in 2050.

Safari is being very aggressive about becoming the user’s default browser these days. Oddly enough, this is likely to only affect users who have consciously decided and made an effort to download and use a competing web browser. I’m not sure Apple has fully thought through this new aggressive recruiting method.