- 主页 > 生活百科 > >
通过浏览器打开页面时执行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脚本 改变浏览器“指纹”】
推荐阅读
-
-
爱鑫聊科技|如果没有他们,三国不知何时才归晋,司马炎最应该感谢的五大名将
-
-
-
汽车车集结号|明明不输奥迪A8,却没人识货,连跌32万!起步V6引擎配8AT
-
LOL|宁王这波绝对在大气层,以后排位抢盲僧建议报竞速时间,谁快谁拿
-
-
南山黄药师|中医治眩晕,4种类型8种中成药建议收藏
-
-
-
-
于小姐Dreamy爱时尚|明星为了唱歌都拼了,泫雅泳衣穿在裤子外,看到小S我直接笑喷
-
-
事业编制人员|事业单位副处有机会转公务员,要转吗转过了这个村
-
体坛焦点|不止实力差!失意神塔还重伤广东形象 离被抛弃不远了?,原创
-
-
湖南|几年前,湖南妈妈生下“小猴子”,杂技团欲出高价购买,后来如何
-
烹饪|入秋后,最该吃的不是丝瓜而是它,教你新做法,一口一个比饺子香
-
-