-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
notes #4
Comments
@abrahamjuliot : two questions q1: is there a better way to do this: rather than rely on a hardcoded count of promises, how would I do a Promise.all([
functionA(),
function99(),
funtionSomethingElse(), // <-- three promises: but what if I add more
]).then(function(result){
for (let i=0; i < 3; i++) { // <-- I would have to update the < number
myarray.push(result[i])
}
// do stuff with myarray
}) q2: is there a cleaner way to specify a variable: e.g. compare = chk+i if (i == 0) { compare = chk0
} else if (i == 1) {compare = chk1
} else if (i == 2) {compare = chk2
} else if (i == 3) {compare = chk3
} -tia |
let collection = [
functionA,
function99,
functionA
// add as many as you like
]
Promise.all(
// compile array with each promise called
collection.map(function(fn) {
return fn()
})
).then(function(result) {
// for loop
let len = promises.length
for (let i = 0; i < len; i++) {
myarray.push(result[i])
}
// or forEach
collection.forEach(function(currentValue, index) {
myarray.push(result[index])
})
})
I'm terrible at naming variables. It usually takes x number of revisions till I can make sense of it. But, I like starting with a comment on what it holds or what it should do and then my goal is to find a name that makes the comment unneeded. For example, EDIT: I think I answered the wrong question. Let me try again...
let chk = {
0: [], // access with chk[0]
1: [],
2: [],
3: []
}
if (i == 0) {
compare = chk[i]
} else if (i == 1) {
compare = chk[i]
} else if (i == 2) {
compare = chk[i]
} else if (i == 3) {
compare = chk[i]
}
// shorter single assignment
compare = (
i == 0 ? chk[i] :
i == 1 ? chk[i] :
i == 2 ? chk[i] :
chk[i] // i == 3
) |
I'm working on that (there are some bugs in the CB code). Stay tuned. |
Please check the updated test page. |
Awesome: I've been wanting to dig into this for ages. TB has open tickets about some SVG items. It's all on my ToDo list. So much to do, so little time. Imma just going to keep plodding away getting existing things finished before I add more things: and really dig into your test but it looks exciting 💋 How much entropy is gained would be interesting |
No - it was something different. The used classes did not match MDN and the bugs were in CB. |
@kkapsner I assume there's no point in looking at DOMRectReadOnly vs DOMRect ... anyway .. it says |
Thanks This is what I thought ... a worker runs in a global context which is different from the current window - so I was surprised to see that listed there and wondered if there was some "workaround" like passing a "context" or "element" reference?
Yup, that was my point. We test things, like iframe access methods .. and whammo, someone forgot something (I see Brave still hasn't patched those iframes with canvas - etc see So if domrect was altered, the "parent" domrectreadonly might not be? We should make a test for that, right? |
Should be easy enough. |
@kkapsner It's going to take me a while before I get around to the SVG and other "domrect" stuff, but I had a sneaky thought about css aspect-ratio ... not sure what it could be used with, and I'm yet to try .. but I'm thinking this could be used to generate boxes with known decimals to detect spoofing - it's on my massive ToDo list, but I just thought I'd throw this idea at you |
I think it will behave similar to a |
Yeah, it's in my notes: I was thinking I could force something like 1/3 and the result should be 1.3333333333 or whatever, but it may depend on the limitations of the API (not the measuring one) and variables such as pixel snapping, rounding, devicePixelRatio/subpixels, zoom/css-devicePixels (I think I could work around this) .. just something devious I thought about last night as I went to sleep |
I leave it unsorted. Moving
|
I think sorting is good to handle the console issue. We could capture both and then leave the unsorted in the loose fingerprint. |
It's the tiny phone/tablet icon in the console menu (or |
good article - https://www.otsukare.info/2022/10/25/css-values-definitions - @abrahamjuliot FYI |
various notes from the old repo
Promises
words of wisdom from kkapsner
That's doable but a better way would be to have eight promises - one for each test. Then you can combine them with
Promise.all
in all the configurations you need them. Something like this (please use better names!):FP scripts
FingerprintingGeneral
WASM
abraham:
There are ways to use WASM to interact with browser APIs, but does WASM make way to create a virtual context or scope? Iframes have their own browsing context/document environment, and Workers have their own global scope/event loop.
Here's an example of canvas fingerprinting in Rust.
kkapsner: The timings in the script are too tight for Firefox. If you set a debugger break point at line 441 it works. AND CB is protecting against it!
DOMRect / SVG
Links
Note that source
canvas stability
I see changes in some canvas results across FF releases. The hashes that change are
for example: for me on windows
I wonder what causes these changes
Cwm fjordbank glyphs vext quiz, \ud83d\ude03
widgets
from tom: Had someone look at this, and they had the following to say:
line breaking
Article: https://www.otsukare.info/2020/08/21/khmer-line-breaking
Can be used to?:
Pitfalls?
Notes:
example test: https://w3c.github.io/i18n-tests/css-text/line-breaking/exp-km-line-break-000.html
The text was updated successfully, but these errors were encountered: