2 Star 2 Fork 1

蔡福良/browser_fp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
audio_inject.js 2.39 KB
一键复制 编辑 原始数据 按行查看 历史
蔡福良 提交于 2022-11-02 11:42 . init
(function () {
const context = {
"BUFFER": null,
"getChannelData": function (e) {
const getChannelData = e.prototype.getChannelData;
Object.defineProperty(e.prototype, "getChannelData", {
"value": function () {
const results_1 = getChannelData.apply(this, arguments);
if (context.BUFFER !== results_1) {
context.BUFFER = results_1;
window.top.postMessage("audiocontext-fingerprint-defender-alert", '*');
for (var i = 0; i < results_1.length; i += 100) {
let index = Math.floor(Math.random() * i);
results_1[index] = results_1[index] + Math.random() * 0.0000001;
}
}
//
return results_1;
}
});
},
"createAnalyser": function (e) {
const createAnalyser = e.prototype.__proto__.createAnalyser;
Object.defineProperty(e.prototype.__proto__, "createAnalyser", {
"value": function () {
const results_2 = createAnalyser.apply(this, arguments);
const getFloatFrequencyData = results_2.__proto__.getFloatFrequencyData;
Object.defineProperty(results_2.__proto__, "getFloatFrequencyData", {
"value": function () {
window.top.postMessage("audiocontext-fingerprint-defender-alert", '*');
const results_3 = getFloatFrequencyData.apply(this, arguments);
for (var i = 0; i < arguments[0].length; i += 100) {
let index = Math.floor(Math.random() * i);
arguments[0][index] = arguments[0][index] + Math.random() * 0.1;
}
//
return results_3;
}
});
//
return results_2;
}
});
}
};
//
context.getChannelData(AudioBuffer);
context.createAnalyser(AudioContext);
context.getChannelData(OfflineAudioContext);
context.createAnalyser(OfflineAudioContext);
document.documentElement.dataset.acxscriptallow = true;
})()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ghostcfl/browser_fp.git
git@gitee.com:ghostcfl/browser_fp.git
ghostcfl
browser_fp
browser_fp
master

搜索帮助