Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@ _.info = {
'Firefox iOS': /FxiOS\/(\d+(\.\d+)?)/,
'Konqueror': /Konqueror:(\d+(\.\d+)?)/,
'BlackBerry': /BlackBerry (\d+(\.\d+)?)/,
'Android Mobile': /android\s(\d+(\.\d+)?)/,
'Android Mobile': /Android\s(\d+(\.\d+)?)/,
'Samsung Internet': /SamsungBrowser\/(\d+(\.\d+)?)/,
'Internet Explorer': /(rv:|MSIE )(\d+(\.\d+)?)/,
'Mozilla': /rv:(\d+(\.\d+)?)/,
Expand Down
14 changes: 14 additions & 0 deletions tests/unit/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,20 @@ describe(`_.info helper methods`, function() {
expect(pageViewProperties.current_url_search).to.equal(`?utm_source=google`);
});
});

describe(`_.info.browserVersion`, function() {
// Real Samsung stock browser UA on Android 4.4.2 (no "Chrome" token, so
// it is detected as "Android Mobile" rather than "Chrome").
var androidMobileUA = `Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; SAMSUNG SM-G900F Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36`;

it(`detects "Android Mobile" browsers`, function() {
expect(_.info.browser(androidMobileUA, ``, false)).to.equal(`Android Mobile`);
});

it(`parses the version for "Android Mobile" browsers`, function() {
expect(_.info.browserVersion(androidMobileUA, ``, false)).to.equal(4.4);
});
});
});

describe(`_.isBlockedUA`, function() {
Expand Down