Skip to content

How to detect happy-dom environment? #481

Closed Answered by capricorn86
diegohaz asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @diegohaz! 🙂

It is possible to detect that it is an Happy DOM environment by checking if window.happyDOM is defined.

Example

if(window.happyDOM) {
    // Do something
}

I have added the issue #482 for adding it to navigation.userAgent as well.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by capricorn86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants