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
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\""
Yes... it's definitely possible!
The UA is just something the browser is sending (and can always be spoofed!)... with a little customization it can be changed, so a browser extension would naturally be able to do that.
精彩评论