dport 0 Posted May 1, 2022 is it possible to turn off dark mode setting of webbrowser in android Share this post Link to post
Dave Nottage 557 Posted May 1, 2022 I may have a solution, however I'm having trouble verifying that it works. What are the steps to reproduce that the website will definitely show in dark mode? At present, all I'm doing is navigating to https://www.google.com, and TWebBrowser shows the site in light mode, despite the Chrome app showing it in dark mode (which is what my device is set to) Share this post Link to post
dport 0 Posted May 2, 2022 I added head section html: <meta name="color-scheme" content="light only"></head> <style> :root { color-scheme: light only; } </style> I added it to the html codes but there must be a setting to force twebrowser Share this post Link to post
Dave Nottage 557 Posted May 2, 2022 1 hour ago, dport said: I added it to the html codes but there must be a setting to force twebrowser It's possible there is. My question was: What are the steps to reproduce that the website will definitely show in dark mode? Then I can test that the code will force it into light mode Share this post Link to post
dport 0 Posted May 5, 2022 On 5/2/2022 at 2:23 PM, Dave Nottage said: It's possible there is. My question was: What are the steps to reproduce that the website will definitely show in dark mode? Then I can test that the code will force it into light mode I am creating dynamic webbrowser content like: WebBrowser1.EvaluateJavaScript('document.write("hello");'); I add style section before html content to force light mode. WebBrowser1.EvaluateJavaScript('<html><head><meta name="color-scheme" content="light only"></head><style>:root { color-scheme: light only; }</style></head><body>'); WebBrowser1.EvaluateJavaScript('document.write("hello");'); I am looking a settings webbrowser force light mode or disable dark mode. Share this post Link to post