Skip to content

TextMetrics test Number of differences doesn't stay the same when CanvasBlocker is disabled when either TextMetrics API or DOMRect API protection is disabled #806

Description

@Willie169

Hereafter, TM refers to TextMetrics API protection, and DR refers to DOMRect API protection.

While the expected result says the number of differences stays the same when CanvasBlocker is disabled, the following results are reproduced in a new Firefox profile:

  • TM+DR: Number of differences: 0 of 258
  • TM only: Number of differences: 12 of 258
  • DR only: Number of differences: 12 of 258
  • None: Number of differences: 0 of 258

TM+DR:

Details

TextMetrics test

Expected result

  1. the hashes are different to the hashes when CanvasBlocker is disabled
  2. the number of differences stays the same when CanvasBlocker is disabled
  3. if "refresh" is clicked nothing must change
  4. upon page reload the hashes change (depending on CanvasBlocker settings - e.g. not in the stealth preset)
  5. Firefox 68 does only offer integer precision in TextMetrics and therefore less fingerprinting potential. CanvasBlocker only changes values if they are no integer and therefore point 1 and 4 are not true in Firefox 68.

Tests

measureText

Hashes: all: | 01cec9cc1c6edadc8de0e928fef8e26b9f91f40c2bfd755c9c56c22eeececce0 -- | -- width: | da01b42e9d826f9728dc363d893f3f05b0e2f697bc1d6351bef45b5fc5ef8dd6 actualBoundingBoxAscent: | 4cb7f96473d5675774b0b0d1ad6c07f8df457d68892cc4dda39bbeb5e7fee799 actualBoundingBoxDescent: | cd6d2f7bbeedf1d8a59e7f8c8630c247f5b82716729531f7a90ca7fa94090bd0 actualBoundingBoxLeft: | a6c6b4b2164e54527f62be3c4e2716a60fce9c29dd08adae5fac58f93ea99c18 actualBoundingBoxRight: | fd2c437e8efa97876d326a78bd3a874d77f90a23e37055facfd3cfe474ab36b2 alphabeticBaseline: | 8a0c831db160fff40e3536ecc4995da2045d7d249a2c8d0d1180e2cb9e03b9eb emHeightAscent: | 373863f18c351646dacae783ebb29136cff32a87202c36f117b020448a6cf096 emHeightDescent: | f97fea8f31b345631c2a4fed853c205ecbae41e9f43f7627ae47697093e412f7 fontBoundingBoxAscent: | d6f7767d210c871c6b2375466ef9a5add03fb8c872afafa7055139a09c4e1721 fontBoundingBoxDescent: | 92b86ad4abbd9899d9a69abeb68d9ccb5fe708867afeb42d592dee2a20a60d01 hangingBaseline: | 5eb09ffaea4fe64d6f92fb36053ae7df53e6b085b5ccf333d7362aef283a3357 ideographicBaseline: | d536ef1afac775ca5794385361888ea3bfe0edc1e3cf5e4779ec7a8cdc67bed3



Number of differences: 0 of 258

</div>
TM only:
Details

TextMetrics test

Expected result

  1. the hashes are different to the hashes when CanvasBlocker is disabled
  2. the number of differences stays the same when CanvasBlocker is disabled
  3. if "refresh" is clicked nothing must change
  4. upon page reload the hashes change (depending on CanvasBlocker settings - e.g. not in the stealth preset)
  5. Firefox 68 does only offer integer precision in TextMetrics and therefore less fingerprinting potential. CanvasBlocker only changes values if they are no integer and therefore point 1 and 4 are not true in Firefox 68.

Tests

measureText

Hashes: all: | 01cec9cc1c6edadc8de0e928fef8e26b9f91f40c2bfd755c9c56c22eeececce0 -- | -- width: | da01b42e9d826f9728dc363d893f3f05b0e2f697bc1d6351bef45b5fc5ef8dd6 actualBoundingBoxAscent: | 4cb7f96473d5675774b0b0d1ad6c07f8df457d68892cc4dda39bbeb5e7fee799 actualBoundingBoxDescent: | cd6d2f7bbeedf1d8a59e7f8c8630c247f5b82716729531f7a90ca7fa94090bd0 actualBoundingBoxLeft: | a6c6b4b2164e54527f62be3c4e2716a60fce9c29dd08adae5fac58f93ea99c18 actualBoundingBoxRight: | fd2c437e8efa97876d326a78bd3a874d77f90a23e37055facfd3cfe474ab36b2 alphabeticBaseline: | 8a0c831db160fff40e3536ecc4995da2045d7d249a2c8d0d1180e2cb9e03b9eb emHeightAscent: | 373863f18c351646dacae783ebb29136cff32a87202c36f117b020448a6cf096 emHeightDescent: | f97fea8f31b345631c2a4fed853c205ecbae41e9f43f7627ae47697093e412f7 fontBoundingBoxAscent: | d6f7767d210c871c6b2375466ef9a5add03fb8c872afafa7055139a09c4e1721 fontBoundingBoxDescent: | 92b86ad4abbd9899d9a69abeb68d9ccb5fe708867afeb42d592dee2a20a60d01 hangingBaseline: | 5eb09ffaea4fe64d6f92fb36053ae7df53e6b085b5ccf333d7362aef283a3357 ideographicBaseline: | d536ef1afac775ca5794385361888ea3bfe0edc1e3cf5e4779ec7a8cdc67bed3



