ThomazPom / Moz-Ext-UltimaDark

A web extension that uses aggressive techniques to enable dark mode on every site.
126 stars 6 forks source link

[notabug] Q regarding privacy/detection #64

Closed atomGit closed 10 months ago

atomGit commented 10 months ago

i'm wondering about whether this ext. can be detected given the way it works

far as i know, injected CSS can only be detected if JS is enabled AND a fingerprinting script is in play to do the detecting, but given that UD injects the CSS before the browser renders the page (my understanding anyway), does this perhaps lessen the ability to detect it?

ThomazPom commented 10 months ago

There are numerous ways to detect UltimaDark's and any style edition piece of code presence with JavaScript. For instance, one method involves setting the color of an element and then retrieving it in JavaScript, noting any difference between the intended and actual values. This becomes even more apparent with the native getComputedStyle method, which accurately reflects the element's true color, making any color-altering extensions, easy to detect

In theory, it might be possible to make UltimaDark stealthier, but doing so would significantly impact performance (I would estimate it about -20%).

Because UltimaDark modifies CSS, it has to remove the Subresource Integrity (SRI) flag from edited resources. To check if SRI is missing, a quick webpage test with a resource can be done in a few minutes.

https://codepen.io/Thomaz-Pom/pen/zYboXyR

atomGit commented 10 months ago

thanks Thomaz - i suspected this was the case but i wanted to be sure because there was some question in my mind regarding the timing of JS being run in relationship to UD doing its thing