美文网首页
浏览器特征

浏览器特征

作者: 周周周__ | 来源:发表于2020-08-27 11:11 被阅读0次
function randomString(len) {
    len = len || 32;
    var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
    /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
    var maxPos = $chars.length;
    var pwd = '';
    for (i = 0; i < len; i++) {
        pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
    }
    return pwd;
}


window.parseFloat = parseFloat;
window.parseInt = parseInt;
window.isNaN = isNaN;
window.decodeURI = decodeURI;
window.decodeURIComponent = decodeURIComponent;
window.encodeURI = encodeURI;
window.encodeURIComponent = encodeURIComponent;
window.escape = escape;
window.unescape = unescape;
window.eval = eval;
window.Date = Date;

document = new Object();
document.createElement = function(name) {
    return "<" + name + ">" + "</" + name + ">"
};
document.createElement.toString = function() {
    return "function createElement() { [native code] }"
};
window.document = document;

var navigator = new Object();
navigator.appCodeName = "Mozilla";
navigator.appName = "Netscape";
navigator.appVersion = "5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36";
navigator.cookieEnabled = true;
navigator.connection = {
    'connection': null,
    'effectiveType': "4g",
    'rtt': 50,
    'downlink': 10,
    'saveData': false
};
navigator.deviceMemory = 8;
navigator.hardwareConcurrency;
navigator.doNotTrack = null;
navigator.language = "zh-CN";
navigator.languages = ["zh-CN", "zh"];
navigator.onLine = true;
navigator.platform = 'Win32';
navigator.product = 'Gecko';
navigator.productSub = '20030107';
navigator.userAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36";
navigator.vendor = "Google Inc.";
navigator.vendorSub = "";

plugins = [{
    'description': "APlayer III ActiveX hosting plugin for Firefox",
    'filename': "npaplayer.dll",
    'length': 1,
    'name': "APlayer ActiveX hosting plugin"
}, {
    'description': "ASUS Update",
    'filename': "npAsusUpdate3.dll",
    'length': 1,
    'name': "ASUS Update"
}];

any_plugins = true;

if (any_plugins) {
    for (var i = 0; i < 10; i++) {
        var p = {
            'description': randomString(parseInt(Math.random() * 20)),
            'filename': randomString(parseInt(Math.random() * 20)) + ".dll",
            'length': 1,
            'name': randomString(parseInt(Math.random() * 10))
        };

        plugins.push(p)
    }
}

navigator.plugins = plugins;

window.navigator = navigator;

location = new Object();
location.port = "";
location.protocol = "http:";

window.location = location;

history = new Object();
history.length = 5;
history.scrollRestoration = "auto";
history.state = null;
window.history = history;

screen = new Object();
screen.availHeight = 1040;
screen.availLeft = 2560;
screen.availTop = 0;
screen.availWidth = 1920;
screen.colorDepth = 24;
screen.height = 1080;
screen.pixelDepth = 24;
screen.width = 1920;
screen.orientation = {
    angle: 0,
    onchange: null,
    type: "landscape-primary"
};

window.getComputedStyle = function() {
    debugger
};

window.screen = screen;

window.parent = window;

window.top = window;

window.self = window;
window.window = window;
浏览器存储环境
var sessionStorage = {};
window.sessionStorage = {
    'setItem': function (key, val) {
        sessionStorage[key] = val
    },
    'getItem': function (key) {
        return sessionStorage[key]
    }
}

相关文章

  • 浏览器特征

    浏览器存储环境

  • vue 知识点整理——数据交互(axios、jsonp)

    axios: axios是基于promise的用于浏览器和nodejs的HTTP客户端,本身有以下特征: 从浏览器...

  • 1.浏览器和浏览器内核、html介绍

    浏览器内核是浏览器中最核心的功能部件,下面介绍的是webkit内核的特征分析和框架阐述。 浏览器的历史: w3c组...

  • axios的用法与功能实现

    axios是基于promise的用于浏览器和nodejs的HTTP客户端,本身有以下特征: 从浏览器中创建XMLH...

  • axios

    axios是基于promise的用于浏览器和nodejs的HTTP客户端,本身有以下特征:1.从浏览器中创建XML...

  • html css基础总结

    未完待续 Html css “Html5的使命是详细分析各web浏览器所具有的功能,…” 各大浏览器的特征是什么,...

  • 360浏览器的判断技巧

    作为前端,浏览器判断是必不可少的。通常我们都是通过Useragent字符串来匹配浏览器特征,判断出用户使用的是什么...

  • 技术 | 用浏览器抓取数据

    CatGate一个基于浏览器插件的数据抓取工具。做成浏览器插件无需模拟登入,能最真实的模仿用户行为和特征,可以用来...

  • axios使用手记

    关于axios官方文档给出的特征说明是: 从浏览器中创建 XMLHttpRequest 从 node.js 发出 ...

  • 前端错误

    这里所说的前端错误是指,在用户的浏览器中出现的js报错。如下图。 此类错误有几个特征: 报错信息一般发生在浏览器控...

网友评论

      本文标题:浏览器特征

      本文链接:https://www.haomeiwen.com/subject/gekcsktx.html