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

setting screen.width, screen.height is invalid #89

Closed
winner-hue opened this issue Nov 19, 2024 · 6 comments
Closed

setting screen.width, screen.height is invalid #89

winner-hue opened this issue Nov 19, 2024 · 6 comments
Labels
detection issue Potential leak in Camoufox.

Comments

@winner-hue
Copy link

camoufox = 0.3.10, firefox=132
website: https://www.browserscan.net/
code:
class ScreenInfo(Screen):
min_width = 1055
max_width = 1920
min_height = 960
max_height = 1080

fg = FingerprintGenerator()
fire = fg.generate(screen=ScreenInfo(), os='windows', browser='firefox', device='desktop')
fire.videoCard.vendor = 'Google Inc. (Intel)'
fire.videoCard.renderer = 'ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0), or similar'
fire.screen.width = 1920
fire.screen.height = 1080

with Camoufox(
geoip=True,
proxy={
"server": "http://127.0.0.1:7890",
"username": None,
"password": None
},
os=["windows", "macos", "linux"],
allow_webgl=True,
i_know_what_im_doing=True,
# humanize=2.0,
fingerprint=fire,
config={
"navigator.language": "en",
"navigator.languages": ["en", 'en'],
"screen.width": 1920,
"screen.height": 1080,
"window.outerHeight": 1040,
"window.outerWidth": 1920,
'webrtc:ipv4': '188.253.4.94',
'webrtc:ipv6': '',
"timezone": "Asia/Singapore"
# "webgl.disable": True
},
screen=Screen(min_width=1920, min_height=1080, max_width=1920, max_height=1080),
window=(1920, 1080)
) as browser:
page = browser.new_page()
page.goto("https://www.browserscan.net/")

screenshot:
image

question:
I have tried many times, but the width and height of the screen cannot be changed. How should I deal with this?

@winner-hue winner-hue added the detection issue Potential leak in Camoufox. label Nov 19, 2024
@winner-hue
Copy link
Author

also,I modified the GPU information and it didn't take effect
image

@daijro
Copy link
Owner

daijro commented Nov 19, 2024

Hello,

  • Manually passing in BrowserForge fingerprints is deprecated (this will typically raise a warning when i_know_what_im_doing is disabled). This can cause some unexpected inconsistencies.
    • Camoufox doesn't use all of BrowserForge's fingerprint data. If you'd like to set the WebGL renderer and vendor, this can be done through the config properties here. However, your true GPU can still be detected through your WebGL parameters, shader percisions, and context attributes (CreepJS detects this). Because of this, WebGL isn't enabled by default in Camoufox and isn't recommended to use.
  • Setting the screen width and height doesn't set the screen's avaliable width and height, which can cause mismatch leaks. The Python library typically will handle this on its own. Although, if you'd like to see a full set of the config sent to Camoufox to avoid mismatches, you can enable debug=True.

@daijro daijro closed this as completed Nov 19, 2024
@winner-hue
Copy link
Author

Regarding setting the width and height of the screen, I understand that you may have misunderstood what I meant.

@winner-hue
Copy link
Author

