Skip to content

Commit fa2237f

Browse files
authored
fix(devtool): improve devtools late injection browser env detection (#4890)
1 parent e1ee3c4 commit fa2237f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/runtime-core/src/devtools.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ export function setDevtoolsHook(hook: DevtoolsHook, target: any) {
5555
// (#4815)
5656
// eslint-disable-next-line no-restricted-globals
5757
typeof window !== 'undefined' &&
58-
!navigator.userAgent.includes('jsdom')
58+
// some envs mock window but not fully
59+
window.HTMLElement &&
60+
// also exclude jsdom
61+
!window.navigator?.userAgent?.includes('jsdom')
5962
) {
6063
const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
6164
target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [])

0 commit comments

Comments
 (0)