A dialog box promting you to “try the new Safari” shown within a no-parking/forbidden sign. 🅭

Get rid of the annoying Safari notification ads in MacOS

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

CoreServices’ UIAgent is responsible for providing feedback for many of the system’s security features like the GateKeeper application signing verification and quarantining of downloaded files. New in Yosemite, UIAgent is also responsible for the default browser protection mechanism and the outright promotion of the Safari web browser. (Both of these are separate from the similarly sounding default 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 this later.

Disabling the notification

Annoyingly, the notifications can’t be disabled from within Notification Center; as it comes from a system agent and not a user-facing application. You can, however, still get rid of it. Follow the below instructions to disable the notification:

  1. Open Terminal (search for it on your Mac using Spotlight)
  2. Type in the three commands below and press Enter after 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 99.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. Note that this work-around will stop working in MacOS version 100! 😉

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 press Enter after 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.