Number of differences: 12 of 258

</div>
DR only:
Details

TextMetrics test

Expected result

  1. the hashes are different to the hashes when CanvasBlocker is disabled
  2. the number of differences stays the same when CanvasBlocker is disabled
  3. if "refresh" is clicked nothing must change
  4. upon page reload the hashes change (depending on CanvasBlocker settings - e.g. not in the stealth preset)
  5. Firefox 68 does only offer integer precision in TextMetrics and therefore less fingerprinting potential. CanvasBlocker only changes values if they are no integer and therefore point 1 and 4 are not true in Firefox 68.

Tests

measureText

Hashes: all: | ee75e8eae2de8ef78ad5237550038bbbb347db1996878d7949ec956ef6392590 -- | -- width: | c47bf6d4ea205854c39b061947d38f4a4462f6b22507a3570c60c41659fed9c3 actualBoundingBoxAscent: | 4cb7f96473d5675774b0b0d1ad6c07f8df457d68892cc4dda39bbeb5e7fee799 actualBoundingBoxDescent: | cd6d2f7bbeedf1d8a59e7f8c8630c247f5b82716729531f7a90ca7fa94090bd0 actualBoundingBoxLeft: | a6c6b4b2164e54527f62be3c4e2716a60fce9c29dd08adae5fac58f93ea99c18 actualBoundingBoxRight: | fd2c437e8efa97876d326a78bd3a874d77f90a23e37055facfd3cfe474ab36b2 alphabeticBaseline: | 8a0c831db160fff40e3536ecc4995da2045d7d249a2c8d0d1180e2cb9e03b9eb emHeightAscent: | 92cb55aed50538547743391b8c86b3aec8b60c5d9c616451566bef761ff97dae emHeightDescent: | 3470133076f6d8f66b4c0b017cd63e4080d25e556afbff495470a1abd4a76924 fontBoundingBoxAscent: | d6f7767d210c871c6b2375466ef9a5add03fb8c872afafa7055139a09c4e1721 fontBoundingBoxDescent: | 92b86ad4abbd9899d9a69abeb68d9ccb5fe708867afeb42d592dee2a20a60d01 hangingBaseline: | 5eb09ffaea4fe64d6f92fb36053ae7df53e6b085b5ccf333d7362aef283a3357 ideographicBaseline: | d536ef1afac775ca5794385361888ea3bfe0edc1e3cf5e4779ec7a8cdc67bed3



Number of differences: 12 of 258

</div>
None:
Details

TextMetrics test

Expected result

  1. the hashes are different to the hashes when CanvasBlocker is disabled
  2. the number of differences stays the same when CanvasBlocker is disabled
  3. if "refresh" is clicked nothing must change
  4. upon page reload the hashes change (depending on CanvasBlocker settings - e.g. not in the stealth preset)
  5. Firefox 68 does only offer integer precision in TextMetrics and therefore less fingerprinting potential. CanvasBlocker only changes values if they are no integer and therefore point 1 and 4 are not true in Firefox 68.

Tests

measureText

