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

Fix problems with the userAgent implementation #1067

Closed
capricorn86 opened this issue Sep 14, 2023 · 0 comments · Fixed by #1068
Closed

Fix problems with the userAgent implementation #1067

capricorn86 opened this issue Sep 14, 2023 · 0 comments · Fixed by #1068
Assignees
Labels
enhancement New feature or request

Comments

@capricorn86
Copy link
Owner

capricorn86 commented Sep 14, 2023

There are a bunch of problems with the user agent that we need to resolve.

1. Be able to detect Happy DOM as a user agent
Add "HappyDOM/v{version}" to the default user agent, where {version} is the current version package.json.

2. Make it possible to pass user agent as an option
Make it possible to pass "userAgent" as an option to the Window constructor.

3. Resolve issues with React console warnings
This is related to facebook/react#24283

We want to disable the "Download the React DevTools" log for a better development experience" log entries somehow in Jest and Vitest.

We should consider changing the user agent to be more similar to JSDOM ("Mozilla/5.0 (linux) AppleWebKit/537.36 (KHTML, like Gecko).

Another option is to default to a different user agent in Vitest and Jest.

@capricorn86 capricorn86 added the enhancement New feature or request label Sep 14, 2023
@capricorn86 capricorn86 changed the title Make it possible to pass "userAgent" as an option to the Window constructor Fix problems with the userAgent implementation Sep 14, 2023
@capricorn86 capricorn86 self-assigned this Sep 15, 2023
@capricorn86 capricorn86 linked a pull request Sep 15, 2023 that will close this issue
capricorn86 added a commit that referenced this issue Sep 15, 2023
…-the-useragent-implementation

#1067@major: Changes the default user agent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant