1、客户端设备信息:
浏览器端:
navigator.userAgent.toLowerCase() //获取浏览器及版本,如chrome 64.2121
let ua = navigator.userAgent.toLowerCase();
let re =/(msie|firefox|chrome|opera|version).*?([\d.]+)/;
let m = ua.match(re);
sys.brow = m[1].replace(/version/, "'safari");
sys.v = m[2];
return sys;
//获取硬件平台,win32
var plateform = navigator.platform ? navigator.platform : "unknown";
//内存????
var memory = navigator.deviceMemory ? navigator.deviceMemory : 0;
//cookie 是否开启
var cookie_bool = navigator.cookieEnabled;
location.hash = "win"; //给url加上锚点,此锚点会自动加载到url的,即url尾部加了个XXX.html#win
//监听当url发生变化时:
window.addEventLister("hashchange",bind(this));
//点击后退按钮触发:
window.onpopstate = function(){}
//console.log ("This device has at least " + memory + "GiB of RAM.")
//获取用户主机名
location.hostname
window.location.hostname
//浏览器供应商
navigator.vendor
screen.width + "*" + screen.height