mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
add support for other Nexus devices as "mobile"
This commit is contained in:
parent
3130dade49
commit
d052f1746c
@ -46,7 +46,7 @@ if defined?(Rack::MiniProfiler)
|
|||||||
Rack::MiniProfiler.config.pre_authorize_cb = lambda do |env|
|
Rack::MiniProfiler.config.pre_authorize_cb = lambda do |env|
|
||||||
path = env['PATH_INFO']
|
path = env['PATH_INFO']
|
||||||
|
|
||||||
(env['HTTP_USER_AGENT'] !~ /iPad|iPhone|Nexus 7|Android/) &&
|
(env['HTTP_USER_AGENT'] !~ /iPad|iPhone|Android/) &&
|
||||||
!skip.any?{|re| re =~ path}
|
!skip.any?{|re| re =~ path}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
module MobileDetection
|
module MobileDetection
|
||||||
def self.mobile_device?(user_agent)
|
def self.mobile_device?(user_agent)
|
||||||
user_agent =~ /Mobile|webOS|Nexus 7/ && !(user_agent =~ /iPad/)
|
user_agent =~ /Mobile|webOS|Nexus (5|6|7)/ && !(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
|
||||||
|
@ -37,7 +37,7 @@ class LogAnalyzer
|
|||||||
end
|
end
|
||||||
|
|
||||||
def is_mobile?
|
def is_mobile?
|
||||||
user_agent =~ /Mobile|webOS|Nexus 7/ && !(user_agent =~ /iPad/)
|
user_agent =~ /Mobile|webOS|Nexus (5|6|7)/ && !(user_agent =~ /iPad/)
|
||||||
end
|
end
|
||||||
|
|
||||||
def parsed_time
|
def parsed_time
|
||||||
|
Loading…
Reference in New Issue
Block a user