Skip to content

Commit

Permalink
Merge branch 'main' into detect-web-workers
Browse files Browse the repository at this point in the history
  • Loading branch information
f1234k authored Oct 30, 2023
2 parents 16c429f + f6123f2 commit 4abd6ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/is-browser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const isBrowser =
(typeof window !== 'undefined' && typeof window.document !== 'undefined') ||
// eslint-disable-next-line no-restricted-globals
(typeof self === 'object' && self.constructor && self.constructor.name === 'DedicatedWorkerGlobalScope') // is web worker
(typeof self === 'object' && self.constructor && self.constructor.name === 'DedicatedWorkerGlobalScope') || // is web worker
(typeof navigator !== 'undefined' && navigator.product === 'ReactNative') // while navigator.product is deprecated

export default isBrowser

0 comments on commit 4abd6ba

Please sign in to comment.