Hashes: all: | ee75e8eae2de8ef78ad5237550038bbbb347db1996878d7949ec956ef6392590 -- | -- width: | c47bf6d4ea205854c39b061947d38f4a4462f6b22507a3570c60c41659fed9c3 actualBoundingBoxAscent: | 4cb7f96473d5675774b0b0d1ad6c07f8df457d68892cc4dda39bbeb5e7fee799 actualBoundingBoxDescent: | cd6d2f7bbeedf1d8a59e7f8c8630c247f5b82716729531f7a90ca7fa94090bd0 actualBoundingBoxLeft: | a6c6b4b2164e54527f62be3c4e2716a60fce9c29dd08adae5fac58f93ea99c18 actualBoundingBoxRight: | fd2c437e8efa97876d326a78bd3a874d77f90a23e37055facfd3cfe474ab36b2 alphabeticBaseline: | 8a0c831db160fff40e3536ecc4995da2045d7d249a2c8d0d1180e2cb9e03b9eb emHeightAscent: | 92cb55aed50538547743391b8c86b3aec8b60c5d9c616451566bef761ff97dae emHeightDescent: | 3470133076f6d8f66b4c0b017cd63e4080d25e556afbff495470a1abd4a76924 fontBoundingBoxAscent: | d6f7767d210c871c6b2375466ef9a5add03fb8c872afafa7055139a09c4e1721 fontBoundingBoxDescent: | 92b86ad4abbd9899d9a69abeb68d9ccb5fe708867afeb42d592dee2a20a60d01 hangingBaseline: | 5eb09ffaea4fe64d6f92fb36053ae7df53e6b085b5ccf333d7362aef283a3357 ideographicBaseline: | d536ef1afac775ca5794385361888ea3bfe0edc1e3cf5e4779ec7a8cdc67bed3



Number of differences: 0 of 258

</div>
Firefox version:
Details
Name 	Firefox
Version 	152.0.5
Build ID 	20260706120035
Distribution ID 	canonical
User Agent 	Mozilla/5.0 (X11; Linux x86_64; rv:152.0) Gecko/20100101 Firefox/152.0
OS 	Linux 7.0.0-27-generic #27-Ubuntu SMP PREEMPT_DYNAMIC Thu Jun 18 19:13:49 UTC 2026
OS Theme 	Breeze / Adwaita
Application Binary 	/usr/lib/firefox/firefox
Details
Package: firefox
Priority: optional
Section: web
Installed-Size: 297749
Maintainer: Ubuntu Mozilla Team 
Architecture: amd64
Version: 152.0.5+build1-0ubuntu0.26.04.1~mt1
Recommends: xul-ext-ubufox, libcanberra0, libdbusmenu-glib4, libdbusmenu-gtk3-4
Replaces: kubuntu-firefox-installer
Suggests: fonts-lyx
Provides: gnome-www-browser, iceweasel, www-browser
Depends: lsb-release, libasound2t64 (>= 1.0.16), libatk1.0-0t64 (>= 1.12.4), libc6 (>= 2.43), libcairo-gobject2 (>= 1.10.0), libcairo2 (>= 1.10.0), libdbus-1-3 (>= 1.10), libfontconfig1 (>= 2.12.6), libfreetype6 (>= 2.10.1), libgcc-s1 (>= 4.2), libgdk-pixbuf-2.0-0 (>= 2.22.0), libglib2.0-0t64 (>= 2.42), libgtk-3-0t64 (>= 3.14), libharfbuzz0b (>= 0.6.0), libpango-1.0-0 (>= 1.14.0), libpangocairo-1.0-0 (>= 1.14.0), libstdc++6 (>= 13), libx11-6, libx11-xcb1, libxcb-shm0, libxcb1, libxcomposite1 (>= 1:0.4.6), libxcursor1 (>> 1.1.2), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxi6, libxrandr2 (>= 2:1.4.0), libxrender1 (>= 1:0.9.12), zlib1g (>= 1:1.1.4)
Filename: pool/main/f/firefox/firefox_152.0.5+build1-0ubuntu0.26.04.1~mt1_amd64.deb
Size: 83748522
MD5sum: 0beeaa04a20a5bd8b3ec61b4e92db96a
SHA1: 910b1857c7e34b5b7459f5f438e93d54ea07e2b7
SHA256: eb3cf7a92e2b761dc11b5496c56488d6ecb359cc07925e34d588a94eac6d8821
SHA512: 6fc54d281bd802c3d9b3ac82af285f139243aa6cf0da9deb192403498ce46c6fab32eb1eb44d38b97b1ff937e0fb103208c93b6ee58af855f328065bfc82b4d2
Description-en: Safe and easy web browser from Mozilla
 Firefox delivers safe, easy web browsing. A familiar user interface,
 enhanced security features including protection from online identity theft,
 and integrated search let you get the most out of the web.
Description-md5: 46b619f510631c4693dc09c1a3778a55
Xul-Appid: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}

Another question: Now that Firefox has FontVisibilityLangPack: Locally installed fonts (specifically, fonts that are not in the list of standard fonts shipped by your operating system) will not be used to render text on a page. and FontVisibilityBaseSystem: The only fonts available to be used by websites are those pre-installed in the Operating System. This also excludes fonts in language packs., should we still spoof TM and DR with CanvasBlocker?

Thanks a lot for your great work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions