fingerprinting screen coordinates
See original GitHub issueDescription
Most browsers leak information about the user’s display outside the content viewport, including screen width and height, the position of a browser window in the screen, and the difference between viewport and window dimensions. This information constitutes a fingerprinting vectors that is exposed to content JS and CSS. APIs that leak this information include:
window.screen object leaks information about the screen size:
window.screen.widthwindow.screen.heightwindow.screen.availWidthwindow.screen.availHeightwindow.screen.availLeftwindow.screen.availTopwindow.screen.isExtended(leaks whether the user has multiple monitors)
Media queries also leak screen dimensions:
device-widthdevice-height
window properties leak absolute coordinates of the position and outer boundary of the browser window:
window.screenXwindow.screenYwindow.outerWidthwindow.outerHeight
Pointing event screen coordinates (MouseEvent, TouchEvent, DragEvent, PointerEvent) can also be used to computed the window’s position on the screen:
event.screenXevent.screenY
We want to hide this information from visited websites. The plan is to farble all of these APIs, meaning we spoof the values and also add a domain/session-keyed pseudorandom component to each of them.
We plan to enable the protection under standard (default) and aggressive fingerprinting modes, so that the user can disable them by lowering shields or setting “allow fingerprinting”. In addition, we bind the protections to a flag so that they can be remotely disabled using griffin.
Steps to Reproduce
Visit https://arthuredelstein.github.io/tracking_demos/screen.html to see how screen size is revealed.
Actual result:
Example: 
Also:

Desired result:
Content should not be given true information about screen dimensions or window position.
Reproduces how often:
Always
Brave version:
All versions
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:5 (2 by maintainers)

