opa334 / SafariPlus

Tweak for iOS App "Safari" - Various enhancements

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Disable Google AMP through useragent modification

johnmarshall515 opened this issue · comments

It is possible to disable google amp by changing the user agent to an iPad one like the following while still retaining the mobile format of the google search:

Mozilla/5.0 (iPad; CPU OS 12_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1

So technically this is already possible, but changing the user agent in the tweak changes it globally which affects sites like ebay and github by displaying the desktop site.

It would be awesome to specify user agents on a per site basis to solve this issue or even go for a more user friendly approach by creating a toggle to turn google amp off that sets the user agent for google.com to the ipad one automatically.

While yes, it might be a good idea to implement site based user agents in the future (will think about it), the solution for your problem is much simpler, just use a non-iPad user agent that still disables AMP, the one I would recommend is

Mozilla/5.0 (iPhone; CPU OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/22.0 Mobile/15E148 Safari/605.1.15

Wow, worked great, thanks! Much simpler indeed. Out of curiosity, how does this work?

It's the user agent that Firefox uses on iOS, which makes it so that google doesn't use amp.