Skip to content

Instantly share code, notes, and snippets.

@usagimaru
Last active November 17, 2023 11:37
Show Gist options
  • Save usagimaru/181377f6ef58d4238cf0fc8c2df34370 to your computer and use it in GitHub Desktop.
Save usagimaru/181377f6ef58d4238cf0fc8c2df34370 to your computer and use it in GitHub Desktop.
How to prohibit Google Chrome from adding itself to Login Items and notification banners on macOS.

Prohibit Google Chrome from adding itself to Login Items on macOS

TL;DR

Google Chrome behaves badly, registering itself in Login Items on every startup and trying to stay resident on the system. macOS Ventura and later systems have a system that notifies you when something is registered in Login Items, and when the condition is met, a notification banner appears. These appears every time we start up Google Chrome. This is the nightmare.

How macOS agents work

Login Items in macOS are based on a mechanism called LaunchAgents or LaunchDaemons. By registering information on programs to be launched at system startup in a plist file, background processes can be driven.

They are placed in either the */Library/LaunchAgents or */Library/LaunchDaemons directories.

Even if we remove the Login Items, they come back like zombies

It does not make sense for us to delete the plist file, as Chrome behaves as if it monitors Login Items and re-registers them if it does not find them. So I have adopted a method of manipulating access rights without denying the existence of Login Items. So far this has worked well.

How to do it

First, move to ~/Library/LaunchAgents/ and check the existence of the following two files:

~/Library/LaunchAgents/com.google.keystone.agent.plist
~/Library/LaunchAgents/com.google.keystone.xpcservice.plist

You may also look the plist file related to Google Updater, but we will only focus on the keystone-related plist files.

Next, change the permissions on these plist files to the no read/write flag. It's easy, just run the following commands with root privileges:

% sudo chmod 000 com.google.keystone.agent.plist
% sudo chmod 000 com.google.keystone.xpcservice.plist

Now that Google Chrome no longer has access to the plist files, both plist loading and regenerating are suppressed. Therefore, if you disable them in the Login Items pane of the System Settings, you will no longer see the depressing notification banners by Google Chrome. This is comfortable.

The side effect

This method has the side effect.

Updates via Google Chrome will no longer work, and users will have to obtain the update files manually from Google's website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment