arkenfox / TZP

TorZillaPrint: Firefox & Tor Browser fingerprint testing
https://arkenfox.github.io/TZP
MIT License
193 stars 28 forks source link

index: isEngine test page #100

Closed Thorin-Oakenpants closed 1 year ago

Thorin-Oakenpants commented 3 years ago

I was thinking of creating a more comprehensive test page for isEngine, just adding tests and returning values - especially newFn protected errors - a bit like versions. It would also show me if an extension is meddling with them (excluding newFn, maybe I could run a parallel construction set)

edit: I don't want to return what your engine is, I just want to return the results, along with a green checkmark if it matches FF, just to show that you would have to cover all these for starters to fool anyone: i.e if one fail is game over - end edit

DONE

TODO/IDEAS

this is interesting, firefox returns fileName, lineNumber, columnNumber, chrome doesn't


const newFn = x => typeof x != 'string' ? x : new Function(x)()

function test() {
    var e = [];
    try {
        newFn("banana")
    } catch (n) {
        let f =  n.fileName == undefined? undefined : n.fileName.length
        e.push(n.message), e.push(f), e.push(n.lineNumber), e.push(n.description), e.push(n.number), e.push(n.columnNumber);
        try {
            e.push(n.toSource().toString())
        } catch (n) {
            e.push(void 0)
        }
    }
    try {
        newFn("new WebSocket('itsgonnafail')")
    } catch (n) {
        e.push(n.message)
    }
    console.debug(e)
    return e
}
test()

storage estimates

    navigator.storage.estimate().then(estimate => console.debug(estimate.quota))
    // 1200238045593 chrome
    // 520541139 chrome incognito
    // 2147483648 brave: normal + private windows
    // 344413186 opera
    // 493381148 opera private window
Thorin-Oakenpants commented 3 years ago

semi-inspired by this

fyi: @chris124567 - ps love your commercial bot detectors repo 👍

Thorin-Oakenpants commented 3 years ago

@abrahamjuliot interesting stats on Android versions - see the pic

Thorin-Oakenpants commented 3 years ago

Safari webkit

While not necessary, I thought it would be nice to always try and get something different to gecko for both chrome and webkit.

Webkit collation was tough. I'm using FF60+ (for backwards compat) 104 items supported items (that way everything is supported and nothing falls back to undefined -> system/app locale = could be anything) so the hash is stable. Everything in those 104 locales are supported in webkit.

But looking at what changes in FF: the only diff is no (I'm sure they'll hook that up at some stage)

 not in webkit (108)
- FF70+: no, tl
- FF78+: ff
- FF91+: br, sa,
- can't get any collation diffs: br (breton), sa (sanskrit), ff (fulah), tl (tagalog)
- leaves: no

So if isFF and is 70+ then I swap no in for one of the others, so at least webkit comes up red x

This won't be such as issue with other constructors, since I won't need to rely on collation


@abrahamjuliot help me out

console


FYI: Intl.Collator

FF60 (104)
af, am, ar, as, az, be, bg, bn, bo, bs, ca, cs, cy, da, de, dsb, dz, ee, el, en,
eo, es, et, fa, fi, fo, fr, ga, gl, gu, ha, haw, he, hi, hr, hsb, hu, hy, id, ig,
is, it, ja, ka, kk, kl, km, kn, ko, kok, ky, lb, ln, lo, lt, lv, mk, ml, mn, mr,
ms, mt, my, nb, ne, nl, nn, om, or, pa, pl, ps, pt, ro, ru, se, si, sk, sl, sq,
sr, sv, sw, ta, te, th, to, tr, ug, uk, ur, uz, vi, wo, yi, yo, zh, zh-Hans,
zh-Hant, zh-CN, zh-HK, zh-SG, zh-TW, zu

FF91+ (113)
br, ff, hye -> hy, ku, no, sa, tk, tl -> fil, xh, 

