清除 Cookie、更换 IP 地址,以及创建新的浏览器配置文件,都无法阻止网站识别底层设备。跟踪脚本和反机器人脚本会绘制不可见的 2D 图形,测量字形的亚像素几何信息,再对得到的像素数组和浮点数数组进行哈希计算,生成一个跨会话保持稳定的硬件标识。
Fuzio 内嵌了 Chromium,因此我们可以将 Manifest V3 扩展安装到 Fuzio
Profile 中,在跟踪脚本运行之前替换页面的 JavaScript API,从而应对这类跟踪。
在本系列文章中,我们将使用 Fuzio 构建一个 Chromium 防指纹扩展,保护嵌入式浏览器,减少跟踪脚本对设备信息的识别。
第一部分聚焦 2D 图形与页面布局。我们将在运行时打包扩展,对 Browser 绘制图像、测量文本和计算元素尺寸时返回的数据加入微小且一致的调整,让不同配置文件、不同网站获得不同的特征。具体包括:
HTMLCanvasElement 和
CanvasRenderingContext2D:标准 2D Canvas 绘制。OffscreenCanvas:离屏 2D Canvas 渲染。TextMetrics:亚像素级的文本宽度和字形边界框测量。SVG 文本元素:矢量文本长度和边界框测量。DOMRect:HTML 元素与文本范围中带有小数部分的布局矩形。运行本教程中的示例,需要:
当网页绘制文本、渐变或图形时,Chromium 会将这些指令交给 2D 图形引擎 Skia,以及操作系统的字体引擎处理:Linux 使用 FreeType,Windows 使用 DirectWrite,macOS 使用 CoreText。
即使两台计算机运行相同版本的 Chromium,绘制完全相同的内容,硬件和操作系统的差异仍会带来细微的数值差别。这些差别在屏幕上完全无法用肉眼察觉,却会改变 JavaScript 读取到的原始像素字节和浮点数。
具体来说,以下三个与硬件相关的因素会影响渲染结果:
指纹脚本利用这些差异,绘制一组隐藏内容,读取原始像素数组或边界框坐标,再对这些数值进行哈希计算。由于同一台设备上的这些数值在不同浏览器会话中保持一致,得到的哈希值就可以充当稳定的硬件标识。

