Using the defaults write com.apple.Safari CustomUserAgent "\"My user agent string\"" command, you can set the default User Agent for Safari. This means that the CustomUserAgent key gets written in ~/Library/Preferences/com.apple.Safari.plist.

<string>My user agent string</string>

But how can you reverse this action? (Manually deleting the two rows from the plist doesn’t work, as they just get rewritten when Safari restarts.)

defaults delete com.apple.Safari CustomUserAgent

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .