Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Ignore Safari backported releases #1572

Merged
merged 3 commits into from
Oct 16, 2021
Merged
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
10 changes: 10 additions & 0 deletions ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ const parseUA = (userAgent, browsers) => {
const versions = Object.keys(browsers[data.browser.id].releases);
versions.sort(compareVersions);

// Certain Safari versions are backports of newer versions, but contain less
// features, particularly ones involving OS integration. We are explicitly
// marking these versions as "not in BCD" to avoid confusion.
if (
data.browser.id === 'safari' &&
['4.1', '6.1', '6.2', '7.1'].includes(data.version)
) {
return data;
}

// The |version| from the UA string is typically more precise than |versions|
// from BCD, and some "uninteresting" releases are missing from BCD. To deal
// with this, find the pair of versions in |versions| that sandwiches
Expand Down