Switch browser User Agent automatically based on domain?

I’ve recently discovered that wiley.com (a big academic publisher) no longer lets you save PDFs in Safari…but if you open the site in Firefox or in Safari with user agent set to Firefox it works.

I just installed this Alfred workflow https://www.alfredforum.com/topic/10237-switchagent-—-switch-the-user-agent-for-your-frontmost-browser/ which works as expected but which requires manual intervention each time.

Does anyone know of an fully automated solution, i.e. that would switch my user agent to Firefox whenever I browse a URL in the wiley.com domain and switch it back to Safari’s default for all other sites?

I’m not aware of anything that would let you do it automatically, no.

You could assign a keyboard shortcut for it instead of using Alfred, which might save a little bit of typing, but not automatically. You’d almost need an extension for that.

I’m not aware of an app/automation that would switch the user agent automatically based on the URL, but there is a Mac app called Bumpr that, among other things, allows you to create rules to specify which browser is used for specific domains.

This would, however, mean that you’d need multiple browsers installed and that you wouldn’t be using Safari when you browse the wiley.com domain…so this solution may not fit the bill.

It may be possible to accomplish automatic switching of the user agent using Keyboard Maestro, perhaps triggering on the name of the focused window. You would also need a macro to switch it back when the window doesn’t reference Wiley.

I hope this helps!

Thanks - I think I’ll stick with the Alfred workflow for a while and see if it gets too annoying…

1 Like