Skip to content

Commit

Permalink
fix(devtool): improve devtools late injection browser env detection (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyuang authored Nov 15, 2021
1 parent e1ee3c4 commit fa2237f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/runtime-core/src/devtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ export function setDevtoolsHook(hook: DevtoolsHook, target: any) {
// (#4815)
// eslint-disable-next-line no-restricted-globals
typeof window !== 'undefined' &&
!navigator.userAgent.includes('jsdom')
// some envs mock window but not fully
window.HTMLElement &&
// also exclude jsdom
!window.navigator?.userAgent?.includes('jsdom')
) {
const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [])
Expand Down

0 comments on commit fa2237f

Please sign in to comment.