Dark mode for webview

Thanks this is working.
But there is a issue it didn’t convert black text to white.
Can you add these settings to convert black text into white.

How to convert website black text to white text with this code . Can you add these settings in this code

document.body.style.backgroundColor = "black";
document.body.style.color = "white";
1 Like

It is also working fine.
But it only convert some text to white not all so can you please make some changes

Try this in eval js :wink:

(function() {
    var css = `
        body {
            background-color: #121212 !important;
            color: #FFFFFF !important;
        }
        * {
            background-color: transparent !important;
            color: #FFFFFF !important;
            border-color: #444 !important;
        }
        a {
            color: #BB86FC !important;
        }
        header, footer, nav, aside, section, article, div {
            background-color: #1F1F1F !important;
        }
        input, textarea, select, button {
            background-color: #333 !important;
            color: #FFF !important;
            border: 1px solid #555 !important;
        }
    `;

    var style = document.createElement('style');
    style.type = 'text/css';
    style.appendChild(document.createTextNode(css));
    document.head.appendChild(style);
})();

1 Like

Thanks You Very Very Much it is working fine.
One Last Thing.
How i apply this to all pages when user click on any link the loaded page show in darkmode??

One last thing.
How can i add this script to anylink when a user click on any link in app this script how will work on any link.
Because now i click on any link it resets websits default theme and removes this js script.
How do i add this script in in any url clicked by the user

this might work im not sure
Screenshot 2024-07-21 203926

1 Like

How to ues this with a button or toggle

Can i use if then block to manage this

blocks (11)
Try this

1 Like

This Not Work on Other Pages.
Is there any other solution

What do you mean is not working?? the evaluate JS isnt working on every pages?

Yes ev js is not working on every pages

Can you made changes in js and make it like phoenix browser in night mode ??