That’s interesting, I didn’t know there is a “privacy” API.
Sadly, it requires “privacy” permission which would be alerted to users.
In any case, just hour ago I’ve finished implementing a manual test of canvas which draws a 2x2 px image and then exports it as Base64 string and I compares it with what’s expected:
export function testOffscreenCanvas() {
if (!self.OffscreenCanvas) return false;
const offscreen = new self.OffscreenCanvas(2, 2);
const canvas = offscreen.getContext('2d');
canvas.fillStyle = "rgb(255, 0, 0)";
canvas.fillRect(0, 0, 1, 1);
const base64 = await blobToDataUrl(await offscreen.convertToBlob({type: 'image/png'}));
// the string represents 4 pixels, one red and 3 white
const isOK = base64 === 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFElEQVQIW2P8z8Dwn5GBgRGIIQAAHyUCAymYnnsAAAAASUVORK5CYII=';
if (!isOK) console.log('canvas test failed, is "privacy.resistFingerprinting" enabled?');
return isOK;
}