The Safari App Store Hijack
One of the more jarring experiences when browsing the web on a Mac is clicking a link, only for macOS to violently pull you out of Safari and launch the Mac App Store. This usually happens when you click on a link to a software download, an iOS app review, or a specific Apple service. Developers use specific URL schemes (like macappstore://) to force this behavior, assuming you want to download the app immediately. However, if you are simply trying to read the app’s description on the web or if you clicked the link by accident, this automatic app switching is highly intrusive and disrupts your browsing session.
How to Prevent Automatic App Switching in Safari
Unfortunately, Apple does not provide a simple, system-wide toggle switch to prevent Safari from handing off links to the Mac App Store. Safari is hardcoded to obey these specific URL requests. However, you can use a hidden Terminal command to strip Safari’s permission to automatically launch external applications without asking you first.
1. Open the Terminal app (you can find it by pressing Command + Space and typing “Terminal”).
2. Copy and paste the following command exactly as written, then press Enter:
defaults write com.apple.Safari WebKitSecurityOriginExternalLinks -bool false
3. Completely quit and restart Safari.
After applying this command, Safari will become much more cautious. When a website attempts to redirect you to the Mac App Store, Safari should now pause and present a dialog box asking, “Do you want to allow this page to open ‘App Store’?” This gives you the power to click “Cancel” and remain in your browser.
How to Handle iOS App Links
If you are frequently redirected to the App Store when trying to view iOS (iPhone/iPad) apps on your Mac, there is a simple workaround to stay on the web.
When you see a link that you suspect will launch the App Store (often found on review sites or developer pages), do not left-click it. Instead, right-click (or Control-click) the link and select Open Link in New Tab. Alternatively, you can hold down the Command key while clicking the link. This forces Safari to load the URL in a background tab. While the App Store might still attempt to open momentarily, the web version of the App Store preview page will load in your browser, allowing you to read the information without being trapped in the native app.