I suspect this is because "major browsers default to light mode if not otherwise configured". Try and see if this happens.Īfter some experimentation, I discovered iff a website has a meta header for color-scheme: Īs is the case with and, an iframe without matching header is only able to handle light mode correctly, and renders a white background if user device is set to prefer dark mode. If you go to OS settings and toggle the appearance between light and dark, this should alternate the white color and red color behind the iframe. Next a more detailed answer, and how I discovered it. As this requires programmatic effort to figure out if such header exists a what the content value is, those steps are omitted, but once the scheme is known, the injection code would look something like this: ( Do not add the meta header if a website does not have one. It must match the color-scheme header of the web page, if one exists. For anyone looking for a quick copy-paste answer: include a color-scheme meta header in the injected iframe.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |