Search code examples
javascriptcsssafarisafari-extension

Possible to spoof iPad UA in Safari through script?


I apologize if this question comes across as asinine, but is it possible to spoof the UA string of an iPad in Safari via a script of some sort?

I know it can be done through the Develop > User Agent menu item, but I am interested in making a Safari extension that forces a page that only serves HTML5 video to iPads to work without manually changing the UA every time.

Thank you


Solution

  • Not sure if this works on iOS, but this article might help you. Some of the comments are useful:

    defaults write com.apple.Safari CustomUserAgent "\"Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3\""