Closed ghost closed 6 years ago
if(_window.showModalDialog && _window.chrome ){
var chrome_vision = u.replace(/^.*Chrome\/([\d]+).*$/, '$1');
if(chrome_vision>36){
is360 = true;
}
}
var navigator_top = window.screenTop-window.screenY;
these codes cant run on nodejs.
const BrowserInfo = require('./browser')
/**
* 浏览器信息
* @param {[type]} userAgent [description]
* @param {[type]} acceptLanguage [description]
* @return {[type]} [description]
*/
const getBrowserInfo = (userAgent, acceptLanguage) => {
let info = new BrowserInfo(userAgent, acceptLanguage)
// let infoArr = [
// '浏览器:' + info.browser,
// '版本:' + info.version,
// '内核:' + info.engine,
// '操作系统:' + info.os + info.osVersion,
// '设备:' + info.device,
// '语言:' + info.language,
// ]
// return infoArr.join('|')
return info.browser + '/' + info.version
}
getBrowserInfo(req.headers['user-agent'], req.headers['accept-language']);
@onlyling six six six u forked this script and expand it 2 support node?
应该解决了
Below is your comments on the top of the code
I use this script on NodeJs,but
var _window = window||{};
throw error,window is not defined.