<p class="image-caption">Chromium 的 2D 图形与布局指纹采集面。</p>
对于 CPU 核心数(
navigator.hardwareConcurrency)这类简单的硬件属性,可以通过返回
8 等常见值,让设备特征与更多用户保持一致。但对于 2D 图形和布局 API,Browser 必须按照页面的要求渲染内容、测量元素,因此返回固定值会破坏页面功能。
为此,防指纹浏览器会采用一种称为 farbling(微扰) 的技术:加入微小且一致的调整,例如翻转颜色通道的最低位,或将文本宽度偏移十万分之一像素。这些变化在屏幕上无法察觉,却能改变最终的哈希值。
当您使用 BrowserLeaks、 BrowserScan 或 ToDetect 等指纹检测工具测试经过微扰处理的 Browser 时,工具会将结果与历史访问者数据库进行比较,并报告您的 Canvas 哈希值 100% 唯一。
乍一看,“100% 唯一”似乎意味着出现了问题——通常,独特的指纹会让浏览器更容易被跟踪。然而,只有当这个哈希值 在不同配置文件和网站之间保持一致时,它才对跟踪者有用。如果每个浏览器配置文件、每个网站得到的哈希值都 不同,跟踪者就无法通过它将这些访问关联到同一台设备。
要在打断跟踪关联的同时避免被反机器人脚本标记,我们的调整必须遵循三条规则:
Function.prototype.toString() 输出发生变化、元素的整数宽度被破坏,或沙箱 iframe 未得到相应处理。要实现这三条规则,先创建一个配置好 Fuzio 和 Swing 的 Gradle 项目。如果您是第一次使用 Fuzio,可以按照 快速入门指南配置构建脚本和许可证密钥。
我们的方案分为两部分:
manifest.json 和
content.js 组成,在每个网页中运行,对 2D 图形和布局 API 的返回结果施加扰动。.crx 文件,并安装到 Fuzio
Profile 中。默认情况下,Chromium 会在
ISOLATED 隔离执行环境中运行扩展的内容脚本。隔离环境中的脚本与页面共享 DOM 树,但拥有各自独立的 JavaScript
window 和原型对象。如果在隔离环境中替换
HTMLCanvasElement.prototype.toDataURL,网页脚本调用的仍然是
MAIN 主执行环境中未经修改的原始方法。
要拦截页面自身
window 上的原型方法,需要在扩展的
manifest.json 中设置
"world": "MAIN" 和
"run_at": "document_start":
{
"manifest_version": 3,
"name": "Fuzio Fingerprint Shield",
"version": "1.0.0",
"description": "Reduces 2D graphics and layout fingerprinting.",
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["content.js"],
"run_at": "document_start",
"world": "MAIN",
"all_frames": true,
"match_about_blank": true,
"match_origin_as_fallback": true
}
]
}
content_scripts 中的每个配置项,都用于补齐一处特定的指纹防护缺口:
"run_at": "document_start":在 Chromium 解析页面 DOM 或执行任何
<script> 标签之前运行
content.js。"world": "MAIN":直接在页面的 JavaScript 上下文中执行
content.js。"all_frames": true、
"match_about_blank": true 和
"match_origin_as_fallback": true:确保脚本也能在嵌套框架、
about:blank 弹出窗口,以及
data: 或
blob: URL 对应的页面中运行。在
content.js 中,我们将脚本放进立即执行函数表达式
(() => { ... })() 中。由于脚本运行在
MAIN 主执行环境中,把状态和辅助函数封装在闭包里,可以避免将全局变量暴露到页面的 JavaScript 作用域中。
在这个闭包内部,我们组合两个值,生成一个确定性的 32 位种子
DOMAIN_SESSION_SEED:
crypto.getRandomValues 生成一次随机的 32 位整数,并存入
sessionStorage,让同一网站在页面重新加载后仍使用相同的种子。fnv1aHash,将
window.location.hostname 转换为 32 位整数,再与会话种子混合。基于这个种子,我们定义一个 32 位整数混合函数
mixHash,以及本篇所有技术共用的两个小型辅助函数:
mixHash(value, seed) 使用
MurmurHash3 的 32 位终结混合函数
fmix32 中的常量
0x85ebca6b 和
0xc2b2ae35,将任意整数
value 与
seed 混合,让每个像素索引或文本宽度都得到各自确定的 32 位整数。computeNoiseBit(index, seed) 返回
mixHash(index, seed) 的最低位,即
0 或
1,用于翻转像素颜色通道中的位。computeFloatNoise(value, seed) 返回一个按
SUBPIXEL_NOISE_STEP 缩放的、可正可负的亚像素偏移量。我们直接根据 Chromium 的布局单位
BLINK_LAYOUT_UNIT_PX = 1 / 64 定义
SUBPIXEL_NOISE_STEP,让它同时满足两个边界条件:
LayoutUnit 会将元素坐标对齐到
1 / 64 像素的网格。将这个单位再除以
1024,可以让噪声幅度比 Blink 的布局网格小约一千倍,避免文本发生位移或换行。TextMetrics 和
DOMRectReadOnly 使用 64 位数值,而
getBBox() 返回的
SVGRect 使用 32 位浮点数,小数精度更低。
(1 / 64) / 1024 这一量级的步长,足以在 32 位浮点数舍入后保留下来。(() => {
const BLINK_LAYOUT_UNIT_PX = 1 / 64;
const SUBPIXEL_NOISE_STEP = BLINK_LAYOUT_UNIT_PX / 1024;
const MURMUR3_FMIX_C1 = 0x85ebca6b;
const MURMUR3_FMIX_C2 = 0xc2b2ae35;
// 使用 MurmurHash3 的 32 位终结混合函数(fmix32)混合输入值与种子。
function mixHash(value, seed) {
let state = Math.imul(value ^ seed, MURMUR3_FMIX_C1);
state = Math.imul(state ^ (state >>> 13), MURMUR3_FMIX_C2);
return (state ^ (state >>> 16)) >>> 0;
}
function deriveDomainSessionSeed(win) {
const sessionSeed = getOrCreateSessionSeed(win);
const hostHash = fnv1aHash(win.location.hostname || "local");
return mixHash(hostHash, sessionSeed);
}
function computeNoiseBit(index, seed) {
return mixHash(index, seed) & 1;
}
function computeFloatNoise(value, seed) {
// 将带有小数部分的测量值转换为 mixHash 使用的整数键。
const key = Math.round(value * 1000);
// 从 32 位哈希值的第 8 至 15 位提取一个字节(0..255)。
const byteVal = (mixHash(key, seed) >>> 8) & 0xff;
// 将 0..255 平移到 -128..+127,让噪声既可以为正,也可以为负。
const offset = byteVal - 128;
// 将 0 替换为 1,确保每个测量值都受到扰动。
const nonZeroOffset = offset === 0 ? 1 : offset;
return nonZeroOffset * SUBPIXEL_NOISE_STEP;
}
// ...
})();

<p class="image-caption">生成按域名区分的会话种子。</p>
有了
computeNoiseBit,我们就可以处理第一类指纹采集面:2D Canvas 位图。页面完成 2D Canvas 绘制后,指纹脚本会通过两类 API 提取渲染后的位图:
CanvasRenderingContext2D.prototype.getImageData() 返回一个
ImageData 对象,其中包含
Uint8ClampedArray,按像素存储
R, G, B, A 字节,每个字节的取值范围为
0 到
255。HTMLCanvasElement.prototype.toDataURL() 和
HTMLCanvasElement.prototype.toBlob() 将 Canvas 位图压缩为 PNG、JPEG 或 WebP 图像,并返回 Base64 字符串或二进制
Blob。为了在不改变页面可见 Canvas 的前提下,对两种提取路径都施加扰动,我们在
patchCanvas2D 中分别处理:
getImageData() 时,每隔 16 个字节取一个字节,即每四个像素中的一个颜色通道,与
computeNoiseBit(i, seed) 进行异或运算。toDataURL() 或
toBlob() 时,将原始位图复制到临时的离屏
<canvas> 上,使用
applyPixelNoise 处理副本,再序列化这个副本,避免噪声在页面正在使用的 Canvas 上累积。function applyPixelNoise(imageData, seed) {
const data = imageData.data;
for (let i = 0; i < data.length; i += 16) {
data[i] = data[i] ^ computeNoiseBit(i, seed);
}
return imageData;
}
function cloneWithNoise(canvas, seed) {
const clone = canvas.ownerDocument.createElement("canvas");
clone.width = canvas.width;
clone.height = canvas.height;
const ctx = clone.getContext("2d");
ctx.drawImage(canvas, 0, 0);
const pixels = ctx.getImageData(0, 0, clone.width, clone.height);
ctx.putImageData(applyPixelNoise(pixels, seed), 0, 0);
return clone;
}
function patchCanvas2D(win, seed) {
const ctxProto = win.CanvasRenderingContext2D.prototype;
const canvasProto = win.HTMLCanvasElement.prototype;
const origGetImageData = ctxProto.getImageData;
const origToDataURL = canvasProto.toDataURL;
const origToBlob = canvasProto.toBlob;
ctxProto.getImageData = function (sx, sy, sw, sh, settings) {
const pixels = origGetImageData.call(this, sx, sy, sw, sh, settings);
return applyPixelNoise(pixels, seed);
};
canvasProto.toDataURL = function (...args) {
return origToDataURL.apply(cloneWithNoise(this, seed), args);
};
canvasProto.toBlob = function (callback, type, quality) {
return origToBlob.call(
cloneWithNoise(this, seed), callback, type, quality
);
};
}Chromium 还提供了
OffscreenCanvas。它无需 DOM 节点即可在内存中渲染 2D 图形,并使用独立的原型对象:
OffscreenCanvas.prototype 和
OffscreenCanvasRenderingContext2D.prototype。指纹脚本经常会分别使用
HTMLCanvasElement 和
OffscreenCanvas 渲染相同内容,再比较两者的哈希值。
在
patchOffscreenCanvas 中,我们对
getImageData 和
convertToBlob 采用同样的像素噪声与副本处理方式:
function patchOffscreenCanvas(win, seed) {
const offCtxProto = win.OffscreenCanvasRenderingContext2D.prototype;
const offCanvasProto = win.OffscreenCanvas.prototype;
const origGetImageData = offCtxProto.getImageData;
const origConvertToBlob = offCanvasProto.convertToBlob;
offCtxProto.getImageData = function (sx, sy, sw, sh, settings) {
const pixels = origGetImageData.call(this, sx, sy, sw, sh, settings);
return applyPixelNoise(pixels, seed);
};
offCanvasProto.convertToBlob = function (...args) {
return origConvertToBlob.apply(
cloneOffscreenWithNoise(this, seed), args
);
};
}指纹脚本也可以不读取 Canvas 像素,而是通过 JavaScript 测量文本宽度和布局边界框,识别操作系统的字体引擎。
在 2D Canvas 上调用
ctx.measureText("Cwm fjordbank glyphs vext quiz"),会返回一个
TextMetrics 对象。它同时提供文本的前进宽度
width,以及六个字形边界框属性的 getter:
actualBoundingBoxLeft、
actualBoundingBoxRight、
actualBoundingBoxAscent、
actualBoundingBoxDescent、
fontBoundingBoxAscent 和
fontBoundingBoxDescent。
在
patchCanvasTextMetrics 中,我们包装
TextMetrics.prototype 上全部七个属性的 getter。如果 getter 返回
0,例如测量空字符串时,就保持
0 不变;否则,加上
computeFloatNoise 返回的偏移量:
function patchCanvasTextMetrics(win, seed) {
const metricsProto = win.TextMetrics.prototype;
const properties = [
"width",
"actualBoundingBoxLeft",
"actualBoundingBoxRight",
"actualBoundingBoxAscent",
"actualBoundingBoxDescent",
"fontBoundingBoxAscent",
"fontBoundingBoxDescent"
];
for (const prop of properties) {
const origGetter = Object.getOwnPropertyDescriptor(
metricsProto, prop
).get;
Object.defineProperty(metricsProto, prop, {
get() {
const val = origGetter.call(this);
return val === 0 ? 0 : val + computeFloatNoise(val, seed);
}
});
}
}跟踪脚本还可以创建隐藏的
<svg><text> 元素,通过调用两个 SVG 方法,在不使用 Canvas 的情况下测量字体渲染结果:
SVGTextContentElement.prototype.getComputedTextLength():返回文本字符串渲染后的前进宽度。SVGGraphicsElement.prototype.getBBox():返回包围已渲染字形的
SVGRect 边界框,其中包含
width 和
height。在
patchSvgTextMetrics 中,我们包装这两个方法,并为非零测量值加上
computeFloatNoise 返回的偏移量:
function patchSvgTextMetrics(win, seed) {
const svgTextProto = win.SVGTextContentElement.prototype;
const svgGraphicsProto = win.SVGGraphicsElement.prototype;
const origGetLength = svgTextProto.getComputedTextLength;
const origGetBBox = svgGraphicsProto.getBBox;
svgTextProto.getComputedTextLength = function () {
const len = origGetLength.call(this);
return len === 0 ? 0 : len + computeFloatNoise(len, seed);
};
svgGraphicsProto.getBBox = function (...args) {
const box = origGetBBox.apply(this, args);
if (box.width > 0) box.width += computeFloatNoise(box.width, seed);
if (box.height > 0) box.height += computeFloatNoise(box.height, seed);
return box;
};
}最后,指纹脚本还会调用
Element.prototype 和
Range.prototype 上的
getBoundingClientRect() 与
getClientRects(),测量行内 HTML 元素和文本选区。
为
DOMRect 尺寸添加噪声时,我们会跳过尺寸为整数的布局边界框,原因有两个:
document.body,通常具有
1280 这样的整数像素宽度。脚本会将其与
document.body.clientWidth 等整数属性进行比较。129.53125。在添加噪声之前,先检查
!Number.isInteger(rect.width) 和
!Number.isInteger(rect.height),就可以只对亚像素级字体测量结果施加扰动,同时保持页面的整数布局尺寸不变:
function perturbRectIfFractional(rect, seed) {
if (rect.width > 0 && !Number.isInteger(rect.width)) {
rect.width += computeFloatNoise(rect.width, seed);
}
if (rect.height > 0 && !Number.isInteger(rect.height)) {
rect.height += computeFloatNoise(rect.height, seed);
}
return rect;
}
function patchDomRectMetrics(win, seed) {
for (const proto of [win.Element.prototype, win.Range.prototype]) {
const origGetBounding = proto.getBoundingClientRect;
const origGetRects = proto.getClientRects;
proto.getBoundingClientRect = function () {
return perturbRectIfFractional(origGetBounding.call(this), seed);
};
proto.getClientRects = function () {
const list = origGetRects.call(this);
for (const rect of list) perturbRectIfFractional(rect, seed);
return list;
};
}
}如果现在就将扩展加载到 Chromium 中,再打开 BrowserLeaks Canvas,您会发现报告的哈希值仍然与未经处理的硬件基准值相同。实际使用的指纹检测工具会通过两种方式,识别或绕过主窗口中的原型方法替换:
HTMLCanvasElement.prototype.toDataURL.toString(),检查方法返回的是
"function toDataURL() { [native code] }",还是暴露了自定义 JavaScript 包装函数的代码。<iframe sandbox="allow-same-origin">,但不设置
allow-scripts。缺少
allow-scripts 会阻止扩展的
content_scripts 在 iframe 中运行,而
allow-same-origin 又允许父页面调用
iframe.contentDocument.createElement("canvas"),使用子框架中未经修改的
toDataURL() 方法。每次替换内置方法时,我们都会将其原始的
"[native code]" 字符串保存在映射表
maskedFunctions 中。随后替换
Function.prototype.toString,让经过处理的函数返回预先保存的字符串:
// 对每个包装函数调用,例如 maskFunction(win, wrapperFn, origFn)。
function maskFunction(win, patchedFn, originalFn) {
const origToString = win.Function.prototype.toString;
maskedFunctions.set(patchedFn, origToString.call(originalFn));
}
function patchFunctionToString(win) {
const proto = win.Function.prototype;
const origToString = proto.toString;
const patchedToString = function toString() {
return maskedFunctions.has(this)
? maskedFunctions.get(this)
: origToString.call(this);
};
// 同时处理自定义 toString 函数自身的字符串表示。
maskedFunctions.set(patchedToString, origToString.call(origToString));
Object.defineProperty(proto, "toString", {
value: patchedToString,
configurable: true,
writable: true
});
}每个
<iframe> 都会创建自己的 JavaScript realm,也就是一个独立的
Window 对象,其中的原型尚未经过修改。要补齐沙箱 iframe 的防护缺口,我们包装
HTMLIFrameElement.prototype 上的
contentWindow 和
contentDocument getter。这样,无论访问哪一个 getter,都会在返回结果之前,先对该 iframe 的
Window 执行
applyAllTechniques:
function patchSandboxedIframes(win, applyRealmPatches) {
const iframeProto = win.HTMLIFrameElement.prototype;
const origWinGetter = Object.getOwnPropertyDescriptor(
iframeProto, "contentWindow"
).get;
const origDocGetter = Object.getOwnPropertyDescriptor(
iframeProto, "contentDocument"
).get;
Object.defineProperty(iframeProto, "contentWindow", {
get() {
const childWin = origWinGetter.call(this);
if (childWin) applyRealmPatches(childWin);
return childWin;
}
});
Object.defineProperty(iframeProto, "contentDocument", {
get() {
const childWin = origWinGetter.call(this);
if (childWin) applyRealmPatches(childWin);
return origDocGetter.call(this);
}
});
}
function applyAllTechniques(targetWindow) {
if (!targetWindow || patchedRealms.has(targetWindow)) return;
patchedRealms.add(targetWindow);
patchCanvas2D(targetWindow, DOMAIN_SESSION_SEED);
patchOffscreenCanvas(targetWindow, DOMAIN_SESSION_SEED);
patchCanvasTextMetrics(targetWindow, DOMAIN_SESSION_SEED);
patchSvgTextMetrics(targetWindow, DOMAIN_SESSION_SEED);
patchDomRectMetrics(targetWindow, DOMAIN_SESSION_SEED);
patchSandboxedIframes(targetWindow, applyAllTechniques);
patchFunctionToString(targetWindow);
}
applyAllTechniques(window);

