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
isProxyBased
logic so it becomesisNotProxyBased
(this meant we didn't cluttermodernDevice
with extra syntax and made it as readable as possible) - use selected variables within the conditional