BLINK (54) (excluding tl->fil and no, not in FF60)
am, ar, bg, bn, ca, cs, da, de, el, en, es, et, fa, fi, fr, gu, he, hi, hr, hu, id,
it, ja, kn, ko, lt, lv, ml, mr, ms, nb, nl, pl, pt, ro, ru, sk, sl, sr, sv, sw,
ta, te, th, tr, uk, vi, zh, zh-Hans, zh-Hant, zh-CN, zh-HK, zh-SG, zh-TW

WEBKIT (108)

af, am, ar, as, az, be, bg, bn, bo, bs, ca, cs, cy, da, de, dsb, dz, ee, el, en,
eo, es, et, fa, fi, fo, fr, ga, gl, gu, ha, haw, he, hi, hr, hsb, hu, hy, hye -> hy, id,
ig, is, it, ja, ka, kk, kl, km, kn, ko, kok, ku, ky, lb, ln, lo, lt, lv, mk, ml, mn,
mr, ms, mt, my, nb, ne, nl, nn, om, or, pa, pl, ps, pt, ro, ru, se, si, sk, sl, sq,
sr, sv, sw, ta, te, th, tk, to, tr, ug, uk, ur, uz, vi, wo, xh, yi, yo, zh, zh-Hans,
zh-Hant, zh-CN, zh-HK, zh-SG, zh-TW, zu
abrahamjuliot commented 3 years ago

It looks like this is a unicode bug triggered by this specific unicode with the use of additional console.log arguments.

¯\_(ツ)_/¯

console.log('...\u0025\n', [])
// ...[object Object]

As an alternative, we can make that additional argument a separate log:

console.log('...\u0025\n')
console.log([])
/*
...%
[]
*/
Thorin-Oakenpants commented 3 years ago

thanks.,not going to code around it, not worth it

Thorin-Oakenpants commented 3 years ago

wtf

Thorin-Oakenpants commented 2 years ago

zee speedy gonzales gecko check

not to be confused with Jose “Slowpoke” Rodriguez

hopefully impervious to extension fuckery and perf changes

let isFF = false
let tstart = performance.now()
let ff1 = Element.prototype.hasOwnProperty("mozMatchesSelector") // 0.014ms
let ff2 = CanvasRenderingContext2D.prototype.hasOwnProperty("mozTextStyle") // 0.133ms
let ff3 = ("boolean" === typeof document.mozFullScreenEnabled) // 0.015ms
let ff4 = ("object" === typeof Object.getOwnPropertyDescriptor(SVGElement.prototype, "onmozfullscreenchange")) // 0.024ms
let ff5 = ("object" === typeof Object.getOwnPropertyDescriptor(HTMLElement.prototype, "onmozfullscreenerror")) // 0.029ms
let ff6 = ("function" === typeof CSSMozDocumentRule) // 0.080ms // false FF52
let ff7 = ("function" === typeof document.mozSetImageElement) // 0.080ms
let ff8 = ("object" === typeof screen.onmozorientationchange) // 0.075ms
let res = [ff1, ff2, ff3, ff4, ff5, ff6, ff7, ff8]
let sum = ff1 + ff2 + ff3 + ff4 + ff5 + ff6 + ff7 + ff8
if (sum > 5) {isFF = true}
let tend = performance.now()
console.log(isFF, sum+"/"+res.length, (tend-tstart) +" ms")

speedy-gonzales

Thorin-Oakenpants commented 2 years ago

^ PRO TIP run in about:config so timing is not rounded to 1ms

abrahamjuliot commented 2 years ago

I did a quick iteration through window props and sub prop names. There's a lot here.

moz...
```js missing = [ "mozSetImageElement" in Document.prototype, "mozCancelFullScreen" in Document.prototype, "mozFullScreen" in Document.prototype, "mozFullScreenEnabled" in Document.prototype, "mozFullScreenElement" in Document.prototype, "onmozfullscreenchange" in Document.prototype, "onmozfullscreenerror" in Document.prototype, "MOZ_SOURCE_UNKNOWN" in MouseEvent.prototype, "MOZ_SOURCE_MOUSE" in MouseEvent.prototype, "MOZ_SOURCE_PEN" in MouseEvent.prototype, "MOZ_SOURCE_ERASER" in MouseEvent.prototype, "MOZ_SOURCE_CURSOR" in MouseEvent.prototype, "MOZ_SOURCE_TOUCH" in MouseEvent.prototype, "MOZ_SOURCE_KEYBOARD" in MouseEvent.prototype, "mozPressure" in MouseEvent.prototype, "mozInputSource" in MouseEvent.prototype, "MOZ_SOURCE_UNKNOWN" in MouseEvent.prototype, "MOZ_SOURCE_MOUSE" in MouseEvent.prototype, "MOZ_SOURCE_PEN" in MouseEvent.prototype, "MOZ_SOURCE_ERASER" in MouseEvent.prototype, "MOZ_SOURCE_CURSOR" in MouseEvent.prototype, "MOZ_SOURCE_TOUCH" in MouseEvent.prototype, "MOZ_SOURCE_KEYBOARD" in MouseEvent.prototype, "mozMatchesSelector" in Element.prototype, "mozRequestFullScreen" in Element.prototype, "onmozfullscreenchange" in HTMLElement.prototype, "onmozfullscreenerror" in HTMLElement.prototype, "MozBoxAlign" in CSS2Properties.prototype, "-moz-box-align" in CSS2Properties.prototype, "MozBoxDirection" in CSS2Properties.prototype, "-moz-box-direction" in CSS2Properties.prototype, "MozBoxOrient" in CSS2Properties.prototype, "-moz-box-orient" in CSS2Properties.prototype, "MozBoxPack" in CSS2Properties.prototype, "-moz-box-pack" in CSS2Properties.prototype, "MozFloatEdge" in CSS2Properties.prototype, "-moz-float-edge" in CSS2Properties.prototype, "MozForceBrokenImageIcon" in CSS2Properties.prototype, "-moz-force-broken-image-icon" in CSS2Properties.prototype, "MozOrient" in CSS2Properties.prototype, "-moz-orient" in CSS2Properties.prototype, "MozTextSizeAdjust" in CSS2Properties.prototype, "-moz-text-size-adjust" in CSS2Properties.prototype, "MozUserFocus" in CSS2Properties.prototype, "-moz-user-focus" in CSS2Properties.prototype, "MozUserInput" in CSS2Properties.prototype, "-moz-user-input" in CSS2Properties.prototype, "MozUserModify" in CSS2Properties.prototype, "-moz-user-modify" in CSS2Properties.prototype, "MozWindowDragging" in CSS2Properties.prototype, "-moz-window-dragging" in CSS2Properties.prototype, "MozBoxOrdinalGroup" in CSS2Properties.prototype, "-moz-box-ordinal-group" in CSS2Properties.prototype, "MozBoxFlex" in CSS2Properties.prototype, "-moz-box-flex" in CSS2Properties.prototype, "MozImageRegion" in CSS2Properties.prototype, "-moz-image-region" in CSS2Properties.prototype, "MozBorderStartColor" in CSS2Properties.prototype, "-moz-border-start-color" in CSS2Properties.prototype, "MozBorderStartStyle" in CSS2Properties.prototype, "-moz-border-start-style" in CSS2Properties.prototype, "MozBorderStartWidth" in CSS2Properties.prototype, "-moz-border-start-width" in CSS2Properties.prototype, "MozBorderEndColor" in CSS2Properties.prototype, "-moz-border-end-color" in CSS2Properties.prototype, "MozBorderEndStyle" in CSS2Properties.prototype, "-moz-border-end-style" in CSS2Properties.prototype, "MozBorderEndWidth" in CSS2Properties.prototype, "-moz-border-end-width" in CSS2Properties.prototype, "MozTransform" in CSS2Properties.prototype, "-moz-transform" in CSS2Properties.prototype, "MozPerspective" in CSS2Properties.prototype, "-moz-perspective" in CSS2Properties.prototype, "MozPerspectiveOrigin" in CSS2Properties.prototype, "-moz-perspective-origin" in CSS2Properties.prototype, "MozBackfaceVisibility" in CSS2Properties.prototype, "-moz-backface-visibility" in CSS2Properties.prototype, "MozTransformStyle" in CSS2Properties.prototype, "-moz-transform-style" in CSS2Properties.prototype, "MozTransformOrigin" in CSS2Properties.prototype, "-moz-transform-origin" in CSS2Properties.prototype, "MozAppearance" in CSS2Properties.prototype, "-moz-appearance" in CSS2Properties.prototype, "MozFontFeatureSettings" in CSS2Properties.prototype, "-moz-font-feature-settings" in CSS2Properties.prototype, "MozFontLanguageOverride" in CSS2Properties.prototype, "-moz-font-language-override" in CSS2Properties.prototype, "MozHyphens" in CSS2Properties.prototype, "-moz-hyphens" in CSS2Properties.prototype, "MozTabSize" in CSS2Properties.prototype, "-moz-tab-size" in CSS2Properties.prototype, "MozMarginStart" in CSS2Properties.prototype, "-moz-margin-start" in CSS2Properties.prototype, "MozMarginEnd" in CSS2Properties.prototype, "-moz-margin-end" in CSS2Properties.prototype, "MozPaddingStart" in CSS2Properties.prototype, "-moz-padding-start" in CSS2Properties.prototype, "MozPaddingEnd" in CSS2Properties.prototype, "-moz-padding-end" in CSS2Properties.prototype, "MozBoxSizing" in CSS2Properties.prototype, "-moz-box-sizing" in CSS2Properties.prototype, "MozUserSelect" in CSS2Properties.prototype, "-moz-user-select" in CSS2Properties.prototype, "MozTransitionDuration" in CSS2Properties.prototype, "-moz-transition-duration" in CSS2Properties.prototype, "MozTransitionTimingFunction" in CSS2Properties.prototype, "-moz-transition-timing-function" in CSS2Properties.prototype, "MozTransitionProperty" in CSS2Properties.prototype, "-moz-transition-property" in CSS2Properties.prototype, "MozTransitionDelay" in CSS2Properties.prototype, "-moz-transition-delay" in CSS2Properties.prototype, "MozAnimationName" in CSS2Properties.prototype, "-moz-animation-name" in CSS2Properties.prototype, "MozAnimationDuration" in CSS2Properties.prototype, "-moz-animation-duration" in CSS2Properties.prototype, "MozAnimationTimingFunction" in CSS2Properties.prototype, "-moz-animation-timing-function" in CSS2Properties.prototype, "MozAnimationIterationCount" in CSS2Properties.prototype, "-moz-animation-iteration-count" in CSS2Properties.prototype, "MozAnimationDirection" in CSS2Properties.prototype, "-moz-animation-direction" in CSS2Properties.prototype, "MozAnimationPlayState" in CSS2Properties.prototype, "-moz-animation-play-state" in CSS2Properties.prototype, "MozAnimationFillMode" in CSS2Properties.prototype, "-moz-animation-fill-mode" in CSS2Properties.prototype, "MozAnimationDelay" in CSS2Properties.prototype, "-moz-animation-delay" in CSS2Properties.prototype, "MozBorderStart" in CSS2Properties.prototype, "-moz-border-start" in CSS2Properties.prototype, "MozBorderEnd" in CSS2Properties.prototype, "-moz-border-end" in CSS2Properties.prototype, "MozBorderImage" in CSS2Properties.prototype, "-moz-border-image" in CSS2Properties.prototype, "MozTransition" in CSS2Properties.prototype, "-moz-transition" in CSS2Properties.prototype, "MozAnimation" in CSS2Properties.prototype, "-moz-animation" in CSS2Properties.prototype, "mozAnon" in XMLHttpRequest.prototype, "mozSystem" in XMLHttpRequest.prototype, "onmozfullscreenchange" in SVGElement.prototype, "onmozfullscreenerror" in SVGElement.prototype, "mozIsTextField" in HTMLInputElement.prototype, "mozGetUserMedia" in Navigator.prototype, "mozOpaque" in HTMLCanvasElement.prototype, "mozPrintCallback" in HTMLCanvasElement.prototype, "mozCurrentTransform" in CanvasRenderingContext2D.prototype, "mozCurrentTransformInverse" in CanvasRenderingContext2D.prototype, "mozTextStyle" in CanvasRenderingContext2D.prototype, "mozImageSmoothingEnabled" in CanvasRenderingContext2D.prototype, "mozLockOrientation" in Screen.prototype, "mozUnlockOrientation" in Screen.prototype, "mozOrientation" in Screen.prototype, "onmozorientationchange" in Screen.prototype, "mozCaptureStream" in HTMLMediaElement.prototype, "mozCaptureStreamUntilEnded" in HTMLMediaElement.prototype, "mozGetMetadata" in HTMLMediaElement.prototype, "mozPreservesPitch" in HTMLMediaElement.prototype, "mozAudioCaptured" in HTMLMediaElement.prototype, "mozFragmentEnd" in HTMLMediaElement.prototype, "mozRTCPeerConnection" in window, "onmozfullscreenchange" in MathMLElement.prototype, "onmozfullscreenerror" in MathMLElement.prototype, "mozCursor" in DataTransfer.prototype, "mozUserCancelled" in DataTransfer.prototype, "mozSourceNode" in DataTransfer.prototype, "mozParsedFrames" in HTMLVideoElement.prototype, "mozDecodedFrames" in HTMLVideoElement.prototype, "mozPresentedFrames" in HTMLVideoElement.prototype, "mozPaintedFrames" in HTMLVideoElement.prototype, "mozFrameDelay" in HTMLVideoElement.prototype, "mozHasAudio" in HTMLVideoElement.prototype, "mozFullScreenElement" in ShadowRoot.prototype, "CSSMozDocumentRule" in window, "mozGetAll" in IDBObjectStore.prototype, "mozRTCIceCandidate" in window, "mozGetAll" in IDBIndex.prototype, "mozGetAllKeys" in IDBIndex.prototype, "mozHasItem" in OfflineResourceList.prototype, "mozItem" in OfflineResourceList.prototype, "mozAdd" in OfflineResourceList.prototype, "mozRemove" in OfflineResourceList.prototype, "mozItems" in OfflineResourceList.prototype, "mozLength" in OfflineResourceList.prototype, "mozRTCSessionDescription" in window ].filter(x => !x) ```
Thorin-Oakenpants commented 2 years ago

I know - I just wasn't sure how to access some of them

I'll curate a few from there that are better: e.g. the screen.moz* typeof could be fcked by an extension to return undefined

CSS2 properties are slow, and cause an error in chromium

Thorin-Oakenpants commented 2 years ago

do me a favor, and time them all :)

Thorin-Oakenpants commented 2 years ago

you can work around the CSS2 error in blink by doing


if ("function" === typeof CSS2Properties) {

res.push( CSS2Properties.prototype.hasOwnProperty("something")) )
res.push( CSS2Properties.prototype.hasOwnProperty("something_else")) )

}
abrahamjuliot commented 2 years ago

time

Android might only be slower due to the console site I use.

"function" === typeof CSS2Properties)

Nice. I like this. It bypasses fake properties with the wrong type.

Maybe this is faster than direct access to CSS2Properties.prototype

CSS.supports("-moz-box-align: initial")
cssDashProps = ["-moz-box-align"] // and more
missing = [
   ...cssDashProps.map(x => CSS.supports(`${x}: initial`)),
  // other stuff
]
Thorin-Oakenpants commented 2 years ago

concept

note

code... ```js let t0 = performance.now() let aYes = 0, aNo = [], tested = 0 let oList = { "Document": [Document.prototype, ["mozSetImageElement","mozCancelFullScreen","mozFullScreen","mozFullScreenEnabled", "mozFullScreenElement","onmozfullscreenchange","onmozfullscreenerror"] ], "NouseEvent": [MouseEvent.prototype, ["MOZ_SOURCE_UNKNOWN","MOZ_SOURCE_MOUSE","MOZ_SOURCE_PEN","MOZ_SOURCE_ERASER", "MOZ_SOURCE_CURSOR","MOZ_SOURCE_TOUCH","MOZ_SOURCE_KEYBOARD","mozPressure", "mozInputSource","MOZ_SOURCE_UNKNOWN","MOZ_SOURCE_MOUSE","MOZ_SOURCE_PEN", "MOZ_SOURCE_ERASER","MOZ_SOURCE_CURSOR","MOZ_SOURCE_TOUCH","MOZ_SOURCE_KEYBOARD"] ], "HTMLElement": [HTMLElement.prototype, ["onmozfullscreenchange","onmozfullscreenerror"] ], "HTMLVideoElement": [HTMLVideoElement.prototype, ["mozParsedFrames","mozDecodedFrames","mozPresentedFrames","mozPaintedFrames","mozFrameDelay","mozHasAudio"] ], "HTMLMediaElement": [HTMLMediaElement.prototype, ["mozCaptureStream","mozCaptureStreamUntilEnded","mozGetMetadata","mozPreservesPitch","mozAudioCaptured","mozFragmentEnd"] ], } let aCSS2 = [ "MozBoxAlign","MozBoxDirection","MozBoxOrient","MozBoxPack","MozFloatEdge","MozForceBrokenImageIcon", "MozOrient","MozTextSizeAdjust","MozUserFocus","MozUserInput","MozUserModify","MozWindowDragging", "MozBoxOrdinalGroup","MozBoxFlex","MozImageRegion","MozBorderStartColor","MozBorderStartStyle", "MozBorderStartWidth","MozBorderEndColor","MozBorderEndStyle","MozBorderEndWidth","MozTransform", "MozPerspective","MozPerspectiveOrigin","MozBackfaceVisibility","MozTransformStyle","MozTransformOrigin", "MozAppearance","MozFontFeatureSettings","MozFontLanguageOverride","MozHyphens","MozTabSize", "MozMarginStart","MozMarginEnd","MozPaddingStart","MozPaddingEnd","MozBoxSizing","MozUserSelect", "MozTransitionDuration","MozTransitionTimingFunction","MozTransitionProperty","MozTransitionDelay", "MozAnimationName","MozAnimationDuration","MozAnimationTimingFunction","MozAnimationIterationCount", "MozAnimationDirection","MozAnimationPlayState","MozAnimationFillMode","MozAnimationDelay", "MozBorderStart","MozBorderEnd","MozBorderImage","MozTransition","MozAnimation", ] if ("function" === typeof CSS2Properties) { oList["CSS2Properties"] = [CSS2Properties.prototype, aCSS2] } else { tested += aCSS2.length } for (const k of Object.keys(oList)) { let obj = oList[k][0] let props = oList[k][1] props.forEach(function(element) { if ("undefined" !== typeof Object.getOwnPropertyDescriptor(obj, element)) { aYes++ } else { aNo.push(k+"."+element) } }) } let t1 = performance.now() console.log(aYes +"/"+tested, t1-t0 +"ms") if (aNo.length) { console.log("not found", aNo) } ```
Thorin-Oakenpants commented 2 years ago

