Skip to content

Commit

Permalink
FIX: Add Chromebook detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
nbianca committed May 30, 2019
1 parent 2548d5b commit 8196af1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 2 additions & 0 deletions app/serializers/concerns/user_auth_tokens_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def icon
case BrowserDetection.os(object.user_agent)
when :android
'fab-android'
when :chromeos
'fab-chrome'
when :macos, :ios
'fab-apple'
when :linux
Expand Down
16 changes: 9 additions & 7 deletions config/locales/server.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -745,28 +745,30 @@ en:
user_auth_tokens:
browser:
chrome: "Google Chrome"
safari: "Safari"
discoursehub: "DiscourseHub app"
edge: "Microsoft Edge"
firefox: "Firefox"
opera: "Opera"
ie: "Internet Explorer"
edge: "Microsoft Edge"
discoursehub: "DiscourseHub app"
opera: "Opera"
safari: "Safari"
unknown: "unknown browser"
device:
android: "Android Device"
chromebook: "Chromebook"
ipad: "iPad"
iphone: "iPhone"
ipod: "iPod"
mobile: "Mobile Device"
mac: "Mac"
linux: "GNU/Linux Computer"
mac: "Mac"
mobile: "Mobile Device"
windows: "Windows Computer"
unknown: "unknown device"
os:
android: "Android"
chromeos: "ChromeOS"
ios: "iOS"
macos: "macOS"
linux: "Linux"
macos: "macOS"
windows: "Microsoft Windows"
unknown: "unknown operating system"

Expand Down
4 changes: 4 additions & 0 deletions lib/browser_detection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def self.device(user_agent)
case user_agent
when /Android/i
:android
when /CrOS/i
:chromebook
when /iPad/i
:ipad
when /iPhone/i
Expand All @@ -50,6 +52,8 @@ def self.os(user_agent)
case user_agent
when /Android/i
:android
when /CrOS/i
:chromeos
when /iPhone|iPad|iPod/i
:ios
when /Macintosh/i
Expand Down
1 change: 1 addition & 0 deletions lib/svg_sprite/svg_sprite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ module SvgSprite
"external-link-alt",
"fab-android",
"fab-apple",
"fab-chrome",
"fab-discourse",
"fab-facebook-square",
"fab-facebook",
Expand Down

0 comments on commit 8196af1

Please sign in to comment.