I set the width and height of the screen, and its configuration information is as follows:
[DEBUG] Config:
{'fonts': ['Arial',
'Arial Black',
'Bahnschrift',
'Calibri',
'Calibri Light',
'Cambria',
'Cambria Math',
'Candara',
'Candara Light',
'Comic Sans MS',
'Consolas',
'Constantia',
'Corbel',
'Corbel Light',
'Courier New',
'Ebrima',
'Franklin Gothic Medium',
'Gabriola',
'Gadugi',
'Georgia',
'HoloLens MDL2 Assets',
'Impact',
'Ink Free',
'Javanese Text',
'Leelawadee UI',
'Leelawadee UI Semilight',
'Lucida Console',
'Lucida Sans Unicode',
'MS Gothic',
'MS PGothic',
'MS UI Gothic',
'MV Boli',
'Malgun Gothic',
'Malgun Gothic Semilight',
'Marlett',
'Microsoft Himalaya',
'Microsoft JhengHei',
'Microsoft JhengHei Light',
'Microsoft JhengHei UI',
'Microsoft JhengHei UI Light',
'Microsoft New Tai Lue',
'Microsoft PhagsPa',
'Microsoft Sans Serif',
'Microsoft Tai Le',
'Microsoft YaHei',
'Microsoft YaHei Light',
'Microsoft YaHei UI',
'Microsoft YaHei UI Light',
'Microsoft Yi Baiti',
'MingLiU-ExtB',
'MingLiU_HKSCS-ExtB',
'Mongolian Baiti',
'Myanmar Text',
'NSimSun',
'Nirmala UI',
'Nirmala UI Semilight',
'PMingLiU-ExtB',
'Palatino Linotype',
'Segoe Fluent Icons',
'Segoe MDL2 Assets',
'Segoe Print',
'Segoe Script',
'Segoe UI',
'Segoe UI Black',
'Segoe UI Emoji',
'Segoe UI Historic',
'Segoe UI Light',
'Segoe UI Semibold',
'Segoe UI Semilight',
'Segoe UI Symbol',
'Segoe UI Variable',
'SimSun',
'SimSun-ExtB',
'Sitka',
'Sitka Text',
'Sylfaen',
'Symbol',
'Tahoma',
'Times New Roman',
'Trebuchet MS',
'Twemoji Mozilla',
'Verdana',
'Webdings',
'Wingdings',
'Yu Gothic',
'Yu Gothic Light',
'Yu Gothic Medium',
'Yu Gothic UI',
'Yu Gothic UI Light',
'Yu Gothic UI Semibold',
'Yu Gothic UI Semilight',
'宋体',
'微軟正黑體',
'微軟正黑體 Light',
'微软雅黑',
'微软雅黑 Light',
'新宋体',
'新細明體-ExtB',
'游ゴシック',
'游ゴシック Light',
'游ゴシック Medium',
'細明體-ExtB',
'細明體_HKSCS-ExtB',
'맑은 고딕',
'맑은 고딕 Semilight',
'MS ゴシック',
'MS Pゴシック'],
'fonts:spacing_seed': 860520826,
'geolocation:latitude': 1.2868,
'geolocation:longitude': 103.8503,
'headers.Accept-Encoding': 'gzip, deflate, br, zstd',
'locale:language': 'en',
'locale:region': 'AU',
'locale:script': 'Latn',
'navigator.appCodeName': 'Mozilla',
'navigator.appName': 'Netscape',
'navigator.appVersion': '5.0 (Windows)',
'navigator.doNotTrack': 'unspecified',
'navigator.hardwareConcurrency': 4,
'navigator.oscpu': 'Windows NT 10.0; Win64; x64',
'navigator.platform': 'Win32',
'navigator.product': 'Gecko',
'navigator.productSub': '20030107',
'navigator.userAgent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) '
'Gecko/20100101 Firefox/132.0',
'screen.availHeight': 1032,
'screen.availWidth': 1920,
'screen.colorDepth': 24,
'screen.height': 1080,
'screen.pixelDepth': 24,
'screen.width': 1920,
'timezone': 'Asia/Singapore',
'webrtc:ipv4': '188.253.4.94',
'window.history.length': 3,
'window.outerHeight': 1032,
'window.outerWidth': 1298,
'window.screenX': 498,
'window.screenY': 0},
However, the screen.width and screen.height used by the page are not what I set:
image

@winner-hue winner-hue changed the title setting screen.width, screen.height is invalid setting screen.width, screen.height is invalid Nov 20, 2024
@daijro daijro reopened this Nov 22, 2024
@daijro
Copy link
Owner

daijro commented Nov 22, 2024

Thanks. I see the issue, it doesn't look like it always sets properly. I'll look into it this weekend.

@daijro
Copy link
Owner

daijro commented Dec 4, 2024

Fixed in latest release.

@daijro daijro closed this as completed Dec 4, 2024
budyaya pushed a commit to budyaya/camoufox that referenced this issue Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
detection issue Potential leak in Camoufox.
Projects
None yet
Development

No branches or pull requests

3 participants
@winner-hue @daijro and others