camoucore 0.3.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/LICENSE +4 -3
  2. package/dist/camoufox/__main__.d.ts +10 -0
  3. package/dist/camoufox/__main__.js +1175 -0
  4. package/dist/camoufox/__version__.d.ts +31 -0
  5. package/dist/camoufox/__version__.js +32 -0
  6. package/dist/camoufox/_humanize_playwright.d.ts +54 -0
  7. package/dist/camoufox/_humanize_playwright.js +429 -0
  8. package/dist/camoufox/addons.d.ts +21 -0
  9. package/dist/camoufox/addons.js +56 -0
  10. package/dist/camoufox/async_api.d.ts +9 -0
  11. package/dist/camoufox/async_api.js +9 -0
  12. package/dist/camoufox/browser-pin.d.ts +46 -0
  13. package/dist/camoufox/browser-pin.js +96 -0
  14. package/dist/camoufox/cli.d.ts +7 -0
  15. package/dist/camoufox/cli.js +20 -0
  16. package/dist/camoufox/coherence.d.ts +141 -0
  17. package/dist/camoufox/coherence.js +708 -0
  18. package/dist/camoufox/data-files/audio-output-latency.json +15 -0
  19. package/dist/camoufox/data-files/browser-pin.json +7 -0
  20. package/dist/camoufox/data-files/display-profiles.json +6 -0
  21. package/dist/camoufox/data-files/essential-fonts.json +5 -0
  22. package/dist/camoufox/data-files/fingerprint-presets-v150.json +14544 -0
  23. package/dist/camoufox/data-files/fingerprint-presets.json +5192 -0
  24. package/dist/camoufox/data-files/font-bases.json +1888 -0
  25. package/dist/camoufox/data-files/font-groups.json +716 -0
  26. package/dist/camoufox/data-files/font-prefs.json +1046 -0
  27. package/dist/camoufox/data-files/fonts.json +240 -0
  28. package/dist/camoufox/data-files/fpgen.yml +44 -0
  29. package/dist/camoufox/data-files/launcher-constants.json +136 -0
  30. package/dist/camoufox/data-files/media-devices.json +180 -0
  31. package/dist/camoufox/data-files/repos.yml +40 -0
  32. package/dist/camoufox/data-files/voice-manifests.json +1864 -0
  33. package/dist/camoufox/data-files/voice-uris.json +188 -0
  34. package/dist/camoufox/data-files/warnings.yml +146 -0
  35. package/dist/camoufox/display_profile.d.ts +21 -0
  36. package/dist/camoufox/display_profile.js +129 -0
  37. package/dist/camoufox/driver_defaults.d.ts +27 -0
  38. package/dist/camoufox/driver_defaults.js +119 -0
  39. package/dist/camoufox/exceptions.d.ts +68 -0
  40. package/dist/camoufox/exceptions.js +122 -0
  41. package/dist/camoufox/fingerprints.d.ts +434 -0
  42. package/dist/camoufox/fingerprints.js +1936 -0
  43. package/dist/camoufox/gpudisplay.d.ts +158 -0
  44. package/dist/camoufox/gpudisplay.js +695 -0
  45. package/dist/camoufox/host_rendering.d.ts +38 -0
  46. package/dist/camoufox/host_rendering.js +180 -0
  47. package/dist/camoufox/humanize.d.ts +89 -0
  48. package/dist/camoufox/humanize.js +143 -0
  49. package/dist/camoufox/index.d.ts +21 -0
  50. package/dist/camoufox/index.js +21 -0
  51. package/dist/camoufox/ip.d.ts +45 -0
  52. package/dist/camoufox/ip.js +114 -0
  53. package/dist/camoufox/multiversion.d.ts +131 -0
  54. package/dist/camoufox/multiversion.js +490 -0
  55. package/dist/camoufox/node-floor.d.ts +5 -0
  56. package/dist/camoufox/node-floor.js +17 -0
  57. package/dist/camoufox/paths.d.ts +45 -0
  58. package/dist/camoufox/paths.js +62 -0
  59. package/dist/camoufox/pkgman.d.ts +361 -0
  60. package/dist/camoufox/pkgman.js +1066 -0
  61. package/dist/camoufox/product.d.ts +8 -0
  62. package/dist/camoufox/product.js +8 -0
  63. package/dist/camoufox/pycompat.d.ts +97 -0
  64. package/dist/camoufox/pycompat.js +458 -0
  65. package/dist/camoufox/server.d.ts +36 -0
  66. package/dist/camoufox/server.js +82 -0
  67. package/dist/camoufox/sync_api.d.ts +77 -0
  68. package/dist/camoufox/sync_api.js +207 -0
  69. package/dist/camoufox/utils.d.ts +638 -0
  70. package/dist/camoufox/utils.js +2507 -0
  71. package/dist/camoufox/warnings.d.ts +16 -0
  72. package/dist/camoufox/warnings.js +65 -0
  73. package/dist/camoufox/webgl.d.ts +52 -0
  74. package/dist/camoufox/webgl.js +264 -0
  75. package/dist/camouwolf/__main__.d.ts +10 -0
  76. package/dist/camouwolf/__main__.js +1180 -0
  77. package/dist/camouwolf/__version__.d.ts +31 -0
  78. package/dist/camouwolf/__version__.js +32 -0
  79. package/dist/camouwolf/_humanize_playwright.d.ts +53 -0
  80. package/dist/camouwolf/_humanize_playwright.js +427 -0
  81. package/dist/camouwolf/addons.d.ts +42 -0
  82. package/dist/camouwolf/addons.js +113 -0
  83. package/dist/camouwolf/async_api.d.ts +9 -0
  84. package/dist/camouwolf/async_api.js +9 -0
  85. package/dist/camouwolf/browser-pin.d.ts +46 -0
  86. package/dist/camouwolf/browser-pin.js +96 -0
  87. package/dist/camouwolf/cli.d.ts +7 -0
  88. package/dist/camouwolf/cli.js +20 -0
  89. package/dist/camouwolf/clienthints.d.ts +61 -0
  90. package/dist/camouwolf/clienthints.js +176 -0
  91. package/dist/camouwolf/coherence.d.ts +152 -0
  92. package/dist/camouwolf/coherence.js +554 -0
  93. package/dist/camouwolf/data-files/browser-pin.json +7 -0
  94. package/dist/camouwolf/data-files/camouwolf.defaults.json +118 -0
  95. package/dist/camouwolf/data-files/data/bundle-fonts.json +1983 -0
  96. package/dist/camouwolf/data-files/data/chrome-languages.json +517 -0
  97. package/dist/camouwolf/data-files/data/properties.json +321 -0
  98. package/dist/camouwolf/data-files/data/system-colors.json +35 -0
  99. package/dist/camouwolf/data-files/data/ubo.json +6 -0
  100. package/dist/camouwolf/data-files/fpgen.yml +41 -0
  101. package/dist/camouwolf/data-files/launcher-constants.json +26 -0
  102. package/dist/camouwolf/data-files/repos.yml +23 -0
  103. package/dist/camouwolf/data-files/warnings.yml +96 -0
  104. package/dist/camouwolf/driver_defaults.d.ts +25 -0
  105. package/dist/camouwolf/driver_defaults.js +114 -0
  106. package/dist/camouwolf/exceptions.d.ts +95 -0
  107. package/dist/camouwolf/exceptions.js +150 -0
  108. package/dist/camouwolf/fingerprints.d.ts +227 -0
  109. package/dist/camouwolf/fingerprints.js +753 -0
  110. package/dist/camouwolf/gpudisplay.d.ts +171 -0
  111. package/dist/camouwolf/gpudisplay.js +711 -0
  112. package/dist/camouwolf/host_rendering.d.ts +18 -0
  113. package/dist/camouwolf/host_rendering.js +114 -0
  114. package/dist/camouwolf/humanize.d.ts +84 -0
  115. package/dist/camouwolf/humanize.js +128 -0
  116. package/dist/camouwolf/index.d.ts +22 -0
  117. package/dist/camouwolf/index.js +21 -0
  118. package/dist/camouwolf/multiversion.d.ts +131 -0
  119. package/dist/camouwolf/multiversion.js +491 -0
  120. package/dist/camouwolf/node-floor.d.ts +5 -0
  121. package/dist/camouwolf/node-floor.js +17 -0
  122. package/dist/camouwolf/paths.d.ts +34 -0
  123. package/dist/camouwolf/paths.js +58 -0
  124. package/dist/camouwolf/pkgman.d.ts +331 -0
  125. package/dist/camouwolf/pkgman.js +972 -0
  126. package/dist/camouwolf/product.d.ts +3 -0
  127. package/dist/camouwolf/product.js +3 -0
  128. package/dist/camouwolf/pycompat.d.ts +92 -0
  129. package/dist/camouwolf/pycompat.js +461 -0
  130. package/dist/camouwolf/server.d.ts +36 -0
  131. package/dist/camouwolf/server.js +81 -0
  132. package/dist/camouwolf/switches.d.ts +77 -0
  133. package/dist/camouwolf/switches.js +222 -0
  134. package/dist/camouwolf/sync_api.d.ts +84 -0
  135. package/dist/camouwolf/sync_api.js +173 -0
  136. package/dist/camouwolf/utils.d.ts +644 -0
  137. package/dist/camouwolf/utils.js +2057 -0
  138. package/dist/camouwolf/warnings.d.ts +14 -0
  139. package/dist/camouwolf/warnings.js +59 -0
  140. package/dist/camouwolf/webgl.d.ts +41 -0
  141. package/dist/camouwolf/webgl.js +198 -0
  142. package/dist/data.d.ts +1 -1
  143. package/dist/data.js +3 -3
  144. package/dist/download.js +1 -1
  145. package/dist/exceptions.d.ts +1 -1
  146. package/dist/exceptions.js +1 -1
  147. package/dist/geolocation.js +1 -1
  148. package/dist/host.js +1 -1
  149. package/dist/ip.js +1 -1
  150. package/dist/locales.js +1 -1
  151. package/dist/mcp/cli.d.ts +15 -0
  152. package/dist/mcp/cli.js +108 -0
  153. package/dist/mcp/index.d.ts +8 -0
  154. package/dist/mcp/index.js +8 -0
  155. package/dist/mcp/main.d.ts +2 -0
  156. package/dist/mcp/main.js +8 -0
  157. package/dist/mcp/secrets.d.ts +50 -0
  158. package/dist/mcp/secrets.js +193 -0
  159. package/dist/mcp/server.d.ts +48 -0
  160. package/dist/mcp/server.js +653 -0
  161. package/dist/mcp/tree.d.ts +10 -0
  162. package/dist/mcp/tree.js +36 -0
  163. package/dist/passthrough.d.ts +1 -1
  164. package/dist/product.js +1 -1
  165. package/dist/settings.js +1 -1
  166. package/dist/telemetry.d.ts +0 -1
  167. package/dist/telemetry.js +5 -4
  168. package/dist/virtdisplay.d.ts +1 -1
  169. package/dist/virtdisplay.js +1 -1
  170. package/dist/warnings.js +1 -1
  171. package/package.json +57 -13
