microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.91k stars 3.67k forks source link

[Bug]: User Agent not obtainable: Page.evaluate: ReferenceError: opts is not defined #33529

Closed wh1t3h47 closed 3 days ago

wh1t3h47 commented 3 days ago

Version

1.47.0

Steps to reproduce

  1. Launch chromium
  2. Run page.evaluate("navigator.userAgent")

Python Issue.

Expected behavior

I expect to get the user agent serialized as a string

Actual behavior

The playwright crashes

Additional context

I found this issue here as well: https://github.com/davidteather/TikTok-Api/issues/1172

Environment

playwright==1.47.0
Linux debian 6.6.15-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.6.15-2kali1 (2024-05-17) x86_64 GNU/Linux
Model name:            Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
Python 3.11.9
Using virtualenv
wh1t3h47 commented 3 days ago

This is associated with stealth plugin, I observed that disabling it, makes this work again.