How in web-extenion to detect whether a website supports dark mode and whether it is in dark mode?

Including not only does it automatically switch to dark mode (with color-scheme)), but also is it in dark mode by default, without using color-scheme, without having a light mode?

I want to expand (Firelux type) with such an automatic, effective detector.

I thought that maybe someone had made an effort to detect dark backgrounds, but also light subtitles, detecting everything possible…

Then it occurred to me that there should be a database of sites that have a dark mode and a way to bypass it…
But I’m doing it myself in Firelux, clicking laboriously.

#firefox #webextensions #css #javascript