Change the js, running under the window environment to the global environment, and the error in executing the script under nodejs is as follows:

window.navigator.userAgent.toLowerCase ();
A code error is as follows:
Cannot read property "userAgent" of undefined

Mar.04,2021

node you can't get UA information through window.navigator.userAgent , you can use req.headers ['user-agent'] to get

.
Menu