Mister_Pi's avatar
Mister_Pi
New Member
18 hours ago
Status:
New Idea

Dark Mode for .mht files?

(If what I want is already there, then please accept my apologies and pretty-please tell me how to configure it...)

I can view log files within TC in dark mode by setting dark mode in TC itself.  When saving logs as .mht files, however, they are only saved in light mode.  Furthermore, people have different preferences (dark vs. light).

There is currently a W3C standard in which websites can ask the user's browser whether it's configured for light or dark mode, so that the server can adjust CSS accordingly.  Edge knows how to respond to this query.

What I'd like to see is this mechanism embedded in the .mht file so that the log will display as light or dark according to my Edge settings.  A Google search for 'support for dark mode in mhtml files' gives an AI answer claiming that it's possible.  (Or course, it's AI, so...)

3 Comments

  • It's my understanding that MHTML embeds all the required elements, such as CSS pages, so shouldn't the archived logs make use of CSS whenever possible (just to save space, leaving aside the "dark mode" issue)?

    Personally, I wouldn't mind a static setting that made all the MHTML files display dark, but other users WOULD complain about that.

    Modern websites handle dark mode by including an element "prefers-color-scheme" supported by all modern browsers.  When a browser receives this element, it responds with either “light” or “dark” according to how the user has configured the browser.  The website thus knows and can adapt to the user’s preferences, typically by selecting either the “light” or the “dark” CSS files.  One example is Google's homepage, which serves a “light” page for the first visit, but thereafter sends light or dark according to the browser settings.

    Now the trick is whether the same feature can be supported in MHTML.  Google's search-engine AI claims it can.  (In general, can MHTML handle dynamic content?)

    (An alternate approach is making something that's viewable in native Chrome, preferably without needing third-party plugins of unknown provenance.  Then one could use Chrome's dark mode support, which tweaks CSS on the fly.)

  • Currently even if you export the files as html the CSS and HTML are not coded in a manner that can easily converted to dark mode.  It would be pretty easy if you could just update/replace the CSS with a dark mode version, but a lot of the elements are hard coded to specific colors and not using CSS so it is not an easy task.  If they updated the html output this would be pretty easy.

  • AlexKaras's avatar
    AlexKaras
    Community Hero

    Hi,

     

    As per my knowledge, .mht is just an archive of web page with all required resources been included into it. Browser renders .mht file as a local web page without the need to request web server. This means that either color scheme can be included in the file when .mht is created (and this means that it always be rendered in dark mode if it was initially created for dark mode) or that the page may be (significantly) complicated at the moment of log export to .mht, by adding to it the functionality to switch locally between light and dark modes directly in the browser.

    Both approaches, for sure, are doable...