From 6fb7203f747893f9807dc06123fd4a994a5e76df Mon Sep 17 00:00:00 2001 From: Tyler True Date: Sun, 28 Feb 2021 01:41:00 -0500 Subject: [PATCH 1/3] Add ChromeOS support Adds CrOS to defaultPlatform frontmatter, as Linux. --- javascripts/display-platform-specific-content.js | 1 + javascripts/user-agent.js | 1 + 2 files changed, 2 insertions(+) diff --git a/javascripts/display-platform-specific-content.js b/javascripts/display-platform-specific-content.js index 0e7035eba51a..841d1cbdae6c 100644 --- a/javascripts/display-platform-specific-content.js +++ b/javascripts/display-platform-specific-content.js @@ -12,6 +12,7 @@ export default function displayPlatformSpecificContent () { if (platform === 'darwin') platform = 'mac' if (platform === 'ios') platform = 'mac' if (platform === 'android') platform = 'linux' + if (platform === 'cros') platform = 'linux' if (platform.startsWith('win')) platform = 'windows' const platformsInContent = findPlatformSpecificContent(platform) diff --git a/javascripts/user-agent.js b/javascripts/user-agent.js index 659dd1a66d36..2f76724992d3 100644 --- a/javascripts/user-agent.js +++ b/javascripts/user-agent.js @@ -6,6 +6,7 @@ const OS_REGEXPS = [ /(mac) os x ([^);]+)/i, /(windows) ([^);]+)/i, /(android) ([^);]+)/i, + /(cros) ([^);]+)/i, /(linux) ([^);]+)/i ] From 438a80830296b26cb0334da2ed0f3453f417fb72 Mon Sep 17 00:00:00 2001 From: Kevin Heis Date: Wed, 17 Mar 2021 08:44:55 -0700 Subject: [PATCH 2/3] Update schema-event.js --- lib/schema-event.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/schema-event.js b/lib/schema-event.js index fbb37060f260..021465007a70 100644 --- a/lib/schema-event.js +++ b/lib/schema-event.js @@ -83,7 +83,7 @@ const context = { browser: { type: 'string', description: 'The type of browser the user is browsing with.', - enum: ['chrome', 'safari', 'firefox', 'edge', 'ie', 'other'], + enum: ['chrome', 'safari', 'firefox', 'edge', 'ie', 'cros', 'other'], default: 'other' }, browser_version: { From ab0342f6fd19168d604a2908d952515285d8d024 Mon Sep 17 00:00:00 2001 From: Kevin Heis Date: Wed, 17 Mar 2021 08:46:34 -0700 Subject: [PATCH 3/3] Update schema-event.js --- lib/schema-event.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/schema-event.js b/lib/schema-event.js index 021465007a70..913cf1d9a31c 100644 --- a/lib/schema-event.js +++ b/lib/schema-event.js @@ -73,7 +73,7 @@ const context = { os: { type: 'string', description: 'The type of operating system the user is working with.', - enum: ['windows', 'mac', 'linux', 'ios', 'android', 'other'], + enum: ['windows', 'mac', 'linux', 'ios', 'android', 'cros', 'other'], default: 'other' }, os_version: { @@ -83,7 +83,7 @@ const context = { browser: { type: 'string', description: 'The type of browser the user is browsing with.', - enum: ['chrome', 'safari', 'firefox', 'edge', 'ie', 'cros', 'other'], + enum: ['chrome', 'safari', 'firefox', 'edge', 'ie', 'other'], default: 'other' }, browser_version: {