<p class="image-caption">访问沙箱 iframe 时,为其应用相同的处理。</p>
至此,
content.js 已经完成。接下来就可以打包扩展,并将其加载到 Fuzio 中。
Fuzio 通过
Profile.extensions().install(Path),从打包后的
.crx 文件安装 Chromium 扩展。与标准 Chrome 不同,Fuzio 不要求 CRX 文件头中包含 Chrome 网上应用店的发布者证明。因此,我们可以在应用启动时,使用 JDK 标准的
java.security 和
java.util.zip API,生成临时 RSA 密钥对,并在内存中签署一个有效的 CRX3 扩展包。
CRX3 扩展包在扩展的 ZIP 数据前添加一个包含
"Cr24" 标识的 12 字节文件头,以及一个 protobuf 格式的
CrxFileHeader,其中包含
RSA-2048 公钥和签名。在
buildCrx3Package 中,我们生成临时的
RSA-2048 密钥对,根据公钥的
SHA-256 哈希值提取 16 字节的
crx_id,对数据进行签名,再组装
.crx 文件的字节数据:
private static byte[] buildCrx3Package(byte[] zipBytes)
throws GeneralSecurityException, IOException {
var keyGen = KeyPairGenerator.getInstance("RSA");
keyGen.initialize(2048);
var keyPair = keyGen.generateKeyPair();
var publicKeyDer = keyPair.getPublic().getEncoded();
var digest = MessageDigest.getInstance("SHA-256").digest(publicKeyDer);
var crxId = Arrays.copyOf(digest, 16);
var signedHeaderData = encodeLengthDelimitedField(1, crxId);
var signature = signCrxPayload(keyPair, signedHeaderData, zipBytes);
var asymmetricProof = concat(
encodeLengthDelimitedField(1, publicKeyDer),
encodeLengthDelimitedField(2, signature)
);
var fileHeader = concat(
encodeLengthDelimitedField(2, asymmetricProof),
encodeLengthDelimitedField(10000, signedHeaderData)
);
var output = ByteBuffer.allocate(12 + fileHeader.length + zipBytes.length)
.order(ByteOrder.LITTLE_ENDIAN);
output.put(CRX3_MAGIC);
output.putInt(3);
output.putInt(fileHeader.length);
output.put(fileHeader);
output.put(zipBytes);
return output.array();
}接下来,创建一个 Fuzio
Engine,以及两个相互隔离的 Browser 配置文件:
profiles.defaultProfile():作为未经处理的基准配置文件。profiles.newProfile("FingerprintShieldProfile"):作为启用防护的配置文件,将
CrxPacker.packExtensionToTempCrx() 返回的
.crx 扩展包安装到其中。随后,在
JSplitPane 中为每个配置文件嵌入一个 Swing
BrowserView,并让两个 Browser 都打开
https://browserleaks.com/canvas:
public static void main(String[] args) {
var engine = Engine.newInstance(HARDWARE_ACCELERATED);
var profiles = engine.profiles();
var baselineProfile = profiles.defaultProfile();
var protectedProfile = profiles.newProfile("FingerprintShieldProfile");
var crxPath = CrxPacker.packExtensionToTempCrx();
protectedProfile.extensions().install(crxPath);
var baselineBrowser = baselineProfile.newBrowser();
var protectedBrowser = protectedProfile.newBrowser();
invokeLater(() -> {
var splitPane = new JSplitPane(
JSplitPane.HORIZONTAL_SPLIT,
BrowserView.newInstance(baselineBrowser),
BrowserView.newInstance(protectedBrowser)
);
splitPane.setResizeWeight(0.5);
var frame = new JFrame("Fuzio Fingerprint Shield Comparison");
frame.add(splitPane, BorderLayout.CENTER);
frame.setSize(1400, 820);
frame.setVisible(true);
var testUrl = "https://browserleaks.com/canvas";
baselineBrowser.navigation().loadUrl(testUrl);
protectedBrowser.navigation().loadUrl(testUrl);
});
}使用 Gradle 运行应用,将
<YOUR_LICENSE_KEY> 替换为您的 Fuzio 许可证密钥:
./gradlew run -Dfuzio.license.key=<YOUR_LICENSE_KEY>
应用会并排打开两个
BrowserView 面板,分别加载
BrowserLeaks Canvas:

