- 主页 > 生活百科 > >
通过浏览器打开页面时执行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脚本 改变浏览器“指纹”】
推荐阅读
-
-
-
-
宁波最新消息今天 宁波全面恢复!还有一地通知:8月30日起调整
-
-
-
入狱23年获无罪,吉林金哲宏申请2132万余元国家赔偿
-
-
智能手机|98名员工聚集性感染 日本村田工厂停产:或影响全球手机生产
-
-
-
#zol中关村在线#高画质小机身 佳能专微EOS R捕捉精彩瞬间
-
-
埃斯特·萨拉斯|美国联邦法官一家遇袭,或牵扯一桩敏感大案?
-
-
-
怎么看电脑是什么系统,不进入桌面系统怎么看电脑是什么系统
-
科技圈里那些事Y|用了这款智能台灯后,工作和学习都离不开它!,169元到手
-
王者荣耀|王者荣耀:个性化搭配和定制全面升级,6个西瓜道具别忘了兑换
-
不知道抖音怎么拍?抖音创意大集合,看完立马有拍抖音的冲动