diff --git a/src/docs/client-shim.mjs b/src/docs/client-shim.mjs index b1969900..dc87e8ca 100644 --- a/src/docs/client-shim.mjs +++ b/src/docs/client-shim.mjs @@ -60,10 +60,6 @@ window = { location: {search: ''}, Image: Function, document: document, - navigator: { - platform:'', - userAgent: '' - }, NodeList: Array, WebSocket: Object, localStorage: { @@ -81,7 +77,14 @@ window = { ENV: {id: ''}, IP: '', DOM +} +if (!global.navigator) { + // defined as getter since node 22 + window.navigator = { + platform:'', + userAgent: '' + } } Object.assign(global, window)