Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

33355

macrumors newbie
Original poster
Sep 7, 2023
14
9
Most sites are fine at either 85% or 100% but some would really benefit from a 90% or 95% zoom so I'm not sure why that's not an option, it's so simple.
 
  • Like
Reactions: August West
edit: The following changes how Safari scales all websites via a style sheet. All zoom levels in Safari (be it 100%, 85% or 115%) additionally get scaled by the value set in the css file below. So if Safari zoom is left at 100%, the method allows for a custom percentage that gets applied to all websites.

Create a new text file with the file extension "css" (like "defaultzoom.css") and save it somewhere convenient like in you user folder.
Paste:
CSS:
body {
      zoom: 90%;
      }
In Safari go to Settings > Advanced > Style sheet and point to the previously saved css file.
At least that's how it used to work...
 
Last edited:
Create a new text file with the file extension "css". (like "defaultzoom.css")
Paste:
CSS:
body {
      zoom: 90%;
      }
In Safari go to Settings > Advanced > Style sheet and point to the previously saved css file.
Done
Does it apply to all sites or can you set it to a specific website?
 
The values set in Safari > Settings > Websites are saved in ~/Library/Safari/PerSiteZoomPreferences.plist and can be modified to 90% by replacing the set value with 0,9.
In will not appear as 90% in Websites, but from testing on a simple page like https://www.google.com/ the zoom is 90%.

Safari has two values: PageZoomFactor and TextZoomFactor. The shortcuts for the first are ⌘- and ⌘+, for the second ⌥⌘- and ⌥⌘+ (hold ⌥ in View menu)

Orion https://kagi.com/orion/, another WebKit browser, allows direct setting to 80% & 90%.
 
  • Like
Reactions: Slartibart and arw
In will not appear as 90% in Websites, (...)
Oh you are correct. I dismissed this method in the past as it always showed [50 %] in Safari after creating custom values.
But I never actually loaded a website. It does indeed respect the set value regardless of what it says in the settings menu.

Safari.Custom.Zoom.png
 
Last edited:
The values set in Safari > Settings > Websites are saved in ~/Library/Safari/PerSiteZoomPreferences.plist and can be modified to 90% by replacing the set value with 0,9.

Excuse my ignorance but is there a better way of editing the .plist file other than in text editor as it doesn't show clearly?
 
Excuse my ignorance but is there a better way of editing the .plist file other than in text editor as it doesn't show clearly?
I use PlistEdit Pro https://www.fatcatsoftware.com/plisteditpro/
Xcode can be used.
Or from Terminal:
Read the plist

Code:
/usr/libexec/PlistBuddy -c "Print" ~/Library/Safari/PerSiteZoomPreferences.plist

Read the value for one website (forums.macrumors.com)
Code:
/usr/libexec/PlistBuddy -c "Print :MapOfHostnamesToZoomPreferences:forums.macrumors.com:PageZoomFactor" ~/Library/Safari/PerSiteZoomPreferences.plist

Set to value to 90% (use 0.9 or 0,9 in accordance with the read value, your system setting for decimal separator)

Code:
 /usr/libexec/PlistBuddy -c "Set :MapOfHostnamesToZoomPreferences:forums.macrumors.com:PageZoomFactor 0,9" ~/Library/Safari/PerSiteZoomPreferences.plist
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.