Top Related StackOverflow Question
Verification
PASSEDusingCase 1: 1st launch, no Griffin -
PASSEDSteps:
1.45.85brave://versionhttps://dev-pages.brave.software/fingerprinting/farbling.htmlGenerate fingerprintsThis Page,Local Frame, andRemote Framevalues were the same for each of the following:Screen resolutionScreen resolution media queryAvailable screen resolutionhttps://arthuredelstein.github.io/tracking_demos/screen.htmlConfirmed there was no farbling of the screen/window coordinates shown in the screenshot
step 3step 5step 8Case 2: 2nd launch, Griffin-enabled study (50%) with Shields enabled-
PASSED(Continued from
1st launch, no Griffintest, above) 10. restarted Brave 11. openedbrave://version12. confirmed in the 50%-chance case you getBraveScreenFingerprintingBlockerStudy:Enabled13. loadedhttps://dev-pages.brave.software/fingerprinting/farbling.html14. clicked onGenerate fingerprints16. loadedhttps://arthuredelstein.github.io/tracking_demos/screen.html17. moved the mouse around and examined the tracked coordinatesConfirmed the values for
This Pagewere different fromLocal FrameandRemote Frame(which were both the same); the only four (4) trackable events were themouseEvent.client(X/Y) coordinatesstep 13step 16Case 3: 2nd launch, Griffin-enabled study (50%) with Shields disabled-
PASSEDGenerate fingerprintsbrave://versionfarbling.htmlscreen.htmlConfirmed all values were the same; no farbling was applied
Case 4: 3rd launch, default/no study (50%) -
PASSED(Continued from
1st launch, no Griffintest, above) 10. restarted Brave 12. openedbrave://version13. confirmed in the other 50%-chance case I gotBraveScreenFingerprintingBlockerStudy:Default14. loadedhttps://dev-pages.brave.software/fingerprinting/farbling.html15. clicked onGenerate fingerprints16. loadedhttps://arthuredelstein.github.io/tracking_demos/screen.html17. moved the mouse around and examined the tracked coordinatesConfirmed all values were the same; no farbling was applied
step 11step 13step 15Verification passed on
Case 1: 1st launch, no Griffin -
PASSEDSteps:
1.45.xbrave://versionhttps://dev-pages.brave.software/fingerprinting/farbling.htmlGenerate fingerprintsThis Page,Local Frame, andRemote Framevalues were the same for each of the following:Screen resolutionScreen resolution media queryAvailable screen resolutionhttps://arthuredelstein.github.io/tracking_demos/screen.htmlConfirmed there was no farbling of the screen/window coordinates shown in the screenshot
Case 2: 2nd launch, Griffin-enabled study (50%) with Shields enabled-
PASSED(Continued from
1st launch, no Griffintest, above) 10. restarted Brave 11. openedbrave://version12. confirmed in the 50%-chance case you getBraveScreenFingerprintingBlockerStudy:Enabled13. loadedhttps://dev-pages.brave.software/fingerprinting/farbling.html14. clicked onGenerate fingerprints16. loadedhttps://arthuredelstein.github.io/tracking_demos/screen.html17. moved the mouse around and examined the tracked coordinatesConfirmed the values for
This Pagewere different fromLocal FrameandRemote Frame(which were both the same); the only four (4) trackable events were themouseEvent.client(X/Y) coordinatesCase 3: 2nd launch, Griffin-enabled study (50%) with Shields disabled-
PASSEDGenerate fingerprintsConfirmed all values were the same; no farbling was applied
Case 4: 3rd launch, default/no study (50%) -
PASSED(Continued from
1st launch, no Griffintest, above) 10. restarted Brave 12. openedbrave://version13. confirmed in the other 50%-chance case I gotBraveScreenFingerprintingBlockerStudy:Default14. loadedhttps://dev-pages.brave.software/fingerprinting/farbling.html15. clicked onGenerate fingerprints16. loadedhttps://arthuredelstein.github.io/tracking_demos/screen.html17. moved the mouse around and examined the tracked coordinatesConfirmed all values were the same; no farbling was applied
Because
BraveScreenFingerprintingBlockerStudyhasn’t been rolled out via thereleasechannel, verification onAndroidwas done by enablingbrave://flags#brave-block-screen-fingerprintingto ensure the feature was working as expected.Verification PASSED on
Samsung S10+runningAndroid 12using the following build(s):Case 1: BraveBlockScreenFingerprinting disabled -
PASSED1.45.111 Chromium: 107.0.5304.62brave://versionhttps://dev-pages.brave.software/fingerprinting/farbling.htmlGenerate fingerprintsThis Page,Local Frame, andRemote Framevalues were the same for each of the following:Screen resolutionScreen resolution media queryAvailable screen resolutionhttps://arthuredelstein.github.io/tracking_demos/screen.htmlInitial values before restarting the browser
ExampleExampleConfirmed there was no farbling of the screen/window coordinates shown after the browser was restarted
ExampleExampleCase 2: BraveBlockScreenFingerprinting enabled - Shields Enabled -
PASSED1.45.111 Chromium: 107.0.5304.62brave://versionbrave://flags#brave-block-screen-fingerprintingviabrave://flagshttps://dev-pages.brave.software/fingerprinting/farbling.htmlGenerate fingerprintsThis Page,Local Frame, andRemote Framevalues for the following:Screen resolutionScreen resolution media queryAvailable screen resolutionhttps://arthuredelstein.github.io/tracking_demos/screen.htmland note the values being usedhttps://dev-pages.brave.software/fingerprinting/farbling.html&https://arthuredelstein.github.io/tracking_demos/screen.htmlBlock Screen Fingerprintinghas been enabledInitial values before restarting the browser
ExampleExampleConfirmed that the values are different due to FP farbling
ExampleExampleCase 3: BraveBlockScreenFingerprinting enabled - Shields Disabled -
PASSED1.45.111 Chromium: 107.0.5304.62brave://versionbrave://flags#brave-block-screen-fingerprintingviabrave://flagshttps://dev-pages.brave.software/fingerprinting/farbling.htmland disabled shieldsGenerate fingerprintsThis Page,Local Frame, andRemote Framevalues for the following:Screen resolutionScreen resolution media queryAvailable screen resolutionhttps://arthuredelstein.github.io/tracking_demos/screen.htmland note the values being used (disabled shields)https://dev-pages.brave.software/fingerprinting/farbling.html&https://arthuredelstein.github.io/tracking_demos/screen.htmlBrave Shieldsbeing disabled on both websitesBrave Shieldson both loadhttps://dev-pages.brave.software/fingerprinting/farbling.html&https://arthuredelstein.github.io/tracking_demos/screen.htmlBrave Shieldsare enabled and FB farbling is occurringInitial values before restarting the browser (Shields Disabled)
ExampleExampleConfirmed there was no farbling of the screen/window coordinates shown after the browser was restarted
ExampleExampleConfirmed that the values are different due to FP farbling (Shields Enabled)
ExampleExampleBecause
BraveScreenFingerprintingBlockerStudyhasn’t been rolled out via thereleasechannel, verification onAndroidwas done by enablingbrave://flags#brave-block-screen-fingerprintingto ensure the feature was working as expected.Verification PASSED on
Samsung Tab S8 UltrarunningAndroid 12using the following build(s):Case 1: BraveBlockScreenFingerprinting disabled -
PASSED1.45.111 Chromium: 107.0.5304.62brave://versionhttps://dev-pages.brave.software/fingerprinting/farbling.htmlGenerate fingerprintsThis Page,Local Frame, andRemote Framevalues were the same for each of the following:Screen resolutionScreen resolution media queryAvailable screen resolutionhttps://arthuredelstein.github.io/tracking_demos/screen.htmlInitial values before restarting the browser
ExampleExampleConfirmed there was no farbling of the screen/window coordinates shown after the browser was restarted
ExampleExampleCase 2: BraveBlockScreenFingerprinting enabled - Shields Enabled -
PASSED1.45.111 Chromium: 107.0.5304.62brave://versionbrave://flags#brave-block-screen-fingerprintingviabrave://flagshttps://dev-pages.brave.software/fingerprinting/farbling.htmlGenerate fingerprintsThis Page,Local Frame, andRemote Framevalues for the following:Screen resolutionScreen resolution media queryAvailable screen resolutionhttps://arthuredelstein.github.io/tracking_demos/screen.htmland note the values being usedhttps://dev-pages.brave.software/fingerprinting/farbling.html&https://arthuredelstein.github.io/tracking_demos/screen.htmlBlock Screen Fingerprintinghas been enabledInitial values before restarting the browser
ExampleExampleConfirmed that the values are different due to FP farbling
ExampleExampleCase 3: BraveBlockScreenFingerprinting enabled - Shields Disabled -
PASSED1.45.111 Chromium: 107.0.5304.62brave://versionbrave://flags#brave-block-screen-fingerprintingviabrave://flagshttps://dev-pages.brave.software/fingerprinting/farbling.htmland disabled shieldsGenerate fingerprintsThis Page,Local Frame, andRemote Framevalues for the following:Screen resolutionScreen resolution media queryAvailable screen resolutionhttps://arthuredelstein.github.io/tracking_demos/screen.htmland note the values being used (disabled shields)https://dev-pages.brave.software/fingerprinting/farbling.html&https://arthuredelstein.github.io/tracking_demos/screen.htmlBrave Shieldsbeing disabled on both websitesBrave Shieldson both loadhttps://dev-pages.brave.software/fingerprinting/farbling.html&https://arthuredelstein.github.io/tracking_demos/screen.htmlBrave Shieldsare enabled and FB farbling is occurringInitial values before restarting the browser (Shields Disabled)
ExampleExampleConfirmed there was no farbling of the screen/window coordinates shown after the browser was restarted
ExampleExampleConfirmed that the values are different due to FP farbling (Shields Enabled)
ExampleExample