https://github.com/arkenfox/TZP/blob/107174ed481dc334f121aa5c1e4f8deda24a24af/tests/engine.html#L1211

example

This is for the engine test page, not a super speedy gecko test

ToDo: test older versions / configs and return "n/a" where applicable for FF: e.g.

Thorin-Oakenpants commented 2 years ago

OK, now for an improved isFF test: here's my DIRTY DOZEN

I don't need to spend 0.5 of a ms grabbing perf and shoving shit into arrays (only if no = should be non-FF and screw them), so this looks pretty fucking speedy to me

        let t00 = performance.now()
        let list = [
            [DataTransfer, "DataTransfer", "mozSourceNode"],
            [Document, "Document", "mozFullScreen"],
            [HTMLCanvasElement, "HTMLCanvasElement", "mozPrintCallback"],
            [HTMLElement, "HTMLElement", "onmozfullscreenerror"],
            [HTMLInputElement, "HTMLInputElement", "mozIsTextField"],
            [HTMLMediaElement, "HTMLMediaElement", "mozGetMetadata"],
            [HTMLVideoElement, "HTMLVideoElement", "mozDecodedFrames"],
            [IDBIndex, "IDBIndex", "mozGetAllKeys"],
            [IDBObjectStore, "IDBObjectStore", "mozGetAll"],
            [Navigator, "Navigator", "mozGetUserMedia"],
            [Screen, "Screen", "mozOrientation"],
            [SVGElement, "SVGElement", "onmozfullscreenchange"] 
        ]
        let tstart, perf, obj, prop, aYes = [], aNo = []
        list.forEach(function(array) {
            tstart = performance.now()  
            obj = array[0]
            prop = array[2]
            if ("function" === typeof obj
                && ("object" === typeof Object.getOwnPropertyDescriptor(obj.prototype, prop))
            ) {

                perf = (performance.now() - tstart)
                aYes.push([array[1], perf])
            } else {
                aNo.push(array[1])
            }
        })
        let totalPerf = 0
        aYes.forEach(function(array) {
            totalPerf += array[1]
        })
        console.log("overall", (performance.now() - t00) +" ms")
        console.log("loop", totalPerf +" ms")
        console.log(aYes)
        console.log(aNo)

