Skip to main content
Solved

Change User agent in safari

  • August 23, 2015
  • 2 replies
  • 12 views

Forum|alt.badge.img+3

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.

Best answer by cdev

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

2 replies

cdev
Forum|alt.badge.img+14
  • Contributor
  • Answer
  • August 24, 2015

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

Forum|alt.badge.img+3
  • Author
  • New Contributor
  • August 24, 2015

Awesome. Exactly what I needed. Thank you