Add font enumeration hardening, document.fonts protection, Client Hints stripping, and WebGL parameter normalization

- Font enumeration: seeded noise on offsetWidth/Height, scrollWidth/Height, clientWidth/Height
- document.fonts: check() returns false, size returns 0, forEach is no-op
- Client Hints: strip Sec-CH-UA/Full-Version-List, override Platform/Mobile per container
- WebGL: merge PARAM_OVERRIDES into getParameter (MAX_TEXTURE_SIZE, attribs, etc.)
- Clean up dead code in WebGL extended section
- Test page: add Font DOM, document.fonts, and Client Hints test sections
- README: update vector table (18 vectors), add about:config and testing docs
This commit is contained in:
sal
2026-03-01 15:49:40 -06:00
parent 0c370240c2
commit b09a8248af
4 changed files with 268 additions and 38 deletions

View File

@@ -91,7 +91,8 @@ async function buildProfileAndRegister(cookieStoreId, seed) {
// Cache profile for HTTP header spoofing
containerProfiles[cookieStoreId] = {
userAgent: profile.nav.userAgent,
languages: profile.nav.languages
languages: profile.nav.languages,
platform: profile.nav.platform
};
await registerForContainer(cookieStoreId, profile);
@@ -450,12 +451,25 @@ browser.webRequest.onBeforeSendHeaders.addListener(
if (!profile) return {};
const headers = details.requestHeaders;
for (let i = 0; i < headers.length; i++) {
// Map platform to Client Hints platform name
const platformMap = {
"Win32": "Windows", "Linux x86_64": "Linux", "MacIntel": "macOS"
};
const chPlatform = platformMap[profile.platform] || "Unknown";
for (let i = headers.length - 1; i >= 0; i--) {
const name = headers[i].name.toLowerCase();
if (name === "user-agent") {
headers[i].value = profile.userAgent;
} else if (name === "accept-language") {
headers[i].value = formatAcceptLanguage(profile.languages);
} else if (name === "sec-ch-ua" || name === "sec-ch-ua-full-version-list") {
// Firefox doesn't normally send these, but strip if present
headers.splice(i, 1);
} else if (name === "sec-ch-ua-platform") {
headers[i].value = `"${chPlatform}"`;
} else if (name === "sec-ch-ua-mobile") {
headers[i].value = "?0";
}
}
return { requestHeaders: headers };