- 主页 > 生活百科 > >
通过浏览器打开页面时执行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脚本 改变浏览器“指纹”】
推荐阅读
-
基金|钜派观点:专业事交给专业人指数增强基金“增强”收益
-
企业|上半年罗湖区金融业快速增长 75家企业获逾84亿元融资
-
成语塞翁失马焉知非福是什么意思 塞翁失马焉知非福是什么意思
-
-
-
老娄健康说|排出子宫污血,体内不藏毒素,肤色更白皙透亮,炒黑木耳加上此物
-
北青网综合|当胃部出现“烧心”时,表示胃部已经受到损伤,这4种食物要忌口
-
-
-
扬子晚报|扫码支付打车费后银行卡余额被清空?女子吓得忙报警,民警一查闹了乌龙
-
-
-
-
-
娱乐大吐槽君|产后身材恢复神速,戴口罩帽子仍旧难掩少女感,唐嫣晒老公视角美照
-
「新出行」零跑新产品规划曝光 明年推 SUV C-More 后年推轿车,原创
-
-
-
-
广东新增境外输入确诊病例1例和境外输入无症状感染者2例