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

override user agent metadata and other fixes #29

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Update navigator.userAgent.js
support msedge (HeadlessEdg/)
  • Loading branch information
erma0 authored Apr 19, 2024
commit bb8af62f1715bc51dfa7ea0e8d40b0b40b6a738a
2 changes: 1 addition & 1 deletion playwright_stealth/js/navigator.userAgent.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// replace Headless references in default useragent
const current_ua = navigator.userAgent
Object.defineProperty(Object.getPrototypeOf(navigator), 'userAgent', {
get: () => opts.navigator_user_agent || current_ua.replace('HeadlessChrome/', 'Chrome/')
get: () => opts.navigator_user_agent || current_ua.replace('Headless', '')
})