Collect information about screen resolution #35
Collect information about screen resolution #35alexbruy wants to merge 5 commits intoexplodingcamera:mainfrom
Conversation
|
Thanks for submitting a PR! I'm a bit unsure about adding this, similarly to #23 I want to minimize the amount of data that could be used for fingerprinting. I'll have to think about this a bit, something that might work would be having a set of predefined screen width buckets (or maybe devicePixelRatio * width) that are collected instead. |
|
Thanks for the feedback! I completely understand the concerns regarding fingerprinting. Liwan’s strict focus on privacy is exactly why I chose it and want to contribute to it. Regarding screen resolution, my goal is to provide necessary insights for design, especially for defining CSS breakpoints and optimizing image assets, which is difficult to do with only a "Mobile/Desktop" breakdown. To address the fingerprinting concerns while still providing useful data, I would be happy to implement the bucketing approach as you suggested. Instead of storing raw pixel values, we could define a few groups based on common widths, such as:
Other privacy-focused tools like GoatCounter, Counter.dev and others include screen size because it is an important metric for UI/UX, but they often use similar grouping or rounding to protect anonymity. Would you be open to a revised approach where I either implement a helper to "fit" the resolution to the nearest bucket or store only the width, as height is often more variable and less critical for breakpoints planning? |
Currently Liwan only distinguish between desktop and mobile clients, and does not provide any insight on the visitor's screen sizes/resolution. Knowing most used screen size for instance can help with defining breakpoints and creating optimized images.
In this PR I tried to add support for screen size tracking. I'm new to Rust, so my code probably not that good.
Also, as I have no experience with Astro and TS, Gemini helped me to understand which changes are necessary on the frontend (dashboard) side. I hope I got them right.