@@ -0,0 +1,188 @@
1
+ {
2
+ "mac": {
3
+ "Albert|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Albert",
4
+ "Alice|it-IT": "urn:moz-tts:osx:com.apple.voice.compact.it-IT.Alice",
5
+ "Alva|sv-SE": "urn:moz-tts:osx:com.apple.voice.compact.sv-SE.Alva",
6
+ "Aman|en-IN": "urn:moz-tts:osx:com.apple.voice.Aman",
7
+ "Amira|ms-MY": "urn:moz-tts:osx:com.apple.voice.compact.ms-MY.Amira",
8
+ "Amélie|fr-CA": "urn:moz-tts:osx:com.apple.voice.compact.fr-CA.Amelie",
9
+ "Anna|de-DE": "urn:moz-tts:osx:com.apple.voice.compact.de-DE.Anna",
10
+ "Aru|kk-KZ": "urn:moz-tts:osx:com.apple.voice.Aru",
11
+ "Bad News|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.BadNews",
12
+ "Bahh|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Bahh",
13
+ "Bells|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Bells",
14
+ "Boing|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Boing",
15
+ "Bubbles|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Bubbles",
16
+ "Carmit|he-IL": "urn:moz-tts:osx:com.apple.voice.compact.he-IL.Carmit",
17
+ "Cellos|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Cellos",
18
+ "Damayanti|id-ID": "urn:moz-tts:osx:com.apple.voice.compact.id-ID.Damayanti",
19
+ "Daniel|en-GB": "urn:moz-tts:osx:com.apple.voice.compact.en-GB.Daniel",
20
+ "Daria|bg-BG": "urn:moz-tts:osx:com.apple.voice.compact.bg-BG.Daria",
21
+ "Eddy (Chinese (China mainland))|zh-CN": "urn:moz-tts:osx:com.apple.eloquence.zh-CN.Eddy",
22
+ "Eddy (Chinese (Taiwan))|zh-TW": "urn:moz-tts:osx:com.apple.eloquence.zh-TW.Eddy",
23
+ "Eddy (English (UK))|en-GB": "urn:moz-tts:osx:com.apple.eloquence.en-GB.Eddy",
24
+ "Eddy (English (US))|en-US": "urn:moz-tts:osx:com.apple.eloquence.en-US.Eddy",
25
+ "Eddy (Finnish (Finland))|fi-FI": "urn:moz-tts:osx:com.apple.eloquence.fi-FI.Eddy",
26
+ "Eddy (French (Canada))|fr-CA": "urn:moz-tts:osx:com.apple.eloquence.fr-CA.Eddy",
27
+ "Eddy (French (France))|fr-FR": "urn:moz-tts:osx:com.apple.eloquence.fr-FR.Eddy",
28
+ "Eddy (German (Germany))|de-DE": "urn:moz-tts:osx:com.apple.eloquence.de-DE.Eddy",
29
+ "Eddy (Italian (Italy))|it-IT": "urn:moz-tts:osx:com.apple.eloquence.it-IT.Eddy",
30
+ "Eddy (Japanese (Japan))|ja-JP": "urn:moz-tts:osx:com.apple.eloquence.ja-JP.Eddy",
31
+ "Eddy (Korean (South Korea))|ko-KR": "urn:moz-tts:osx:com.apple.eloquence.ko-KR.Eddy",
32
+ "Eddy (Portuguese (Brazil))|pt-BR": "urn:moz-tts:osx:com.apple.eloquence.pt-BR.Eddy",
33
+ "Eddy (Spanish (Mexico))|es-MX": "urn:moz-tts:osx:com.apple.eloquence.es-MX.Eddy",
34
+ "Eddy (Spanish (Spain))|es-ES": "urn:moz-tts:osx:com.apple.eloquence.es-ES.Eddy",
35
+ "Ellen|nl-BE": "urn:moz-tts:osx:com.apple.voice.compact.nl-BE.Ellen",
36
+ "Flo (Chinese (China mainland))|zh-CN": "urn:moz-tts:osx:com.apple.eloquence.zh-CN.Flo",
37
+ "Flo (Chinese (Taiwan))|zh-TW": "urn:moz-tts:osx:com.apple.eloquence.zh-TW.Flo",
38
+ "Flo (English (UK))|en-GB": "urn:moz-tts:osx:com.apple.eloquence.en-GB.Flo",
39
+ "Flo (English (US))|en-US": "urn:moz-tts:osx:com.apple.eloquence.en-US.Flo",
40
+ "Flo (Finnish (Finland))|fi-FI": "urn:moz-tts:osx:com.apple.eloquence.fi-FI.Flo",
41
+ "Flo (French (Canada))|fr-CA": "urn:moz-tts:osx:com.apple.eloquence.fr-CA.Flo",
42
+ "Flo (French (France))|fr-FR": "urn:moz-tts:osx:com.apple.eloquence.fr-FR.Flo",
43
+ "Flo (German (Germany))|de-DE": "urn:moz-tts:osx:com.apple.eloquence.de-DE.Flo",
44
+ "Flo (Italian (Italy))|it-IT": "urn:moz-tts:osx:com.apple.eloquence.it-IT.Flo",
45
+ "Flo (Japanese (Japan))|ja-JP": "urn:moz-tts:osx:com.apple.eloquence.ja-JP.Flo",
46
+ "Flo (Korean (South Korea))|ko-KR": "urn:moz-tts:osx:com.apple.eloquence.ko-KR.Flo",
47
+ "Flo (Portuguese (Brazil))|pt-BR": "urn:moz-tts:osx:com.apple.eloquence.pt-BR.Flo",
48
+ "Flo (Spanish (Mexico))|es-MX": "urn:moz-tts:osx:com.apple.eloquence.es-MX.Flo",
49
+ "Flo (Spanish (Spain))|es-ES": "urn:moz-tts:osx:com.apple.eloquence.es-ES.Flo",
50
+ "Fred|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Fred",
51
+ "Geeta|te-IN": "urn:moz-tts:osx:com.apple.voice.compact.te-IN.Geeta",
52
+ "Good News|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.GoodNews",
53
+ "Grandma (Chinese (China mainland))|zh-CN": "urn:moz-tts:osx:com.apple.eloquence.zh-CN.Grandma",
54
+ "Grandma (Chinese (Taiwan))|zh-TW": "urn:moz-tts:osx:com.apple.eloquence.zh-TW.Grandma",
55
+ "Grandma (English (UK))|en-GB": "urn:moz-tts:osx:com.apple.eloquence.en-GB.Grandma",
56
+ "Grandma (English (US))|en-US": "urn:moz-tts:osx:com.apple.eloquence.en-US.Grandma",
57
+ "Grandma (Finnish (Finland))|fi-FI": "urn:moz-tts:osx:com.apple.eloquence.fi-FI.Grandma",
58
+ "Grandma (French (Canada))|fr-CA": "urn:moz-tts:osx:com.apple.eloquence.fr-CA.Grandma",
59
+ "Grandma (French (France))|fr-FR": "urn:moz-tts:osx:com.apple.eloquence.fr-FR.Grandma",
60
+ "Grandma (German (Germany))|de-DE": "urn:moz-tts:osx:com.apple.eloquence.de-DE.Grandma",
61
+ "Grandma (Italian (Italy))|it-IT": "urn:moz-tts:osx:com.apple.eloquence.it-IT.Grandma",
62
+ "Grandma (Japanese (Japan))|ja-JP": "urn:moz-tts:osx:com.apple.eloquence.ja-JP.Grandma",
63
+ "Grandma (Korean (South Korea))|ko-KR": "urn:moz-tts:osx:com.apple.eloquence.ko-KR.Grandma",
64
+ "Grandma (Portuguese (Brazil))|pt-BR": "urn:moz-tts:osx:com.apple.eloquence.pt-BR.Grandma",
65
+ "Grandma (Spanish (Mexico))|es-MX": "urn:moz-tts:osx:com.apple.eloquence.es-MX.Grandma",
66
+ "Grandma (Spanish (Spain))|es-ES": "urn:moz-tts:osx:com.apple.eloquence.es-ES.Grandma",
67
+ "Grandpa (Chinese (China mainland))|zh-CN": "urn:moz-tts:osx:com.apple.eloquence.zh-CN.Grandpa",
68
+ "Grandpa (Chinese (Taiwan))|zh-TW": "urn:moz-tts:osx:com.apple.eloquence.zh-TW.Grandpa",
69
+ "Grandpa (English (UK))|en-GB": "urn:moz-tts:osx:com.apple.eloquence.en-GB.Grandpa",
70
+ "Grandpa (English (US))|en-US": "urn:moz-tts:osx:com.apple.eloquence.en-US.Grandpa",
71
+ "Grandpa (Finnish (Finland))|fi-FI": "urn:moz-tts:osx:com.apple.eloquence.fi-FI.Grandpa",
72
+ "Grandpa (French (Canada))|fr-CA": "urn:moz-tts:osx:com.apple.eloquence.fr-CA.Grandpa",
73
+ "Grandpa (French (France))|fr-FR": "urn:moz-tts:osx:com.apple.eloquence.fr-FR.Grandpa",
74
+ "Grandpa (German (Germany))|de-DE": "urn:moz-tts:osx:com.apple.eloquence.de-DE.Grandpa",
75
+ "Grandpa (Italian (Italy))|it-IT": "urn:moz-tts:osx:com.apple.eloquence.it-IT.Grandpa",
76
+ "Grandpa (Japanese (Japan))|ja-JP": "urn:moz-tts:osx:com.apple.eloquence.ja-JP.Grandpa",
77
+ "Grandpa (Korean (South Korea))|ko-KR": "urn:moz-tts:osx:com.apple.eloquence.ko-KR.Grandpa",
78
+ "Grandpa (Portuguese (Brazil))|pt-BR": "urn:moz-tts:osx:com.apple.eloquence.pt-BR.Grandpa",
79
+ "Grandpa (Spanish (Mexico))|es-MX": "urn:moz-tts:osx:com.apple.eloquence.es-MX.Grandpa",
80
+ "Grandpa (Spanish (Spain))|es-ES": "urn:moz-tts:osx:com.apple.eloquence.es-ES.Grandpa",
81
+ "Ioana|ro-RO": "urn:moz-tts:osx:com.apple.voice.compact.ro-RO.Ioana",
82
+ "Jacques|fr-FR": "urn:moz-tts:osx:com.apple.eloquence.fr-FR.Jacques",
83
+ "Jester|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Hysterical",
84
+ "Joana|pt-PT": "urn:moz-tts:osx:com.apple.voice.compact.pt-PT.Joana",
85
+ "Junior|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Junior",
86
+ "Kanya|th-TH": "urn:moz-tts:osx:com.apple.voice.compact.th-TH.Kanya",
87
+ "Karen|en-AU": "urn:moz-tts:osx:com.apple.voice.compact.en-AU.Karen",
88
+ "Kathy|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Kathy",
89
+ "Kyoko|ja-JP": "urn:moz-tts:osx:com.apple.voice.compact.ja-JP.Kyoko",
90
+ "Lana|hr-HR": "urn:moz-tts:osx:com.apple.voice.compact.hr-HR.Lana",
91
+ "Laura|sk-SK": "urn:moz-tts:osx:com.apple.voice.compact.sk-SK.Laura",
92
+ "Lekha|hi-IN": "urn:moz-tts:osx:com.apple.voice.compact.hi-IN.Lekha",
93
+ "Lesya|uk-UA": "urn:moz-tts:osx:com.apple.voice.compact.uk-UA.Lesya",
94
+ "Linh|vi-VN": "urn:moz-tts:osx:com.apple.voice.compact.vi-VN.Linh",
95
+ "Luciana|pt-BR": "urn:moz-tts:osx:com.apple.voice.compact.pt-BR.Luciana",
96
+ "Majed|ar-001": "urn:moz-tts:osx:com.apple.voice.compact.ar-001.Maged",
97
+ "Meijia|zh-TW": "urn:moz-tts:osx:com.apple.voice.compact.zh-TW.Meijia",
98
+ "Melina|el-GR": "urn:moz-tts:osx:com.apple.voice.compact.el-GR.Melina",
99
+ "Milena|ru-RU": "urn:moz-tts:osx:com.apple.voice.compact.ru-RU.Milena",
100
+ "Moira|en-IE": "urn:moz-tts:osx:com.apple.voice.compact.en-IE.Moira",
101
+ "Montse|ca-ES": "urn:moz-tts:osx:com.apple.voice.compact.ca-ES.Montserrat",
102
+ "Mónica|es-ES": "urn:moz-tts:osx:com.apple.voice.compact.es-ES.Monica",
103
+ "Nora|nb-NO": "urn:moz-tts:osx:com.apple.voice.compact.nb-NO.Nora",
104
+ "Ona|lt-LT": "urn:moz-tts:osx:com.apple.voice.Ona",
105
+ "Organ|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Organ",
106
+ "Paulina|es-MX": "urn:moz-tts:osx:com.apple.voice.compact.es-MX.Paulina",
107
+ "Piya|bn-IN": "urn:moz-tts:osx:com.apple.voice.compact.bn-IN.Paya",
108
+ "Ralph|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Ralph",
109
+ "Reed (Chinese (China mainland))|zh-CN": "urn:moz-tts:osx:com.apple.eloquence.zh-CN.Reed",
110
+ "Reed (Chinese (Taiwan))|zh-TW": "urn:moz-tts:osx:com.apple.eloquence.zh-TW.Reed",
111
+ "Reed (English (UK))|en-GB": "urn:moz-tts:osx:com.apple.eloquence.en-GB.Reed",
112
+ "Reed (English (US))|en-US": "urn:moz-tts:osx:com.apple.eloquence.en-US.Reed",
113
+ "Reed (Finnish (Finland))|fi-FI": "urn:moz-tts:osx:com.apple.eloquence.fi-FI.Reed",
114
+ "Reed (French (Canada))|fr-CA": "urn:moz-tts:osx:com.apple.eloquence.fr-CA.Reed",
115
+ "Reed (German (Germany))|de-DE": "urn:moz-tts:osx:com.apple.eloquence.de-DE.Reed",
116
+ "Reed (Italian (Italy))|it-IT": "urn:moz-tts:osx:com.apple.eloquence.it-IT.Reed",
117
+ "Reed (Japanese (Japan))|ja-JP": "urn:moz-tts:osx:com.apple.eloquence.ja-JP.Reed",
118
+ "Reed (Korean (South Korea))|ko-KR": "urn:moz-tts:osx:com.apple.eloquence.ko-KR.Reed",
119
+ "Reed (Portuguese (Brazil))|pt-BR": "urn:moz-tts:osx:com.apple.eloquence.pt-BR.Reed",
120
+ "Reed (Spanish (Mexico))|es-MX": "urn:moz-tts:osx:com.apple.eloquence.es-MX.Reed",
121
+ "Reed (Spanish (Spain))|es-ES": "urn:moz-tts:osx:com.apple.eloquence.es-ES.Reed",
122
+ "Rishi|en-IN": "urn:moz-tts:osx:com.apple.voice.compact.en-IN.Rishi",
123
+ "Rocko (Chinese (China mainland))|zh-CN": "urn:moz-tts:osx:com.apple.eloquence.zh-CN.Rocko",
124
+ "Rocko (Chinese (Taiwan))|zh-TW": "urn:moz-tts:osx:com.apple.eloquence.zh-TW.Rocko",
125
+ "Rocko (English (UK))|en-GB": "urn:moz-tts:osx:com.apple.eloquence.en-GB.Rocko",
126
+ "Rocko (English (US))|en-US": "urn:moz-tts:osx:com.apple.eloquence.en-US.Rocko",
127
+ "Rocko (Finnish (Finland))|fi-FI": "urn:moz-tts:osx:com.apple.eloquence.fi-FI.Rocko",
128
+ "Rocko (French (Canada))|fr-CA": "urn:moz-tts:osx:com.apple.eloquence.fr-CA.Rocko",
129
+ "Rocko (French (France))|fr-FR": "urn:moz-tts:osx:com.apple.eloquence.fr-FR.Rocko",
130
+ "Rocko (German (Germany))|de-DE": "urn:moz-tts:osx:com.apple.eloquence.de-DE.Rocko",
131
+ "Rocko (Italian (Italy))|it-IT": "urn:moz-tts:osx:com.apple.eloquence.it-IT.Rocko",
132
+ "Rocko (Japanese (Japan))|ja-JP": "urn:moz-tts:osx:com.apple.eloquence.ja-JP.Rocko",
133
+ "Rocko (Korean (South Korea))|ko-KR": "urn:moz-tts:osx:com.apple.eloquence.ko-KR.Rocko",
134
+ "Rocko (Portuguese (Brazil))|pt-BR": "urn:moz-tts:osx:com.apple.eloquence.pt-BR.Rocko",
135
+ "Rocko (Spanish (Mexico))|es-MX": "urn:moz-tts:osx:com.apple.eloquence.es-MX.Rocko",
136
+ "Rocko (Spanish (Spain))|es-ES": "urn:moz-tts:osx:com.apple.eloquence.es-ES.Rocko",
137
+ "Samantha|en-US": "urn:moz-tts:osx:com.apple.voice.compact.en-US.Samantha",
138
+ "Sandy (Chinese (China mainland))|zh-CN": "urn:moz-tts:osx:com.apple.eloquence.zh-CN.Sandy",
139
+ "Sandy (Chinese (Taiwan))|zh-TW": "urn:moz-tts:osx:com.apple.eloquence.zh-TW.Sandy",
140
+ "Sandy (English (UK))|en-GB": "urn:moz-tts:osx:com.apple.eloquence.en-GB.Sandy",
141
+ "Sandy (English (US))|en-US": "urn:moz-tts:osx:com.apple.eloquence.en-US.Sandy",
142
+ "Sandy (Finnish (Finland))|fi-FI": "urn:moz-tts:osx:com.apple.eloquence.fi-FI.Sandy",
143
+ "Sandy (French (Canada))|fr-CA": "urn:moz-tts:osx:com.apple.eloquence.fr-CA.Sandy",
144
+ "Sandy (French (France))|fr-FR": "urn:moz-tts:osx:com.apple.eloquence.fr-FR.Sandy",
145
+ "Sandy (German (Germany))|de-DE": "urn:moz-tts:osx:com.apple.eloquence.de-DE.Sandy",
146
+ "Sandy (Italian (Italy))|it-IT": "urn:moz-tts:osx:com.apple.eloquence.it-IT.Sandy",
147
+ "Sandy (Japanese (Japan))|ja-JP": "urn:moz-tts:osx:com.apple.eloquence.ja-JP.Sandy",
148
+ "Sandy (Korean (South Korea))|ko-KR": "urn:moz-tts:osx:com.apple.eloquence.ko-KR.Sandy",
149
+ "Sandy (Portuguese (Brazil))|pt-BR": "urn:moz-tts:osx:com.apple.eloquence.pt-BR.Sandy",
150
+ "Sandy (Spanish (Mexico))|es-MX": "urn:moz-tts:osx:com.apple.eloquence.es-MX.Sandy",
151
+ "Sandy (Spanish (Spain))|es-ES": "urn:moz-tts:osx:com.apple.eloquence.es-ES.Sandy",
152
+ "Sara|da-DK": "urn:moz-tts:osx:com.apple.voice.compact.da-DK.Sara",
153
+ "Satu|fi-FI": "urn:moz-tts:osx:com.apple.voice.compact.fi-FI.Satu",
154
+ "Shelley (Chinese (China mainland))|zh-CN": "urn:moz-tts:osx:com.apple.eloquence.zh-CN.Shelley",
155
+ "Shelley (Chinese (Taiwan))|zh-TW": "urn:moz-tts:osx:com.apple.eloquence.zh-TW.Shelley",
156
+ "Shelley (English (UK))|en-GB": "urn:moz-tts:osx:com.apple.eloquence.en-GB.Shelley",
157
+ "Shelley (English (US))|en-US": "urn:moz-tts:osx:com.apple.eloquence.en-US.Shelley",
158
+ "Shelley (Finnish (Finland))|fi-FI": "urn:moz-tts:osx:com.apple.eloquence.fi-FI.Shelley",
159
+ "Shelley (French (Canada))|fr-CA": "urn:moz-tts:osx:com.apple.eloquence.fr-CA.Shelley",
160
+ "Shelley (French (France))|fr-FR": "urn:moz-tts:osx:com.apple.eloquence.fr-FR.Shelley",
161
+ "Shelley (German (Germany))|de-DE": "urn:moz-tts:osx:com.apple.eloquence.de-DE.Shelley",
162
+ "Shelley (Italian (Italy))|it-IT": "urn:moz-tts:osx:com.apple.eloquence.it-IT.Shelley",
163
+ "Shelley (Japanese (Japan))|ja-JP": "urn:moz-tts:osx:com.apple.eloquence.ja-JP.Shelley",
164
+ "Shelley (Korean (South Korea))|ko-KR": "urn:moz-tts:osx:com.apple.eloquence.ko-KR.Shelley",
165
+ "Shelley (Portuguese (Brazil))|pt-BR": "urn:moz-tts:osx:com.apple.eloquence.pt-BR.Shelley",
166
+ "Shelley (Spanish (Mexico))|es-MX": "urn:moz-tts:osx:com.apple.eloquence.es-MX.Shelley",
167
+ "Shelley (Spanish (Spain))|es-ES": "urn:moz-tts:osx:com.apple.eloquence.es-ES.Shelley",
168
+ "Sinji|zh-HK": "urn:moz-tts:osx:com.apple.voice.compact.zh-HK.Sinji",
169
+ "Soumya|kn-IN": "urn:moz-tts:osx:com.apple.voice.compact.kn-IN.Alpana",
170
+ "Superstar|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Princess",
171
+ "Tara|en-IN": "urn:moz-tts:osx:com.apple.voice.Tara",
172
+ "Tessa|en-ZA": "urn:moz-tts:osx:com.apple.voice.compact.en-ZA.Tessa",
173
+ "Thomas|fr-FR": "urn:moz-tts:osx:com.apple.voice.compact.fr-FR.Thomas",
174
+ "Tina|sl-SI": "urn:moz-tts:osx:com.apple.voice.compact.sl-SI.Tina",
175
+ "Tingting|zh-CN": "urn:moz-tts:osx:com.apple.voice.compact.zh-CN.Tingting",
176
+ "Trinoids|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Trinoids",
177
+ "Tünde|hu-HU": "urn:moz-tts:osx:com.apple.voice.compact.hu-HU.Mariska",
178
+ "Vani|ta-IN": "urn:moz-tts:osx:com.apple.voice.compact.ta-IN.Vani",
179
+ "Whisper|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Whisper",
180
+ "Wobble|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Deranged",
181
+ "Xander|nl-NL": "urn:moz-tts:osx:com.apple.voice.compact.nl-NL.Xander",
182
+ "Yelda|tr-TR": "urn:moz-tts:osx:com.apple.voice.compact.tr-TR.Yelda",
183
+ "Yuna|ko-KR": "urn:moz-tts:osx:com.apple.voice.compact.ko-KR.Yuna",
184
+ "Zarvox|en-US": "urn:moz-tts:osx:com.apple.speech.synthesis.voice.Zarvox",
185
+ "Zosia|pl-PL": "urn:moz-tts:osx:com.apple.voice.compact.pl-PL.Zosia",
186
+ "Zuzana|cs-CZ": "urn:moz-tts:osx:com.apple.voice.compact.cs-CZ.Zuzana"
187
+ }
188
+ }
@@ -0,0 +1,146 @@
1
+ navigator: >-
2
+ Manually setting navigator properties is not recommended.
3
+ Device information is automatically generated within Camoufox
4
+ based on the provided `os`.
5
+
6
+ locale: >-
7
+ Use the `locale` parameter in Camoufox instead of setting the config manually.
8
+
9
+ geolocation: >-
10
+ Please use the `geoip` parameter in Camoufox instead of setting your geolocation manually.
11
+ This can lead to detection if your target geolocation does not match your IP.
12
+ Pass `geoip=True` or a target IP (ex: geoip='123.45.67.89') to let Camoufox populate this data for you.
13
+
14
+ header-ua: >-
15
+ Do not set the header.User-Agent manually. Camoufox will generate a User-Agent for you.
16
+
17
+ viewport: >-
18
+ Manually setting screen & window properties is not recommended.
19
+ Screen dimensions are randomly generated within Camoufox
20
+ based on the provided screen constraints.
21
+
22
+ custom_fingerprint: >-
23
+ Passing your own fingerprint is not recommended.
24
+ Fingerprints are automatically generated within Camoufox
25
+ based on the provided `os` and `screen` constraints.
26
+
27
+ proxy_without_geoip: >-
28
+ When using a proxy, it is heavily recommended that you pass `geoip=True`.
29
+
30
+ proxy_http_no_udp: >-
31
+ An HTTP proxy carries no UDP, so WebRTC and HTTP/3 behave as on a machine whose firewall drops all UDP (no
32
+ server-reflexive candidate, STUN that never answers), which sites can tell from an ordinary user.
33
+ Use a SOCKS5 proxy that supports UDP ASSOCIATE (`socks5://...`): WebRTC and HTTP/3 then leave from the proxy's exit.
34
+
35
+ ipv6_elsewhere: >-
36
+ This machine's IPv6 address geolocates somewhere other than the IPv4 address the identity was drawn from,
37
+ so the browser behaves as on an IPv4-only network and sites that only have an IPv6 address will not load.
38
+ A VPN that tunnels only IPv4 is the usual cause. Use a proxy, or route IPv6 through the VPN as well.
39
+
40
+ ff_version: >-
41
+ Spoofing the Firefox version will likely lead to detection.
42
+ If rotating the Firefox version is absolutely necessary, it would be more advisable to
43
+ rotate between older versions of Camoufox instead.
44
+
45
+ instant_animations: >-
46
+ instantAnimations makes every finite animation finish at once, so Playwright
47
+ never waits on one. A page can see it: getComputedTiming() reports a duration
48
+ of 0 where stock Firefox reports the real one.
49
+
50
+ context_proxy_without_launch_proxy: >-
51
+ This browser was launched without a proxy, so its own traffic, which belongs
52
+ to no context (the push connection every context shares), goes through the
53
+ first proxied context's proxy for the browser's life. Pass a launch-level
54
+ `proxy` to choose where it goes.
55
+
56
+ is_mobile: >-
57
+ Camoufox is built for desktops and only draws desktop identities, so is_mobile
58
+ cannot produce a believable phone and will leak: the page still sees a desktop
59
+ User-Agent, platform, fonts, GPU and screen. Camoufox ignores is_mobile rather
60
+ than put the page in Responsive Design Mode, which a page can read too.
61
+ Use has_touch, device_scale_factor and viewport for the parts you need.
62
+
63
+ viewport_screen: >-
64
+ A {viewport} viewport does not fit the {screen} screen this {os} context claims:
65
+ a real Firefox window draws {chrome} px of chrome around the page, and the
66
+ screen keeps {taskbar} px for the taskbar. A page can measure that, and no real
67
+ device shows it. Camoufox draws a screen that holds the viewport when a new
68
+ context asks for one; {reason}.
69
+
70
+ viewport_window: >-
71
+ A {viewport} viewport is larger than the {window} browser window its page
72
+ reports in outerWidth/outerHeight: a page larger than its own window exists on
73
+ no real device. A context cannot resize the browser's window, so give it the
74
+ window at launch (window=, or the viewport with launch_persistent_context), or
75
+ leave the context on no_viewport.
76
+
77
+ block_webgl: >-
78
+ Disabling WebGL is not recommended. Many WAFs will check if WebGL is enabled.
79
+
80
+ canvas_noise: >-
81
+ Canvas and WebGL readback return random data, as privacy.resistFingerprinting
82
+ does in LibreWolf, Tor Browser and Mullvad Browser. Stock Firefox does not
83
+ do this, so the browser reads as a privacy-hardened Firefox. It is on because
84
+ the identity claims another OS or GPU than this machine's, whose canvas would
85
+ show the real one. Pass `canvas_noise=False` to keep stock canvas behaviour.
86
+
87
+ gpu_software_rendering: >-
88
+ The browser on the headless="virtual-gpu" display never rendered on the GPU, so it
89
+ renders canvas and WebGL in software, which a page can tell from the GPU the
90
+ identity claims. Pass `require_gpu=True` (the default) to fail the launch instead.
91
+
92
+ block_images: >-
93
+ Blocking image requests has been reported to cause detection issues on major WAFs.
94
+
95
+ custom_fonts_only: >-
96
+ Disabling OS-specific fonts while spoofing your OS will make your browser fingerprint inconsistent.
97
+ WAFs can detect this mismatch between your claimed OS and available system fonts.
98
+
99
+ disable_coop: >-
100
+ Disabling Cross-Origin-Opener-Policy (COOP) handling can potentially be detected by sophisticated WAFs.
101
+
102
+ max_touch_points: >-
103
+ Setting navigator.maxTouchPoints manually overrides Camoufox's touchscreen handling.
104
+ A non-zero value presents a touch digitizer: Camoufox adds `(any-pointer: coarse)` and
105
+ the TouchEvent/Touch interfaces to match a touchscreen laptop, while deliberately leaving
106
+ `(pointer: coarse)` false and `ontouchstart` absent, exactly as a real one does.
107
+ The rest of your fingerprint is not adjusted to suit, so a device that claims a digitizer
108
+ but reports a screen size no touchscreen laptop ships with is still inconsistent.
109
+
110
+ fallback: |-
111
+ {what} failed, so this identity uses {instead} instead.
112
+ A substitute is not drawn to match the rest of the identity, and a page may be able to tell.
113
+ Please report this at https://github.com/daijro/camoufox/issues/new and include:
114
+
115
+ {report}
116
+
117
+ audio_seed_removed: >-
118
+ `audio:seed` has been removed and is ignored. Audio is now rendered exactly as
119
+ stock Firefox renders it: stock gives one value per CPU architecture, so noise
120
+ was a tell, not a disguise (ci/tribal-rules.yml: audio-is-not-noised).
121
+
122
+ humanize_remote: >-
123
+ humanize runs on a remote browser. Each event myuri plays is a round trip over the network,
124
+ so network jitter lands between the events. Run the driver next to the browser to avoid it.
125
+
126
+ addon_not_bundled: >-
127
+ This Camoufox build has no {addon} addon at {path}, so it launches without it.
128
+ Browser releases bundle their default addons; an older release or an unpackaged build does not.
129
+ Install a current release with `camoufox fetch` (for a local build, `make stage-ubo`),
130
+ or list {addon} in exclude_addons to leave it out on purpose.
131
+
132
+ no_h264_encoder: >-
133
+ This Linux host has no system FFmpeg (libavcodec), so the browser cannot encode H.264 and
134
+ WebCodecs reports avc1 encoding unsupported, which Windows Firefox never does.
135
+ Install it (Debian/Ubuntu: `apt install libavcodec60` or the release's libavcodecNN; Fedora: ffmpeg-libs
136
+ from RPM Fusion, which includes libx264).
137
+
138
+ caller_value_incoherent: >-
139
+ LEAK: config sets {keys}, which no real machine presents together with the rest of this identity
140
+ ({detail}). Camoufox launches with the value you passed, but a page that checks these values against each other
141
+ can tell this browser is not the machine it claims to be. Leave {keys} out of config to have a coherent value drawn.
142
+ i_know_what_im_doing does not silence this warning.
143
+
144
+ voices_unread: >-
145
+ This browser build cannot read voices:speechd, so a Linux identity reports no voices.
146
+ Run `camoufox set --release` for the paired build, or pass `voices` in config.
@@ -0,0 +1,21 @@
1
+ export declare const DISPLAY_PROFILE_PREF = "gfx.color_management.display_profile";
2
+ /** ICC bytes or a path, false (the browser's own), or undefined/true (drawn). */
3
+ export type DisplayProfileOption = Uint8Array | string | boolean | null | undefined;
4
+ /** display-profiles.json: OS key -> recorded profiles. */
5
+ export declare function loadDisplayProfiles(): Record<string, any>;
6
+ /** Seams for tests: the table and where profiles are written. */
7
+ export declare const displayProfileDeps: {
8
+ table: typeof loadDisplayProfiles;
9
+ cacheDirs: (installDir: string) => string[];
10
+ };
11
+ /** `data` if it is an ICC profile (its declared size fits, "acsp" at 36), else throws. */
12
+ export declare function checkIcc(data: Uint8Array): Uint8Array;
13
+ /** The identity's screen in device pixels: CSS screen size times devicePixelRatio. */
14
+ export declare function deviceScreen(config: Record<string, any>): number[] | null;
15
+ /** The recorded profile an identity of `targetOs` with this screen draws, or null (built-in sRGB). */
16
+ export declare function drawDisplayProfile(config: Record<string, any>, seed: number, targetOs: string): Uint8Array | null;
17
+ /**
18
+ * Point gfx.color_management.display_profile at the identity's display
19
+ * profile. A caller's own pref wins. Returns the path set, or null.
20
+ */
21
+ export declare function applyDisplayProfile(prefs: Record<string, any>, userPrefKeys: Set<string>, option: DisplayProfileOption, config: Record<string, any>, seed: number, targetOs: string, hostOs: string | null, installDir: string): string | null;
@@ -0,0 +1,129 @@
1
+ /**
2
+ * The display's ICC colour profile, which a page reads through every
3
+ * ICC-tagged image it decodes. The TS twin of display_profile.py; see there
4
+ * for the measurements.
5
+ *
6
+ * Firefox converts tagged images (gfx.color_management.mode 2) to the
7
+ * display's profile: the OS's, or the file gfx.color_management.display_profile
8
+ * names, which every platform reads first. Stock 158.0.1 on win-i9 (a
9
+ * wide-gamut panel profile) decodes sRGB red as 217,54,41; a Linux host with no
10
+ * _ICC_PROFILE keeps built-in sRGB (255,0,0). An identity of another OS
11
+ * carries its display's profile: the caller's (`display_profile`), or one drawn
12
+ * from display-profiles.json for its OS and device-pixel screen.
13
+ */
14
+ import { createHash } from "node:crypto";
15
+ import * as fs from "node:fs";
16
+ import * as os from "node:os";
17
+ import * as path from "node:path";
18
+ import * as random from "python-random";
19
+ import { loadDataFile } from "./paths.js";
20
+ export const DISPLAY_PROFILE_PREF = "gfx.color_management.display_profile";
21
+ let tableCache;
22
+ /** display-profiles.json: OS key -> recorded profiles. */
23
+ export function loadDisplayProfiles() {
24
+ tableCache ??= loadDataFile("display-profiles.json");
25
+ return tableCache;
26
+ }
27
+ /** Seams for tests: the table and where profiles are written. */
28
+ export const displayProfileDeps = {
29
+ table: loadDisplayProfiles,
30
+ cacheDirs: (installDir) => [
31
+ path.join(installDir, "display-profiles"),
32
+ path.join(os.tmpdir(), "camoufox-display-profiles"),
33
+ ],
34
+ };
35
+ /** `data` if it is an ICC profile (its declared size fits, "acsp" at 36), else throws. */
36
+ export function checkIcc(data) {
37
+ const b = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
38
+ if (b.length < 132 ||
39
+ b.toString("latin1", 36, 40) !== "acsp" ||
40
+ b.readUInt32BE(0) > b.length)
41
+ throw new Error("display_profile is not an ICC profile");
42
+ return data;
43
+ }
44
+ /** The identity's screen in device pixels: CSS screen size times devicePixelRatio. */
45
+ export function deviceScreen(config) {
46
+ const w = config["screen.width"];
47
+ const h = config["screen.height"];
48
+ if (!w || !h)
49
+ return null;
50
+ const dpr = Number(config["window.devicePixelRatio"] || 1);
51
+ // Python's round(): half to even.
52
+ const pyRound = (v) => {
53
+ const f = Math.floor(v);
54
+ const d = v - f;
55
+ return d > 0.5 || (d === 0.5 && f % 2 !== 0) ? f + 1 : f;
56
+ };
57
+ return [pyRound(w * dpr), pyRound(h * dpr)];
58
+ }
59
+ function weightedChoice(r, items) {
60
+ const w = (item) => Object.hasOwn(item, "w") ? Number(item.w) : 1;
61
+ let x = r.random() * items.reduce((a, item) => a + w(item), 0);
62
+ for (const item of items) {
63
+ x -= w(item);
64
+ if (x < 0)
65
+ return item;
66
+ }
67
+ return items[items.length - 1];
68
+ }
69
+ /** The recorded profile an identity of `targetOs` with this screen draws, or null (built-in sRGB). */
70
+ export function drawDisplayProfile(config, seed, targetOs) {
71
+ const entries = displayProfileDeps.table()[targetOs] ?? [];
72
+ const screen = deviceScreen(config);
73
+ const panels = entries.filter((e) => e.screens?.length &&
74
+ screen &&
75
+ e.screens.some((s) => s[0] === screen[0] && s[1] === screen[1]));
76
+ const pool = panels.length
77
+ ? panels
78
+ : entries.filter((e) => !e.screens?.length);
79
+ if (!pool.length)
80
+ return null;
81
+ const chosen = weightedChoice(new random.Random((seed ^ 0xc01c) >>> 0), pool);
82
+ return Buffer.from(chosen.icc, "base64");
83
+ }
84
+ /** The profile's path in the cache (content-addressed, written once). */
85
+ function writeProfile(data, installDir) {
86
+ const name = `${createHash("sha256").update(data).digest("hex").slice(0, 24)}.icc`;
87
+ for (const base of displayProfileDeps.cacheDirs(installDir)) {
88
+ const file = path.join(base, name);
89
+ try {
90
+ if (!fs.existsSync(file) ||
91
+ !Buffer.from(data).equals(fs.readFileSync(file))) {
92
+ fs.mkdirSync(base, { recursive: true });
93
+ const tmp = path.join(base, `.${name}.${process.pid}`);
94
+ fs.writeFileSync(tmp, data);
95
+ fs.renameSync(tmp, file);
96
+ }
97
+ return file;
98
+ }
99
+ catch {
100
+ // next directory
101
+ }
102
+ }
103
+ throw new Error("no writable directory for the display profile");
104
+ }
105
+ /**
106
+ * Point gfx.color_management.display_profile at the identity's display
107
+ * profile. A caller's own pref wins. Returns the path set, or null.
108
+ */
109
+ export function applyDisplayProfile(prefs, userPrefKeys, option, config, seed, targetOs, hostOs, installDir) {
110
+ if (userPrefKeys.has(DISPLAY_PROFILE_PREF) || option === false)
111
+ return null;
112
+ let data;
113
+ if (option === undefined || option === null || option === true) {
114
+ if (targetOs === hostOs)
115
+ return null;
116
+ data = drawDisplayProfile(config, seed, targetOs);
117
+ if (!data)
118
+ return null;
119
+ }
120
+ else if (typeof option === "string") {
121
+ data = fs.readFileSync(option.replace(/^~(?=$|\/)/, os.homedir()));
122
+ }
123
+ else {
124
+ data = option;
125
+ }
126
+ const file = writeProfile(checkIcc(data), installDir);
127
+ prefs[DISPLAY_PROFILE_PREF] = file;
128
+ return file;
129
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Driver calls that reach the page as a person's actions would. The TypeScript
3
+ * twin of python/camoucore/src/camoucore/camoufox/driver_defaults.py, which holds the reasoning.
4
+ *
5
+ * Screenshots default to caret: "initial", which leaves the page's style
6
+ * attributes alone. fill() clicks a text field that is not focused first, unless
7
+ * something covers it. Both apply only under a Browser or BrowserContext marked
8
+ * by a Camoufox launch (attachDriverDefaults), as does the warning when
9
+ * setViewportSize() asks for a page the context's claimed screen or window
10
+ * cannot hold (checkPageViewportSize in utils.ts).
11
+ */
12
+ export declare const FILL_NEEDS_CLICK = "(e) => {\n const field = e.matches('a, input, textarea, button, select') || e.isContentEditable\n ? e : (e.closest('label')?.control || e);\n const type = field.localName === 'input' ? field.type : null;\n const typed = field.localName === 'textarea' || field.isContentEditable ||\n ['text', 'search', 'email', 'url', 'tel', 'password', 'number'].includes(type);\n if (!typed || field.disabled || field.readOnly)\n return false;\n const active = field.getRootNode().activeElement;\n return active !== field && !(field.isContentEditable && field.contains(active));\n}";
13
+ /**
14
+ * The JS client sends a string as an expression and does not call what it
15
+ * evaluates to (isFunction: false), where Python's lets the page decide. A
16
+ * function whose source is the string is sent and called.
17
+ */
18
+ export declare function pageFunction(source: string): () => unknown;
19
+ /** Page, Locator and Frame fill (and Locator.clear) all go through Frame.fill. */
20
+ export declare function patchFrameFill(prototype: any): void;
21
+ /**
22
+ * Give every page under `target` (a Browser or BrowserContext from a Camoufox
23
+ * launch) these defaults. The caret is filled in where the client sends the
24
+ * request, so page, element and locator screenshots all get it; an explicit
25
+ * caret is kept.
26
+ */
27
+ export declare function attachDriverDefaults<T>(target: T): T;
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Driver calls that reach the page as a person's actions would. The TypeScript
3
+ * twin of python/camoucore/src/camoucore/camoufox/driver_defaults.py, which holds the reasoning.
4
+ *
5
+ * Screenshots default to caret: "initial", which leaves the page's style
6
+ * attributes alone. fill() clicks a text field that is not focused first, unless
7
+ * something covers it. Both apply only under a Browser or BrowserContext marked
8
+ * by a Camoufox launch (attachDriverDefaults), as does the warning when
9
+ * setViewportSize() asks for a page the context's claimed screen or window
10
+ * cannot hold (checkPageViewportSize in utils.ts).
11
+ */
12
+ import { HIT_TEST_JS } from "@jwriter20/myuri";
13
+ import { checkPageViewportSize } from "./utils.js";
14
+ const LAUNCHED = Symbol.for("camoufox.driver-defaults");
15
+ const FILL_PATCHED = Symbol.for("camoufox.driver-defaults.fill");
16
+ // Byte-identical to the Python constant (tests/package-parity.test.ts).
17
+ // Whether fill() on this target should click first: a text field a person types
18
+ // into, without focus. fill() on a label, or inside one, fills its control.
19
+ export const FILL_NEEDS_CLICK = `(e) => {
20
+ const field = e.matches('a, input, textarea, button, select') || e.isContentEditable
21
+ ? e : (e.closest('label')?.control || e);
22
+ const type = field.localName === 'input' ? field.type : null;
23
+ const typed = field.localName === 'textarea' || field.isContentEditable ||
24
+ ['text', 'search', 'email', 'url', 'tel', 'password', 'number'].includes(type);
25
+ if (!typed || field.disabled || field.readOnly)
26
+ return false;
27
+ const active = field.getRootNode().activeElement;
28
+ return active !== field && !(field.isContentEditable && field.contains(active));
29
+ }`;
30
+ /**
31
+ * The JS client sends a string as an expression and does not call what it
32
+ * evaluates to (isFunction: false), where Python's lets the page decide. A
33
+ * function whose source is the string is sent and called.
34
+ */
35
+ export function pageFunction(source) {
36
+ return Object.assign(() => undefined, { toString: () => source });
37
+ }
38
+ async function clickToFocus(target, evaluate, { timeout, force }) {
39
+ if (await evaluate(pageFunction(FILL_NEEDS_CLICK))) {
40
+ await target.scrollIntoViewIfNeeded({ timeout });
41
+ if ((await evaluate(HIT_TEST_JS)) === null)
42
+ await target.click({ timeout, force });
43
+ }
44
+ }
45
+ /** Page, Locator and Frame fill (and Locator.clear) all go through Frame.fill. */
46
+ export function patchFrameFill(prototype) {
47
+ if (Object.hasOwn(prototype, FILL_PATCHED))
48
+ return;
49
+ prototype[FILL_PATCHED] = true;
50
+ const original = prototype.fill;
51
+ prototype.fill = async function (selector, value, options = {}) {
52
+ if (launchedByCamoufox(this)) {
53
+ const locator = this.locator(selector);
54
+ const target = options.strict ? locator : locator.first();
55
+ await clickToFocus(target, (script) => target.evaluate(script, null, { timeout: options.timeout }), options);
56
+ }
57
+ return original.call(this, selector, value, options);
58
+ };
59
+ }
60
+ function patchHandleFill(prototype) {
61
+ if (Object.hasOwn(prototype, FILL_PATCHED))
62
+ return;
63
+ prototype[FILL_PATCHED] = true;
64
+ const original = prototype.fill;
65
+ prototype.fill = async function (value, options = {}) {
66
+ if (launchedByCamoufox(this))
67
+ await clickToFocus(this, (script) => this.evaluate(script, null), options);
68
+ return original.call(this, value, options);
69
+ };
70
+ }
71
+ /** playwright-core does not export its client classes, so they are taken from
72
+ * the objects its connection creates. */
73
+ function patchClientClass(object) {
74
+ if (object._type === "Frame")
75
+ patchFrameFill(Object.getPrototypeOf(object));
76
+ if (object._type === "ElementHandle")
77
+ patchHandleFill(Object.getPrototypeOf(object));
78
+ }
79
+ /**
80
+ * Give every page under `target` (a Browser or BrowserContext from a Camoufox
81
+ * launch) these defaults. The caret is filled in where the client sends the
82
+ * request, so page, element and locator screenshots all get it; an explicit
83
+ * caret is kept.
84
+ */
85
+ export function attachDriverDefaults(target) {
86
+ const owner = target;
87
+ owner[LAUNCHED] = true;
88
+ const connection = owner._connection;
89
+ if (!connection || connection[LAUNCHED])
90
+ return target;
91
+ connection[LAUNCHED] = true;
92
+ const send = connection.sendMessageToServer;
93
+ connection.sendMessageToServer = function (object, method, params, ...rest) {
94
+ if (launchedByCamoufox(object)) {
95
+ if (method === "setViewportSize")
96
+ checkPageViewportSize(object, params?.viewportSize);
97
+ if (method === "screenshot" && params?.caret === undefined)
98
+ params = { ...params, caret: "initial" };
99
+ }
100
+ return send.call(this, object, method, params, ...rest);
101
+ };
102
+ // A persistent context arrives with its pages, and so its frames, created.
103
+ for (const object of connection._objects.values())
104
+ patchClientClass(object);
105
+ const create = connection._createRemoteObject;
106
+ connection._createRemoteObject = function (...args) {
107
+ const object = create.apply(this, args);
108
+ patchClientClass(object);
109
+ return object;
110
+ };
111
+ return target;
112
+ }
113
+ /** ElementHandle -> Frame -> Page -> BrowserContext -> Browser. */
114
+ function launchedByCamoufox(object) {
115
+ for (let owner = object; owner; owner = owner._parent)
116
+ if (owner[LAUNCHED])
117
+ return true;
118
+ return false;
119
+ }