I refactored this code by making just a couple of very basic tweaks...
- move all logic out of the conditional and into variables
- removed unnecessary syntax cruft from
isProxyBrowser - give the variables descriptive names
- further break down the logic (e.g. group the checks for 'cutting the mustard' and 'being a proxy based browser')
- reversed the
isProxyBasedlogic so it becomesisNotProxyBased(this meant we didn't cluttermodernDevicewith extra syntax and made it as readable as possible) - use selected variables within the conditional
Don't a few of those checks feel like things that should be extracted into methods?