Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Fingerprint Record Filtering #349

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat: Simplify screen dimension validation by removing aspect ratio c…
…hecks
0xARYA committed Jan 24, 2025
commit 3d786367fc793d8273eaf94a1bef6d2733e08421
Original file line number Diff line number Diff line change
@@ -321,16 +321,11 @@ async function prepareRecords(
let validScreenDimensions = true;

if (desktopFingerprint) {
const aspectRatio =
fingerprint.screen.width / fingerprint.screen.height;

validScreenDimensions =
fingerprint.screen.width >= 1024 &&
fingerprint.screen.width <= 5120 &&
fingerprint.screen.height >= 768 &&
fingerprint.screen.height <= 2880 &&
(Math.abs(aspectRatio - 16 / 9) < 0.1 || // 16:9 aspect ratio
Math.abs(aspectRatio - 4 / 3) < 0.1); // 4:3 aspect ratio
fingerprint.screen.height <= 2880;
} else {
const screenWidth = Math.max(
fingerprint.screen.width,
@@ -342,16 +337,11 @@ async function prepareRecords(
fingerprint.screen.height
);

const screenAspectRatio = screenWidth / screenHeight;

validScreenDimensions =
screenWidth >= 320 &&
screenWidth <= 2560 &&
screenHeight >= 480 &&
screenHeight <= 3200 &&
(Math.abs(screenAspectRatio - 9 / 16) < 0.1 || // 9:16 aspect ratio
Math.abs(screenAspectRatio - 4 / 3) < 0.1 || // 4:3 aspect ratio
Math.abs(screenAspectRatio - 16 / 9) < 0.1); // 16:9 aspect ratio
screenHeight <= 3200;
}

// The screen dimensions should be within the expected range