radically simplify our mobile user agent detection

This commit is contained in:
Jeff Atwood 2016-03-26 02:02:23 -07:00
parent 1b4b361841
commit ac6d38ab34
1 changed files with 1 additions and 1 deletions

View File

@ -1,6 +1,6 @@
module MobileDetection module MobileDetection
def self.mobile_device?(user_agent) def self.mobile_device?(user_agent)
user_agent =~ /Mobile|Android|webOS/ && !(user_agent =~ /iPad|Nexus (9|10)/) user_agent =~ /Mobile/ && !(user_agent =~ /iPad/)
end end
# we need this as a reusable chunk that is called from the cache # we need this as a reusable chunk that is called from the cache