- 主页 > 生活百科 > >
通过浏览器打开页面时执行js脚本 改变浏览器“指纹”( 二 )
var noisify = function (canvas, context) { if (context) { const shift = { 'r': Math.floor(Math.random() * 10) - 5, 'g': Math.floor(Math.random() * 10) - 5, 'b': Math.floor(Math.random() * 10) - 5, 'a': Math.floor(Math.random() * 10) - 5 const width = canvas.width; const height = canvas.height; if (width && height) { const imageData = https://www.isolves.com/it/cxkf/yy/js/2022-09-21/getImageData.Apply(context, [0, 0, width, height]); for (let i = 0; i < height; i++) { for (let j = 0; j < width; j++) { const n = ((i * (width * 4)) + (j * 4)); imageData.data[n + 0] = imageData.data[n + 0] + shift.r; imageData.data[n + 1] = imageData.data[n + 1] + shift.g; imageData.data[n + 2] = imageData.data[n + 2] + shift.b; imageData.data[n + 3] = imageData.data[n + 3] + shift.a; window.top.postMessage("canvas-fingerprint-defender-alert", '*'); context.putImageData(imageData, 0, 0); Object.defineProperty(HTMLCanvasElement.prototype, "toBlob", { "value": function () { noisify(this, this.getContext("2d")); return toBlob.apply(this, arguments); Object.defineProperty(HTMLCanvasElement.prototype, "toDataURL", { "value": function () { noisify(this, this.getContext("2d")); return toDataURL.apply(this, arguments); Object.defineProperty(CanvasRenderingContext2D.prototype, "getImageData", { "value": function () { noisify(this.canvas, this); return getImageData.apply(this, arguments); document.documentElement.dataset.cbscriptallow = true; inject();【通过浏览器打开页面时执行js脚本 改变浏览器“指纹”】
推荐阅读
-
-
【人民日报海外版】“盗取”隐私,3000多款App存隐患
-
武磊|西班牙人0-0闷平!中场核心4分钟2黄被罚下,武磊仅1次闪光
-
-
|一旦美国将11艘航母全部派出,谁能扛得住?俄专家:全球只有一国
-
-
英国疫情警戒级别升至4级,餐厅、酒吧22时前须关闭
-
-
幸运星肖|有许多赚钱机会,四属相暗财到来,收获颇丰,半年内财运一飞冲天
-
央视因只关注中国而忽视了,美媒:美国或去年12月已有新冠病毒
-
-
-
-
-
姚姚侃篮球|善解人意,生活滋润,活泼乐观的3位生肖女,积极向上
-
网易科技|当年决定"造芯"的大厂们,现在还在继续么?
-
-
-
云度π3 E-Shock曜越版上市 售价11.98万元
-
「美国」起死回生?美国数千死亡病例“神秘消失”,特朗普惊天“阴谋”浮出水面