Change User agent in safari

aporzio1
New Contributor II

Does anybody know if there is a way to set firefox as the default user agent for safari.

I know I could do a default write to the safari plist. I just don't know what to write to it. Any help would be appreciated.

1 ACCEPTED SOLUTION

cdev
Contributor III

Yes, this is possible; to get things to report correctly, you'll need to get the exact string correct to mimic the proper browser version, e.g.:

defaults write com.apple.Safari CustomUserAgent ""Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:23.0) Gecko/20100101 Firefox/23.0""

That's the default Safari user agent for Firefox, but the defaults write command will set it for every session unless you manually select otherwise. To return to normal behavior, run:

defaults delete com.apple.Safari CustomUserAgent

View solution in original post

2 REPLIES 2

cdev
Contributor III

Yes, this is possible; to get things to report correctly, you'll need to get the exact string correct to mimic the proper browser version, e.g.:

defaults write com.apple.Safari CustomUserAgent ""Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:23.0) Gecko/20100101 Firefox/23.0""

That's the default Safari user agent for Firefox, but the defaults write command will set it for every session unless you manually select otherwise. To return to normal behavior, run:

defaults delete com.apple.Safari CustomUserAgent

aporzio1
New Contributor II

Awesome. Exactly what I needed. Thank you