- 主页 > 生活百科 > >
通过浏览器打开页面时执行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脚本 改变浏览器“指纹”】
推荐阅读
-
王者荣耀|AG对阵QG语音曝光,月光再爆“金句”:赢也不能赢得这么憋屈,干回去!
-
-
大众日报|济南工业强市在下一盘什么大棋?,开局已获两个“空前”
-
-
印度|印度又出什么大事了?紧急向中方求助,国人:都是天意!
-
-
-
-
-
|42岁倪虹洁状态依旧,家中装修简朴,嫁富商后却只能吃外卖?
-
|剧坛本无“爆款剧”,只是炒作的手段多了,也便以为“爆”了
-
玩电8|我们还能通过哪些途径成批了解新车?,后车展时代
-
-
-
-
-
沈腾被曝带短裙女进会所|沈腾被曝带短裙女进会所,网友反应不一
-
-
厄尔尼诺危机已爆发!菲律宾受影响出现严重干旱,我国亦应当小心
-
2021年执业药师报考条件是什么? 药剂师报考条件