<p class="image-caption">在 BrowserLeaks 中对比基准配置文件与启用防护的配置文件。</p>
将基准配置文件与两个独立的防护配置文件进行比较,可以看到:每项 2D 图形与布局指纹指标,在不同配置文件中都会产生不同的值;在同一次页面访问中,第二次调用的结果与第一次完全一致;整数布局尺寸则保持不变:
| 指标 | 基准值 | 配置文件 1(第一次) | 配置文件 1(第二次) | 配置文件 2 |
|---|---|---|---|---|
| Canvas 哈希值 |
2F315868... |
331F79AA... |
331F79AA... |
A33EE872... |
OffscreenCanvas |
4207f105 |
cf8ae174 |
cf8ae174 |
40882f35 |
TextMetrics |
196.86132 |
196.86133 |
196.86133 |
196.86131 |
SVG.getBBox() |
119.57812 |
119.57858 |
119.57858 |
119.57744 |
DOMRect(浮点数) |
129.53125 |
129.53126 |
129.53126 |
129.53124 |
DOMRect(整数) |
1280 |
1280 |
1280 |
1280 |
完整的可运行项目,请参阅 Gitee 仓库。
在本系列的第一部分中,我们使用 Fuzio 构建了一个 Manifest V3 扩展,为 2D Canvas 位图、
TextMetrics、
SVG 文本,以及尺寸带有小数部分的
DOMRect 边界框,添加按域名区分的确定性噪声。通过处理
Function.prototype.toString() 的返回结果、在访问沙箱 iframe 时为其应用相同处理,以及在启动时将扩展打包为 CRX3,每个 Fuzio
Profile 都能在不破坏页面布局的前提下,生成各自稳定的 2D 指纹。
在下一部分中,我们将围绕
WebGL、
WebGL2、
WebGPU、
window.screen,以及高熵 CSS 媒体查询,为 3D GPU 渲染管线、着色器和显示属性提供防护。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70049619/viewspace-3188276/ ,如需转载,请注明出处,否则将追究法律责任。