Here’s a step-by-step solution to prevent Safari’s sidebar from appearing when your cursor touches the left edge of the screen. Note that it has to be reapplied on restart.
(see Automated Solution for Safari Sidebar Auto-show Fix below for creating an app that automates these manual steps)
- First, move your Dock to the left side temporarily in System Settings > Desktop & Dock
- Open Terminal and run:
defaults write com.apple.Dock autohide-delay -float 1000 && killall Dock
-
Open Safari in fullscreen mode
-
Show the Dock (by moving cursor to left edge), while Safari is still visible on screen and in fullscreen mode (otherwise it won’t work)
-
Move the Dock back to your preferred position (bottom/right) by right clicking on the divider in the dock and selecting Position On Screen and your preferred position
To revert changes, run:
defaults delete com.apple.dock autohide-delay; killall Dock
Note:
- This solution works by exploiting the Dock’s edge detection behavior
- The Dock will still be accessible by:
- Moving your cursor to your preferred edge (bottom/right)
- Using Mission Control (four finger swipe up)
- The sidebar can still be toggled manually using Command + Shift + L
- Unfortunately, this solution does not persist after restarting the computer, therefore it would be nice to automate it…
Automated Solution for Safari Sidebar Auto-show Fix
I’ve created an AppleScript that automates the process of preventing Safari’s sidebar from auto-showing when your cursor touches the left edge of the screen. Here’s how to use it:
- Open Script Editor (find it in Applications > Utilities, or use Spotlight)
- Create a new script and paste this code:
on run
-- First move dock to left
tell application "System Events"
tell dock preferences
set screen edge to left
end tell
end tell
-- Set the crucial delay
do shell script "defaults write com.apple.Dock autohide-delay -float 1000; killall Dock"
delay 2
tell application "Safari"
activate
end tell
display notification "Make Safari fullscreen (Ctrl+Cmd+F)" with title "Step 1/2"
delay 5
display notification "Move cursor to left edge until Dock shows" with title "Step 2/2"
delay 5
-- Move dock back to bottom
tell application "System Events"
tell dock preferences
set screen edge to bottom
end tell
end tell
display notification "Fix complete! (Needs reapplying after restart)" with title "Done"
end run
-
Go to File > Export…
-
Choose these settings:
-
- Name it something like “SafariSidebarFix”
-
- Save Location: Applications folder
-
- Check “Show startup screen”
How to Use
- Double-click your newly created app
- Follow the notifications that appear
- That’s it!
How it Works
The script works by exploiting the Dock’s edge detection behavior. Here’s what it does:
- Moves the Dock to the left side
- Sets a very long delay for the Dock’s auto-show
- Launches Safari
- Guides you to make Safari fullscreen
- Has you trigger the Dock while Safari is visible
- Moves the Dock back to its original position
Note: You’ll need to run this again after restarting your Mac, as the setting doesn’t persist across restarts. A tip is to move the SafariSidebarFix app to the dock and perhaps give it a nice icon.
The script provides a simple, automated solution to what would otherwise be a manual process requiring multiple steps each time you restart your Mac.
To revert changes, run:
defaults delete com.apple.dock autohide-delay; killall Dock
