'ios') return true in ionic serve


I’m running ‘ionic serve’, then I’m trying to check if a user is running on android or ios so I do exactly as described here but the problem is that‘ios’) returns true in the browser (ionic serve). How can I know if I’m running on browser?


Change Device Mode on inspect element


If you want to know whether you are running in the browser or on a device, you could check for the negate of‘cordova’). I.e. something like this:

if(!'cordova')){ }


Thanks, this was my problem