dirty-dozen

Thorin-Oakenpants commented 2 years ago

actually the approx 0.4ms is the list, I guess it takes time to populate it. Damn, people will be heartbroken I couldn't keep this under 0.1ms

Thorin-Oakenpants commented 2 years ago

FYI: Navigator + mozGetUserMedia is no longer there if BOTH media.peerconnection.enabled + media.navigator.enabled are false. Not worth coding around this as a false negative

dropped it as one of my isFF checks .. so now it's out of 11

Thorin-Oakenpants commented 2 years ago

FYI: actually, measuring them individually, it's more like this

let fftest
// 1
let t1 = performance.now()
fftest = ("function" === typeof DataTransfer
    && ("object" === typeof Object.getOwnPropertyDescriptor(DataTransfer.prototype, "mozSourceNode"))
)
console.log(fftest, "DataTransfer", (performance.now() - t1))
// 2
t1 = performance.now()
fftest = ("function" === typeof Document
    && ("object" === typeof Object.getOwnPropertyDescriptor(Document.prototype, "mozFullScreen"))
)
console.log(fftest, "Document", (performance.now() - t1))
// etc
true      DataTransfer 0.06027405796885432
true          Document 0.010726739128585905
true HTMLCanvasElement 0.04009757246240042
true       HTMLElement 0.009705144926556386
true  HTMLInputElement 0.010726739132223884
true  HTMLMediaElement 0.14787576086382614
true  HTMLVideoElement 0.045460942024874385
true          IDBIndex 0.038309782608848764
true    IDBObjectStore 0.03575579710013699
true            Screen 0.0403529710129078
true        SVGElement 0.023752065215376206

so you could get a single unspoofable?/unblockable? boolean in under 0.01ms (HTMLElement), so I think I'm done with my improved isFF test for TZP

Thorin-Oakenpants commented 2 years ago

heh https://bugzilla.mozilla.org/show_bug.cgi?id=1679474#c6

https://jsfiddle.net/d_toybox/tre1b4hm/2/ - just more weird shit that differs between engines

Thorin-Oakenpants commented 1 year ago

I was going to add resource:// and chrome://` checks, but can't be bothered

Can't believe it's only been 16 months .. still 90+ valid tests for FF102+ .. 80 if you count error messages as 1, is pretty much more than enough to get the point across for clientside JS